@unified-api/typescript-sdk 2.9.15 → 2.9.16
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/README.md +12 -0
- package/docs/sdks/comment/README.md +501 -0
- package/docs/sdks/task/README.md +494 -0
- package/funcs/commentCreateTaskComment.d.ts +13 -0
- package/funcs/commentCreateTaskComment.d.ts.map +1 -0
- package/funcs/commentCreateTaskComment.js +103 -0
- package/funcs/commentCreateTaskComment.js.map +1 -0
- package/funcs/commentGetTaskComment.d.ts +13 -0
- package/funcs/commentGetTaskComment.d.ts.map +1 -0
- package/funcs/commentGetTaskComment.js +106 -0
- package/funcs/commentGetTaskComment.js.map +1 -0
- package/funcs/commentListTaskComments.d.ts +13 -0
- package/funcs/commentListTaskComments.d.ts.map +1 -0
- package/funcs/commentListTaskComments.js +110 -0
- package/funcs/commentListTaskComments.js.map +1 -0
- package/funcs/commentPatchTaskComment.d.ts +13 -0
- package/funcs/commentPatchTaskComment.d.ts.map +1 -0
- package/funcs/commentPatchTaskComment.js +107 -0
- package/funcs/commentPatchTaskComment.js.map +1 -0
- package/funcs/commentRemoveTaskComment.d.ts +12 -0
- package/funcs/commentRemoveTaskComment.d.ts.map +1 -0
- package/funcs/commentRemoveTaskComment.js +104 -0
- package/funcs/commentRemoveTaskComment.js.map +1 -0
- package/funcs/commentUpdateTaskComment.d.ts +13 -0
- package/funcs/commentUpdateTaskComment.d.ts.map +1 -0
- package/funcs/commentUpdateTaskComment.js +107 -0
- package/funcs/commentUpdateTaskComment.js.map +1 -0
- package/funcs/taskCreateTaskComment.d.ts +13 -0
- package/funcs/taskCreateTaskComment.d.ts.map +1 -0
- package/funcs/taskCreateTaskComment.js +103 -0
- package/funcs/taskCreateTaskComment.js.map +1 -0
- package/funcs/taskGetTaskComment.d.ts +13 -0
- package/funcs/taskGetTaskComment.d.ts.map +1 -0
- package/funcs/taskGetTaskComment.js +106 -0
- package/funcs/taskGetTaskComment.js.map +1 -0
- package/funcs/taskListTaskComments.d.ts +13 -0
- package/funcs/taskListTaskComments.d.ts.map +1 -0
- package/funcs/taskListTaskComments.js +110 -0
- package/funcs/taskListTaskComments.js.map +1 -0
- package/funcs/taskPatchTaskComment.d.ts +13 -0
- package/funcs/taskPatchTaskComment.d.ts.map +1 -0
- package/funcs/taskPatchTaskComment.js +107 -0
- package/funcs/taskPatchTaskComment.js.map +1 -0
- package/funcs/taskRemoveTaskComment.d.ts +12 -0
- package/funcs/taskRemoveTaskComment.d.ts.map +1 -0
- package/funcs/taskRemoveTaskComment.js +104 -0
- package/funcs/taskRemoveTaskComment.js.map +1 -0
- package/funcs/taskUpdateTaskComment.d.ts +13 -0
- package/funcs/taskUpdateTaskComment.d.ts.map +1 -0
- package/funcs/taskUpdateTaskComment.js +107 -0
- package/funcs/taskUpdateTaskComment.js.map +1 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/package.json +1 -1
- package/sdk/comment.d.ts +30 -0
- package/sdk/comment.d.ts.map +1 -0
- package/sdk/comment.js +54 -0
- package/sdk/comment.js.map +1 -0
- package/sdk/models/operations/createtaskcomment.d.ts +40 -0
- package/sdk/models/operations/createtaskcomment.d.ts.map +1 -0
- package/sdk/models/operations/createtaskcomment.js +75 -0
- package/sdk/models/operations/createtaskcomment.js.map +1 -0
- package/sdk/models/operations/gettaskcomment.d.ts +42 -0
- package/sdk/models/operations/gettaskcomment.d.ts.map +1 -0
- package/sdk/models/operations/gettaskcomment.js +72 -0
- package/sdk/models/operations/gettaskcomment.js.map +1 -0
- package/sdk/models/operations/getunifiedintegrationauth.d.ts +6 -0
- package/sdk/models/operations/getunifiedintegrationauth.d.ts.map +1 -1
- package/sdk/models/operations/getunifiedintegrationauth.js +2 -0
- package/sdk/models/operations/getunifiedintegrationauth.js.map +1 -1
- package/sdk/models/operations/index.d.ts +6 -0
- package/sdk/models/operations/index.d.ts.map +1 -1
- package/sdk/models/operations/index.js +6 -0
- package/sdk/models/operations/index.js.map +1 -1
- package/sdk/models/operations/listtaskcomments.d.ts +57 -0
- package/sdk/models/operations/listtaskcomments.d.ts.map +1 -0
- package/sdk/models/operations/listtaskcomments.js +89 -0
- package/sdk/models/operations/listtaskcomments.js.map +1 -0
- package/sdk/models/operations/patchtaskcomment.d.ts +45 -0
- package/sdk/models/operations/patchtaskcomment.d.ts.map +1 -0
- package/sdk/models/operations/patchtaskcomment.js +77 -0
- package/sdk/models/operations/patchtaskcomment.js.map +1 -0
- package/sdk/models/operations/removetaskcomment.d.ts +66 -0
- package/sdk/models/operations/removetaskcomment.d.ts.map +1 -0
- package/sdk/models/operations/removetaskcomment.js +105 -0
- package/sdk/models/operations/removetaskcomment.js.map +1 -0
- package/sdk/models/operations/updatetaskcomment.d.ts +45 -0
- package/sdk/models/operations/updatetaskcomment.d.ts.map +1 -0
- package/sdk/models/operations/updatetaskcomment.js +77 -0
- package/sdk/models/operations/updatetaskcomment.js.map +1 -0
- package/sdk/models/shared/index.d.ts +1 -0
- package/sdk/models/shared/index.d.ts.map +1 -1
- package/sdk/models/shared/index.js +1 -0
- package/sdk/models/shared/index.js.map +1 -1
- package/sdk/models/shared/propertyconnectionpermissions.d.ts +6 -0
- package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
- package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
- package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
- package/sdk/models/shared/taskcomment.d.ts +47 -0
- package/sdk/models/shared/taskcomment.d.ts.map +1 -0
- package/sdk/models/shared/taskcomment.js +92 -0
- package/sdk/models/shared/taskcomment.js.map +1 -0
- package/sdk/models/shared/tasktask.d.ts +5 -0
- package/sdk/models/shared/tasktask.d.ts.map +1 -1
- package/sdk/models/shared/tasktask.js +4 -0
- package/sdk/models/shared/tasktask.js.map +1 -1
- package/sdk/models/shared/webhook.d.ts +3 -0
- package/sdk/models/shared/webhook.d.ts.map +1 -1
- package/sdk/models/shared/webhook.js +1 -0
- package/sdk/models/shared/webhook.js.map +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/task.d.ts +24 -0
- package/sdk/task.d.ts.map +1 -1
- package/sdk/task.js +42 -0
- package/sdk/task.js.map +1 -1
- package/src/funcs/commentCreateTaskComment.ts +133 -0
- package/src/funcs/commentGetTaskComment.ts +136 -0
- package/src/funcs/commentListTaskComments.ts +140 -0
- package/src/funcs/commentPatchTaskComment.ts +137 -0
- package/src/funcs/commentRemoveTaskComment.ts +139 -0
- package/src/funcs/commentUpdateTaskComment.ts +137 -0
- package/src/funcs/taskCreateTaskComment.ts +133 -0
- package/src/funcs/taskGetTaskComment.ts +136 -0
- package/src/funcs/taskListTaskComments.ts +140 -0
- package/src/funcs/taskPatchTaskComment.ts +137 -0
- package/src/funcs/taskRemoveTaskComment.ts +139 -0
- package/src/funcs/taskUpdateTaskComment.ts +137 -0
- package/src/lib/config.ts +2 -2
- package/src/sdk/comment.ts +100 -0
- package/src/sdk/models/operations/createtaskcomment.ts +92 -0
- package/src/sdk/models/operations/gettaskcomment.ts +92 -0
- package/src/sdk/models/operations/getunifiedintegrationauth.ts +2 -0
- package/src/sdk/models/operations/index.ts +6 -0
- package/src/sdk/models/operations/listtaskcomments.ts +124 -0
- package/src/sdk/models/operations/patchtaskcomment.ts +99 -0
- package/src/sdk/models/operations/removetaskcomment.ts +151 -0
- package/src/sdk/models/operations/updatetaskcomment.ts +99 -0
- package/src/sdk/models/shared/index.ts +1 -0
- package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
- package/src/sdk/models/shared/taskcomment.ts +109 -0
- package/src/sdk/models/shared/tasktask.ts +9 -0
- package/src/sdk/models/shared/webhook.ts +1 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/task.ts +90 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
19
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
22
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
23
|
+
import { Result } from "../sdk/types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a comment
|
|
27
|
+
*/
|
|
28
|
+
export async function commentCreateTaskComment(
|
|
29
|
+
client: UnifiedToCore,
|
|
30
|
+
request: operations.CreateTaskCommentRequest,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): Promise<
|
|
33
|
+
Result<
|
|
34
|
+
shared.TaskComment,
|
|
35
|
+
| SDKError
|
|
36
|
+
| SDKValidationError
|
|
37
|
+
| UnexpectedClientError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| RequestAbortedError
|
|
40
|
+
| RequestTimeoutError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
>
|
|
43
|
+
> {
|
|
44
|
+
const parsed = safeParse(
|
|
45
|
+
request,
|
|
46
|
+
(value) => operations.CreateTaskCommentRequest$outboundSchema.parse(value),
|
|
47
|
+
"Input validation failed",
|
|
48
|
+
);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
const payload = parsed.value;
|
|
53
|
+
const body = encodeJSON("body", payload.TaskComment, { explode: true });
|
|
54
|
+
|
|
55
|
+
const pathParams = {
|
|
56
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
57
|
+
explode: false,
|
|
58
|
+
charEncoding: "percent",
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const path = pathToFunc("/task/{connection_id}/comment")(pathParams);
|
|
63
|
+
|
|
64
|
+
const query = encodeFormQuery({
|
|
65
|
+
"fields": payload.fields,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const headers = new Headers({
|
|
69
|
+
"Content-Type": "application/json",
|
|
70
|
+
Accept: "application/json",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
74
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
75
|
+
|
|
76
|
+
const context = {
|
|
77
|
+
operationID: "createTaskComment",
|
|
78
|
+
oAuth2Scopes: [],
|
|
79
|
+
|
|
80
|
+
resolvedSecurity: requestSecurity,
|
|
81
|
+
|
|
82
|
+
securitySource: client._options.security,
|
|
83
|
+
retryConfig: options?.retries
|
|
84
|
+
|| client._options.retryConfig
|
|
85
|
+
|| { strategy: "none" },
|
|
86
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const requestRes = client._createRequest(context, {
|
|
90
|
+
security: requestSecurity,
|
|
91
|
+
method: "POST",
|
|
92
|
+
baseURL: options?.serverURL,
|
|
93
|
+
path: path,
|
|
94
|
+
headers: headers,
|
|
95
|
+
query: query,
|
|
96
|
+
body: body,
|
|
97
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
98
|
+
}, options);
|
|
99
|
+
if (!requestRes.ok) {
|
|
100
|
+
return requestRes;
|
|
101
|
+
}
|
|
102
|
+
const req = requestRes.value;
|
|
103
|
+
|
|
104
|
+
const doResult = await client._do(req, {
|
|
105
|
+
context,
|
|
106
|
+
errorCodes: ["4XX", "5XX"],
|
|
107
|
+
retryConfig: context.retryConfig,
|
|
108
|
+
retryCodes: context.retryCodes,
|
|
109
|
+
});
|
|
110
|
+
if (!doResult.ok) {
|
|
111
|
+
return doResult;
|
|
112
|
+
}
|
|
113
|
+
const response = doResult.value;
|
|
114
|
+
|
|
115
|
+
const [result] = await M.match<
|
|
116
|
+
shared.TaskComment,
|
|
117
|
+
| SDKError
|
|
118
|
+
| SDKValidationError
|
|
119
|
+
| UnexpectedClientError
|
|
120
|
+
| InvalidRequestError
|
|
121
|
+
| RequestAbortedError
|
|
122
|
+
| RequestTimeoutError
|
|
123
|
+
| ConnectionError
|
|
124
|
+
>(
|
|
125
|
+
M.json(200, shared.TaskComment$inboundSchema),
|
|
126
|
+
M.fail(["4XX", "5XX"]),
|
|
127
|
+
)(response);
|
|
128
|
+
if (!result.ok) {
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
19
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
22
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
23
|
+
import { Result } from "../sdk/types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a comment
|
|
27
|
+
*/
|
|
28
|
+
export async function commentGetTaskComment(
|
|
29
|
+
client: UnifiedToCore,
|
|
30
|
+
request: operations.GetTaskCommentRequest,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): Promise<
|
|
33
|
+
Result<
|
|
34
|
+
shared.TaskComment,
|
|
35
|
+
| SDKError
|
|
36
|
+
| SDKValidationError
|
|
37
|
+
| UnexpectedClientError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| RequestAbortedError
|
|
40
|
+
| RequestTimeoutError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
>
|
|
43
|
+
> {
|
|
44
|
+
const parsed = safeParse(
|
|
45
|
+
request,
|
|
46
|
+
(value) => operations.GetTaskCommentRequest$outboundSchema.parse(value),
|
|
47
|
+
"Input validation failed",
|
|
48
|
+
);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
const payload = parsed.value;
|
|
53
|
+
const body = null;
|
|
54
|
+
|
|
55
|
+
const pathParams = {
|
|
56
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
57
|
+
explode: false,
|
|
58
|
+
charEncoding: "percent",
|
|
59
|
+
}),
|
|
60
|
+
id: encodeSimple("id", payload.id, {
|
|
61
|
+
explode: false,
|
|
62
|
+
charEncoding: "percent",
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const path = pathToFunc("/task/{connection_id}/comment/{id}")(pathParams);
|
|
67
|
+
|
|
68
|
+
const query = encodeFormQuery({
|
|
69
|
+
"fields": payload.fields,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const headers = new Headers({
|
|
73
|
+
Accept: "application/json",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
77
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
78
|
+
|
|
79
|
+
const context = {
|
|
80
|
+
operationID: "getTaskComment",
|
|
81
|
+
oAuth2Scopes: [],
|
|
82
|
+
|
|
83
|
+
resolvedSecurity: requestSecurity,
|
|
84
|
+
|
|
85
|
+
securitySource: client._options.security,
|
|
86
|
+
retryConfig: options?.retries
|
|
87
|
+
|| client._options.retryConfig
|
|
88
|
+
|| { strategy: "none" },
|
|
89
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const requestRes = client._createRequest(context, {
|
|
93
|
+
security: requestSecurity,
|
|
94
|
+
method: "GET",
|
|
95
|
+
baseURL: options?.serverURL,
|
|
96
|
+
path: path,
|
|
97
|
+
headers: headers,
|
|
98
|
+
query: query,
|
|
99
|
+
body: body,
|
|
100
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
101
|
+
}, options);
|
|
102
|
+
if (!requestRes.ok) {
|
|
103
|
+
return requestRes;
|
|
104
|
+
}
|
|
105
|
+
const req = requestRes.value;
|
|
106
|
+
|
|
107
|
+
const doResult = await client._do(req, {
|
|
108
|
+
context,
|
|
109
|
+
errorCodes: ["4XX", "5XX"],
|
|
110
|
+
retryConfig: context.retryConfig,
|
|
111
|
+
retryCodes: context.retryCodes,
|
|
112
|
+
});
|
|
113
|
+
if (!doResult.ok) {
|
|
114
|
+
return doResult;
|
|
115
|
+
}
|
|
116
|
+
const response = doResult.value;
|
|
117
|
+
|
|
118
|
+
const [result] = await M.match<
|
|
119
|
+
shared.TaskComment,
|
|
120
|
+
| SDKError
|
|
121
|
+
| SDKValidationError
|
|
122
|
+
| UnexpectedClientError
|
|
123
|
+
| InvalidRequestError
|
|
124
|
+
| RequestAbortedError
|
|
125
|
+
| RequestTimeoutError
|
|
126
|
+
| ConnectionError
|
|
127
|
+
>(
|
|
128
|
+
M.json(200, shared.TaskComment$inboundSchema),
|
|
129
|
+
M.fail(["4XX", "5XX"]),
|
|
130
|
+
)(response);
|
|
131
|
+
if (!result.ok) {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { UnifiedToCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
21
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
23
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
24
|
+
import { Result } from "../sdk/types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List all comments
|
|
28
|
+
*/
|
|
29
|
+
export async function commentListTaskComments(
|
|
30
|
+
client: UnifiedToCore,
|
|
31
|
+
request: operations.ListTaskCommentsRequest,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): Promise<
|
|
34
|
+
Result<
|
|
35
|
+
Array<shared.TaskComment>,
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
const parsed = safeParse(
|
|
46
|
+
request,
|
|
47
|
+
(value) => operations.ListTaskCommentsRequest$outboundSchema.parse(value),
|
|
48
|
+
"Input validation failed",
|
|
49
|
+
);
|
|
50
|
+
if (!parsed.ok) {
|
|
51
|
+
return parsed;
|
|
52
|
+
}
|
|
53
|
+
const payload = parsed.value;
|
|
54
|
+
const body = null;
|
|
55
|
+
|
|
56
|
+
const pathParams = {
|
|
57
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
58
|
+
explode: false,
|
|
59
|
+
charEncoding: "percent",
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const path = pathToFunc("/task/{connection_id}/comment")(pathParams);
|
|
64
|
+
|
|
65
|
+
const query = encodeFormQuery({
|
|
66
|
+
"fields": payload.fields,
|
|
67
|
+
"limit": payload.limit,
|
|
68
|
+
"offset": payload.offset,
|
|
69
|
+
"order": payload.order,
|
|
70
|
+
"query": payload.query,
|
|
71
|
+
"sort": payload.sort,
|
|
72
|
+
"task_id": payload.task_id,
|
|
73
|
+
"updated_gte": payload.updated_gte,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const headers = new Headers({
|
|
77
|
+
Accept: "application/json",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
81
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
|
+
|
|
83
|
+
const context = {
|
|
84
|
+
operationID: "listTaskComments",
|
|
85
|
+
oAuth2Scopes: [],
|
|
86
|
+
|
|
87
|
+
resolvedSecurity: requestSecurity,
|
|
88
|
+
|
|
89
|
+
securitySource: client._options.security,
|
|
90
|
+
retryConfig: options?.retries
|
|
91
|
+
|| client._options.retryConfig
|
|
92
|
+
|| { strategy: "none" },
|
|
93
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const requestRes = client._createRequest(context, {
|
|
97
|
+
security: requestSecurity,
|
|
98
|
+
method: "GET",
|
|
99
|
+
baseURL: options?.serverURL,
|
|
100
|
+
path: path,
|
|
101
|
+
headers: headers,
|
|
102
|
+
query: query,
|
|
103
|
+
body: body,
|
|
104
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
105
|
+
}, options);
|
|
106
|
+
if (!requestRes.ok) {
|
|
107
|
+
return requestRes;
|
|
108
|
+
}
|
|
109
|
+
const req = requestRes.value;
|
|
110
|
+
|
|
111
|
+
const doResult = await client._do(req, {
|
|
112
|
+
context,
|
|
113
|
+
errorCodes: ["4XX", "5XX"],
|
|
114
|
+
retryConfig: context.retryConfig,
|
|
115
|
+
retryCodes: context.retryCodes,
|
|
116
|
+
});
|
|
117
|
+
if (!doResult.ok) {
|
|
118
|
+
return doResult;
|
|
119
|
+
}
|
|
120
|
+
const response = doResult.value;
|
|
121
|
+
|
|
122
|
+
const [result] = await M.match<
|
|
123
|
+
Array<shared.TaskComment>,
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.json(200, z.array(shared.TaskComment$inboundSchema)),
|
|
133
|
+
M.fail(["4XX", "5XX"]),
|
|
134
|
+
)(response);
|
|
135
|
+
if (!result.ok) {
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
19
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
22
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
23
|
+
import { Result } from "../sdk/types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Update a comment
|
|
27
|
+
*/
|
|
28
|
+
export async function commentPatchTaskComment(
|
|
29
|
+
client: UnifiedToCore,
|
|
30
|
+
request: operations.PatchTaskCommentRequest,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): Promise<
|
|
33
|
+
Result<
|
|
34
|
+
shared.TaskComment,
|
|
35
|
+
| SDKError
|
|
36
|
+
| SDKValidationError
|
|
37
|
+
| UnexpectedClientError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| RequestAbortedError
|
|
40
|
+
| RequestTimeoutError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
>
|
|
43
|
+
> {
|
|
44
|
+
const parsed = safeParse(
|
|
45
|
+
request,
|
|
46
|
+
(value) => operations.PatchTaskCommentRequest$outboundSchema.parse(value),
|
|
47
|
+
"Input validation failed",
|
|
48
|
+
);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
const payload = parsed.value;
|
|
53
|
+
const body = encodeJSON("body", payload.TaskComment, { explode: true });
|
|
54
|
+
|
|
55
|
+
const pathParams = {
|
|
56
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
57
|
+
explode: false,
|
|
58
|
+
charEncoding: "percent",
|
|
59
|
+
}),
|
|
60
|
+
id: encodeSimple("id", payload.id, {
|
|
61
|
+
explode: false,
|
|
62
|
+
charEncoding: "percent",
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const path = pathToFunc("/task/{connection_id}/comment/{id}")(pathParams);
|
|
67
|
+
|
|
68
|
+
const query = encodeFormQuery({
|
|
69
|
+
"fields": payload.fields,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const headers = new Headers({
|
|
73
|
+
"Content-Type": "application/json",
|
|
74
|
+
Accept: "application/json",
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
78
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
79
|
+
|
|
80
|
+
const context = {
|
|
81
|
+
operationID: "patchTaskComment",
|
|
82
|
+
oAuth2Scopes: [],
|
|
83
|
+
|
|
84
|
+
resolvedSecurity: requestSecurity,
|
|
85
|
+
|
|
86
|
+
securitySource: client._options.security,
|
|
87
|
+
retryConfig: options?.retries
|
|
88
|
+
|| client._options.retryConfig
|
|
89
|
+
|| { strategy: "none" },
|
|
90
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const requestRes = client._createRequest(context, {
|
|
94
|
+
security: requestSecurity,
|
|
95
|
+
method: "PATCH",
|
|
96
|
+
baseURL: options?.serverURL,
|
|
97
|
+
path: path,
|
|
98
|
+
headers: headers,
|
|
99
|
+
query: query,
|
|
100
|
+
body: body,
|
|
101
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
102
|
+
}, options);
|
|
103
|
+
if (!requestRes.ok) {
|
|
104
|
+
return requestRes;
|
|
105
|
+
}
|
|
106
|
+
const req = requestRes.value;
|
|
107
|
+
|
|
108
|
+
const doResult = await client._do(req, {
|
|
109
|
+
context,
|
|
110
|
+
errorCodes: ["4XX", "5XX"],
|
|
111
|
+
retryConfig: context.retryConfig,
|
|
112
|
+
retryCodes: context.retryCodes,
|
|
113
|
+
});
|
|
114
|
+
if (!doResult.ok) {
|
|
115
|
+
return doResult;
|
|
116
|
+
}
|
|
117
|
+
const response = doResult.value;
|
|
118
|
+
|
|
119
|
+
const [result] = await M.match<
|
|
120
|
+
shared.TaskComment,
|
|
121
|
+
| SDKError
|
|
122
|
+
| SDKValidationError
|
|
123
|
+
| UnexpectedClientError
|
|
124
|
+
| InvalidRequestError
|
|
125
|
+
| RequestAbortedError
|
|
126
|
+
| RequestTimeoutError
|
|
127
|
+
| ConnectionError
|
|
128
|
+
>(
|
|
129
|
+
M.json(200, shared.TaskComment$inboundSchema),
|
|
130
|
+
M.fail(["4XX", "5XX"]),
|
|
131
|
+
)(response);
|
|
132
|
+
if (!result.ok) {
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
19
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
22
|
+
import { Result } from "../sdk/types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Remove a comment
|
|
26
|
+
*/
|
|
27
|
+
export async function commentRemoveTaskComment(
|
|
28
|
+
client: UnifiedToCore,
|
|
29
|
+
request: operations.RemoveTaskCommentRequest,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.RemoveTaskCommentResponse | undefined,
|
|
34
|
+
| SDKError
|
|
35
|
+
| SDKValidationError
|
|
36
|
+
| UnexpectedClientError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
>
|
|
42
|
+
> {
|
|
43
|
+
const parsed = safeParse(
|
|
44
|
+
request,
|
|
45
|
+
(value) => operations.RemoveTaskCommentRequest$outboundSchema.parse(value),
|
|
46
|
+
"Input validation failed",
|
|
47
|
+
);
|
|
48
|
+
if (!parsed.ok) {
|
|
49
|
+
return parsed;
|
|
50
|
+
}
|
|
51
|
+
const payload = parsed.value;
|
|
52
|
+
const body = null;
|
|
53
|
+
|
|
54
|
+
const pathParams = {
|
|
55
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
56
|
+
explode: false,
|
|
57
|
+
charEncoding: "percent",
|
|
58
|
+
}),
|
|
59
|
+
id: encodeSimple("id", payload.id, {
|
|
60
|
+
explode: false,
|
|
61
|
+
charEncoding: "percent",
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const path = pathToFunc("/task/{connection_id}/comment/{id}")(pathParams);
|
|
66
|
+
|
|
67
|
+
const headers = new Headers({
|
|
68
|
+
Accept: "*/*",
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
72
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
73
|
+
|
|
74
|
+
const context = {
|
|
75
|
+
operationID: "removeTaskComment",
|
|
76
|
+
oAuth2Scopes: [],
|
|
77
|
+
|
|
78
|
+
resolvedSecurity: requestSecurity,
|
|
79
|
+
|
|
80
|
+
securitySource: client._options.security,
|
|
81
|
+
retryConfig: options?.retries
|
|
82
|
+
|| client._options.retryConfig
|
|
83
|
+
|| { strategy: "none" },
|
|
84
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const requestRes = client._createRequest(context, {
|
|
88
|
+
security: requestSecurity,
|
|
89
|
+
method: "DELETE",
|
|
90
|
+
baseURL: options?.serverURL,
|
|
91
|
+
path: path,
|
|
92
|
+
headers: headers,
|
|
93
|
+
body: body,
|
|
94
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
95
|
+
}, options);
|
|
96
|
+
if (!requestRes.ok) {
|
|
97
|
+
return requestRes;
|
|
98
|
+
}
|
|
99
|
+
const req = requestRes.value;
|
|
100
|
+
|
|
101
|
+
const doResult = await client._do(req, {
|
|
102
|
+
context,
|
|
103
|
+
errorCodes: ["4XX", "5XX"],
|
|
104
|
+
retryConfig: context.retryConfig,
|
|
105
|
+
retryCodes: context.retryCodes,
|
|
106
|
+
});
|
|
107
|
+
if (!doResult.ok) {
|
|
108
|
+
return doResult;
|
|
109
|
+
}
|
|
110
|
+
const response = doResult.value;
|
|
111
|
+
|
|
112
|
+
const responseFields = {
|
|
113
|
+
HttpMeta: { Response: response, Request: req },
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const [result] = await M.match<
|
|
117
|
+
operations.RemoveTaskCommentResponse | undefined,
|
|
118
|
+
| SDKError
|
|
119
|
+
| SDKValidationError
|
|
120
|
+
| UnexpectedClientError
|
|
121
|
+
| InvalidRequestError
|
|
122
|
+
| RequestAbortedError
|
|
123
|
+
| RequestTimeoutError
|
|
124
|
+
| ConnectionError
|
|
125
|
+
>(
|
|
126
|
+
M.nil(200, operations.RemoveTaskCommentResponse$inboundSchema.optional()),
|
|
127
|
+
M.fail(["4XX", "5XX"]),
|
|
128
|
+
M.nil(
|
|
129
|
+
"default",
|
|
130
|
+
operations.RemoveTaskCommentResponse$inboundSchema.optional(),
|
|
131
|
+
{ hdrs: true },
|
|
132
|
+
),
|
|
133
|
+
)(response, { extraFields: responseFields });
|
|
134
|
+
if (!result.ok) {
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return result;
|
|
139
|
+
}
|