@automate.ax/integration-contracts 0.93.1 → 0.95.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/close/api.d.ts +3 -1
- package/dist/close/api.js +5 -2
- package/dist/close/events.d.ts +27 -27
- package/dist/close/schemas.d.ts +9 -9
- package/dist/close/schemas.js +1 -1
- package/dist/jobnimbus/api.d.ts +3 -1
- package/dist/jobnimbus/api.js +6 -5
- package/dist/trello/api.d.ts +25 -1
- package/dist/trello/api.js +56 -4
- package/dist/trello/event-schemas.d.ts +5585 -129
- package/dist/trello/event-schemas.js +324 -64
- package/dist/trello/index.d.ts +5277 -51
- package/dist/trello/index.js +106 -2
- package/dist/trello/schemas.d.ts +186 -0
- package/dist/trello/schemas.js +220 -0
- package/package.json +2 -2
- package/src/close/api.ts +5 -1
- package/src/close/schemas.ts +1 -1
- package/src/jobnimbus/api.ts +10 -4
- package/src/trello/api.ts +92 -5
- package/src/trello/event-schemas.ts +391 -91
- package/src/trello/index.ts +131 -1
- package/src/trello/schemas.ts +273 -0
package/dist/trello/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { TRELLO_BOARD_EVENT_SCHEMA, TRELLO_CARD_ARCHIVED_EVENT_SCHEMA, TRELLO_CARD_COMMENTED_EVENT_SCHEMA, TRELLO_CARD_CREATED_EVENT_SCHEMA, TRELLO_CARD_MOVED_EVENT_SCHEMA, TRELLO_CARD_UPDATED_EVENT_SCHEMA, } from "./event-schemas.js";
|
|
2
|
+
import { TRELLO_ATTACHMENT_ADDED_EVENT_SCHEMA, TRELLO_ATTACHMENT_DELETED_EVENT_SCHEMA, TRELLO_BOARD_EVENT_SCHEMA, TRELLO_CARD_ARCHIVED_EVENT_SCHEMA, TRELLO_CARD_COMMENTED_EVENT_SCHEMA, TRELLO_CARD_CREATED_EVENT_SCHEMA, TRELLO_CARD_DELETED_EVENT_SCHEMA, TRELLO_CARD_LABEL_ADDED_EVENT_SCHEMA, TRELLO_CARD_LABEL_REMOVED_EVENT_SCHEMA, TRELLO_CARD_MEMBER_ADDED_EVENT_SCHEMA, TRELLO_CARD_MEMBER_REMOVED_EVENT_SCHEMA, TRELLO_CARD_MOVED_EVENT_SCHEMA, TRELLO_CARD_RESTORED_EVENT_SCHEMA, TRELLO_CARD_UPDATED_EVENT_SCHEMA, TRELLO_CHECKLIST_CREATED_EVENT_SCHEMA, TRELLO_CHECKLIST_DELETED_EVENT_SCHEMA, TRELLO_CHECKLIST_ITEM_COMPLETED_EVENT_SCHEMA, TRELLO_CHECKLIST_ITEM_CREATED_EVENT_SCHEMA, TRELLO_CHECKLIST_ITEM_DELETED_EVENT_SCHEMA, TRELLO_CHECKLIST_ITEM_UPDATED_EVENT_SCHEMA, TRELLO_CHECKLIST_UPDATED_EVENT_SCHEMA, TRELLO_COMMENT_DELETED_EVENT_SCHEMA, TRELLO_COMMENT_UPDATED_EVENT_SCHEMA, TRELLO_CUSTOM_FIELD_CREATED_EVENT_SCHEMA, TRELLO_CUSTOM_FIELD_DELETED_EVENT_SCHEMA, TRELLO_CUSTOM_FIELD_UPDATED_EVENT_SCHEMA, TRELLO_CUSTOM_FIELD_VALUE_UPDATED_EVENT_SCHEMA, TRELLO_LIST_ARCHIVED_EVENT_SCHEMA, TRELLO_LIST_CREATED_EVENT_SCHEMA, TRELLO_LIST_MOVED_EVENT_SCHEMA, TRELLO_LIST_RESTORED_EVENT_SCHEMA, TRELLO_LIST_UPDATED_EVENT_SCHEMA, } from "./event-schemas.js";
|
|
3
3
|
export * from "./api.js";
|
|
4
4
|
export * from "./event-schemas.js";
|
|
5
5
|
export * from "./schemas.js";
|
|
6
6
|
/** Canonical Trello board selected by one webhook subscription. */
|
|
7
7
|
export const TRELLO_TRIGGER_CONFIG_SCHEMA = z.object({
|
|
8
|
-
boardId: z.string(),
|
|
8
|
+
boardId: z.string().trim().min(1),
|
|
9
9
|
});
|
|
10
10
|
export const trelloTriggerContracts = {
|
|
11
11
|
"trello.board.event": {
|
|
@@ -16,6 +16,26 @@ export const trelloTriggerContracts = {
|
|
|
16
16
|
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
17
17
|
eventSchema: TRELLO_CARD_ARCHIVED_EVENT_SCHEMA,
|
|
18
18
|
},
|
|
19
|
+
"trello.card.deleted": {
|
|
20
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
21
|
+
eventSchema: TRELLO_CARD_DELETED_EVENT_SCHEMA,
|
|
22
|
+
},
|
|
23
|
+
"trello.card.label.added": {
|
|
24
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
25
|
+
eventSchema: TRELLO_CARD_LABEL_ADDED_EVENT_SCHEMA,
|
|
26
|
+
},
|
|
27
|
+
"trello.card.label.removed": {
|
|
28
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
29
|
+
eventSchema: TRELLO_CARD_LABEL_REMOVED_EVENT_SCHEMA,
|
|
30
|
+
},
|
|
31
|
+
"trello.card.member.added": {
|
|
32
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
33
|
+
eventSchema: TRELLO_CARD_MEMBER_ADDED_EVENT_SCHEMA,
|
|
34
|
+
},
|
|
35
|
+
"trello.card.member.removed": {
|
|
36
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
37
|
+
eventSchema: TRELLO_CARD_MEMBER_REMOVED_EVENT_SCHEMA,
|
|
38
|
+
},
|
|
19
39
|
"trello.card.commented": {
|
|
20
40
|
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
21
41
|
eventSchema: TRELLO_CARD_COMMENTED_EVENT_SCHEMA,
|
|
@@ -28,8 +48,92 @@ export const trelloTriggerContracts = {
|
|
|
28
48
|
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
29
49
|
eventSchema: TRELLO_CARD_MOVED_EVENT_SCHEMA,
|
|
30
50
|
},
|
|
51
|
+
"trello.card.restored": {
|
|
52
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
53
|
+
eventSchema: TRELLO_CARD_RESTORED_EVENT_SCHEMA,
|
|
54
|
+
},
|
|
31
55
|
"trello.card.updated": {
|
|
32
56
|
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
33
57
|
eventSchema: TRELLO_CARD_UPDATED_EVENT_SCHEMA,
|
|
34
58
|
},
|
|
59
|
+
"trello.attachment.added": {
|
|
60
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
61
|
+
eventSchema: TRELLO_ATTACHMENT_ADDED_EVENT_SCHEMA,
|
|
62
|
+
},
|
|
63
|
+
"trello.attachment.deleted": {
|
|
64
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
65
|
+
eventSchema: TRELLO_ATTACHMENT_DELETED_EVENT_SCHEMA,
|
|
66
|
+
},
|
|
67
|
+
"trello.checklist.created": {
|
|
68
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
69
|
+
eventSchema: TRELLO_CHECKLIST_CREATED_EVENT_SCHEMA,
|
|
70
|
+
},
|
|
71
|
+
"trello.checklist.deleted": {
|
|
72
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
73
|
+
eventSchema: TRELLO_CHECKLIST_DELETED_EVENT_SCHEMA,
|
|
74
|
+
},
|
|
75
|
+
"trello.checklist.updated": {
|
|
76
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
77
|
+
eventSchema: TRELLO_CHECKLIST_UPDATED_EVENT_SCHEMA,
|
|
78
|
+
},
|
|
79
|
+
"trello.checklist-item.completed": {
|
|
80
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
81
|
+
eventSchema: TRELLO_CHECKLIST_ITEM_COMPLETED_EVENT_SCHEMA,
|
|
82
|
+
},
|
|
83
|
+
"trello.checklist-item.created": {
|
|
84
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
85
|
+
eventSchema: TRELLO_CHECKLIST_ITEM_CREATED_EVENT_SCHEMA,
|
|
86
|
+
},
|
|
87
|
+
"trello.checklist-item.deleted": {
|
|
88
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
89
|
+
eventSchema: TRELLO_CHECKLIST_ITEM_DELETED_EVENT_SCHEMA,
|
|
90
|
+
},
|
|
91
|
+
"trello.checklist-item.updated": {
|
|
92
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
93
|
+
eventSchema: TRELLO_CHECKLIST_ITEM_UPDATED_EVENT_SCHEMA,
|
|
94
|
+
},
|
|
95
|
+
"trello.comment.deleted": {
|
|
96
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
97
|
+
eventSchema: TRELLO_COMMENT_DELETED_EVENT_SCHEMA,
|
|
98
|
+
},
|
|
99
|
+
"trello.comment.updated": {
|
|
100
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
101
|
+
eventSchema: TRELLO_COMMENT_UPDATED_EVENT_SCHEMA,
|
|
102
|
+
},
|
|
103
|
+
"trello.custom-field.created": {
|
|
104
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
105
|
+
eventSchema: TRELLO_CUSTOM_FIELD_CREATED_EVENT_SCHEMA,
|
|
106
|
+
},
|
|
107
|
+
"trello.custom-field.deleted": {
|
|
108
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
109
|
+
eventSchema: TRELLO_CUSTOM_FIELD_DELETED_EVENT_SCHEMA,
|
|
110
|
+
},
|
|
111
|
+
"trello.custom-field.updated": {
|
|
112
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
113
|
+
eventSchema: TRELLO_CUSTOM_FIELD_UPDATED_EVENT_SCHEMA,
|
|
114
|
+
},
|
|
115
|
+
"trello.custom-field.value.updated": {
|
|
116
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
117
|
+
eventSchema: TRELLO_CUSTOM_FIELD_VALUE_UPDATED_EVENT_SCHEMA,
|
|
118
|
+
},
|
|
119
|
+
"trello.list.archived": {
|
|
120
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
121
|
+
eventSchema: TRELLO_LIST_ARCHIVED_EVENT_SCHEMA,
|
|
122
|
+
},
|
|
123
|
+
"trello.list.created": {
|
|
124
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
125
|
+
eventSchema: TRELLO_LIST_CREATED_EVENT_SCHEMA,
|
|
126
|
+
},
|
|
127
|
+
"trello.list.moved": {
|
|
128
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
129
|
+
eventSchema: TRELLO_LIST_MOVED_EVENT_SCHEMA,
|
|
130
|
+
},
|
|
131
|
+
"trello.list.restored": {
|
|
132
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
133
|
+
eventSchema: TRELLO_LIST_RESTORED_EVENT_SCHEMA,
|
|
134
|
+
},
|
|
135
|
+
"trello.list.updated": {
|
|
136
|
+
configSchema: TRELLO_TRIGGER_CONFIG_SCHEMA,
|
|
137
|
+
eventSchema: TRELLO_LIST_UPDATED_EVENT_SCHEMA,
|
|
138
|
+
},
|
|
35
139
|
};
|
package/dist/trello/schemas.d.ts
CHANGED
|
@@ -7,6 +7,14 @@ export declare const TRELLO_MEMBER_SCHEMA: z.ZodObject<{
|
|
|
7
7
|
url: z.ZodNullable<z.ZodString>;
|
|
8
8
|
username: z.ZodString;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
+
export declare const TRELLO_WORKSPACE_SCHEMA: z.ZodObject<{
|
|
11
|
+
lastActivityAt: z.ZodNullable<z.ZodDate>;
|
|
12
|
+
displayName: z.ZodString;
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
url: z.ZodNullable<z.ZodString>;
|
|
16
|
+
website: z.ZodNullable<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
10
18
|
export declare const TRELLO_BOARD_SCHEMA: z.ZodObject<{
|
|
11
19
|
closed: z.ZodBoolean;
|
|
12
20
|
description: z.ZodString;
|
|
@@ -19,6 +27,17 @@ export declare const TRELLO_BOARD_SCHEMA: z.ZodObject<{
|
|
|
19
27
|
subscribed: z.ZodBoolean;
|
|
20
28
|
url: z.ZodString;
|
|
21
29
|
}, z.core.$strip>;
|
|
30
|
+
export declare const TRELLO_BOARD_MEMBERSHIP_SCHEMA: z.ZodObject<{
|
|
31
|
+
deactivated: z.ZodBoolean;
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
memberId: z.ZodString;
|
|
34
|
+
memberType: z.ZodEnum<{
|
|
35
|
+
normal: "normal";
|
|
36
|
+
admin: "admin";
|
|
37
|
+
observer: "observer";
|
|
38
|
+
}>;
|
|
39
|
+
unconfirmed: z.ZodBoolean;
|
|
40
|
+
}, z.core.$strip>;
|
|
22
41
|
export declare const TRELLO_LIST_SCHEMA: z.ZodObject<{
|
|
23
42
|
boardId: z.ZodString;
|
|
24
43
|
closed: z.ZodBoolean;
|
|
@@ -112,6 +131,72 @@ export declare const TRELLO_CHECKLIST_SCHEMA: z.ZodObject<{
|
|
|
112
131
|
name: z.ZodString;
|
|
113
132
|
position: z.ZodNumber;
|
|
114
133
|
}, z.core.$strip>;
|
|
134
|
+
export declare const TRELLO_CUSTOM_FIELD_OPTION_SCHEMA: z.ZodObject<{
|
|
135
|
+
color: z.ZodString;
|
|
136
|
+
customFieldId: z.ZodString;
|
|
137
|
+
id: z.ZodString;
|
|
138
|
+
position: z.ZodNumber;
|
|
139
|
+
text: z.ZodString;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export declare const TRELLO_CUSTOM_FIELD_SCHEMA: z.ZodObject<{
|
|
142
|
+
displayOnCardFront: z.ZodBoolean;
|
|
143
|
+
fieldGroup: z.ZodOptional<z.ZodString>;
|
|
144
|
+
id: z.ZodString;
|
|
145
|
+
modelId: z.ZodString;
|
|
146
|
+
name: z.ZodString;
|
|
147
|
+
options: z.ZodArray<z.ZodObject<{
|
|
148
|
+
color: z.ZodString;
|
|
149
|
+
customFieldId: z.ZodString;
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
position: z.ZodNumber;
|
|
152
|
+
text: z.ZodString;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
position: z.ZodNumber;
|
|
155
|
+
type: z.ZodEnum<{
|
|
156
|
+
number: "number";
|
|
157
|
+
date: "date";
|
|
158
|
+
text: "text";
|
|
159
|
+
checkbox: "checkbox";
|
|
160
|
+
list: "list";
|
|
161
|
+
}>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export declare const TRELLO_CUSTOM_FIELD_VALUE_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
164
|
+
checked: z.ZodBoolean;
|
|
165
|
+
type: z.ZodLiteral<"checkbox">;
|
|
166
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
167
|
+
date: z.ZodDate;
|
|
168
|
+
type: z.ZodLiteral<"date">;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
optionId: z.ZodString;
|
|
171
|
+
type: z.ZodLiteral<"list">;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
number: z.ZodString;
|
|
174
|
+
type: z.ZodLiteral<"number">;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
text: z.ZodString;
|
|
177
|
+
type: z.ZodLiteral<"text">;
|
|
178
|
+
}, z.core.$strip>], "type">;
|
|
179
|
+
export declare const TRELLO_CUSTOM_FIELD_ITEM_SCHEMA: z.ZodObject<{
|
|
180
|
+
cardId: z.ZodString;
|
|
181
|
+
customFieldId: z.ZodString;
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
value: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
184
|
+
checked: z.ZodBoolean;
|
|
185
|
+
type: z.ZodLiteral<"checkbox">;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
date: z.ZodDate;
|
|
188
|
+
type: z.ZodLiteral<"date">;
|
|
189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
190
|
+
optionId: z.ZodString;
|
|
191
|
+
type: z.ZodLiteral<"list">;
|
|
192
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
193
|
+
number: z.ZodString;
|
|
194
|
+
type: z.ZodLiteral<"number">;
|
|
195
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
196
|
+
text: z.ZodString;
|
|
197
|
+
type: z.ZodLiteral<"text">;
|
|
198
|
+
}, z.core.$strip>], "type">;
|
|
199
|
+
}, z.core.$strip>;
|
|
115
200
|
export declare const TRELLO_PROVIDER_MEMBER_SCHEMA: z.ZodObject<{
|
|
116
201
|
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
202
|
fullName: z.ZodString;
|
|
@@ -120,6 +205,14 @@ export declare const TRELLO_PROVIDER_MEMBER_SCHEMA: z.ZodObject<{
|
|
|
120
205
|
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
121
206
|
username: z.ZodString;
|
|
122
207
|
}, z.core.$loose>;
|
|
208
|
+
export declare const TRELLO_PROVIDER_WORKSPACE_SCHEMA: z.ZodObject<{
|
|
209
|
+
dateLastActivity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
210
|
+
displayName: z.ZodString;
|
|
211
|
+
id: z.ZodString;
|
|
212
|
+
name: z.ZodString;
|
|
213
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
website: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
}, z.core.$loose>;
|
|
123
216
|
export declare const TRELLO_PROVIDER_BOARD_SCHEMA: z.ZodObject<{
|
|
124
217
|
closed: z.ZodPrefault<z.ZodBoolean>;
|
|
125
218
|
dateLastActivity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -132,6 +225,17 @@ export declare const TRELLO_PROVIDER_BOARD_SCHEMA: z.ZodObject<{
|
|
|
132
225
|
subscribed: z.ZodPrefault<z.ZodBoolean>;
|
|
133
226
|
url: z.ZodPrefault<z.ZodString>;
|
|
134
227
|
}, z.core.$loose>;
|
|
228
|
+
export declare const TRELLO_PROVIDER_BOARD_MEMBERSHIP_SCHEMA: z.ZodObject<{
|
|
229
|
+
deactivated: z.ZodBoolean;
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
idMember: z.ZodString;
|
|
232
|
+
memberType: z.ZodEnum<{
|
|
233
|
+
normal: "normal";
|
|
234
|
+
admin: "admin";
|
|
235
|
+
observer: "observer";
|
|
236
|
+
}>;
|
|
237
|
+
unconfirmed: z.ZodBoolean;
|
|
238
|
+
}, z.core.$loose>;
|
|
135
239
|
export declare const TRELLO_PROVIDER_LIST_SCHEMA: z.ZodObject<{
|
|
136
240
|
closed: z.ZodPrefault<z.ZodBoolean>;
|
|
137
241
|
id: z.ZodString;
|
|
@@ -227,18 +331,82 @@ export declare const TRELLO_PROVIDER_CHECKLIST_SCHEMA: z.ZodObject<{
|
|
|
227
331
|
name: z.ZodString;
|
|
228
332
|
pos: z.ZodNumber;
|
|
229
333
|
}, z.core.$loose>;
|
|
334
|
+
export declare const TRELLO_PROVIDER_CUSTOM_FIELD_OPTION_SCHEMA: z.ZodObject<{
|
|
335
|
+
color: z.ZodPrefault<z.ZodString>;
|
|
336
|
+
id: z.ZodString;
|
|
337
|
+
idCustomField: z.ZodString;
|
|
338
|
+
pos: z.ZodNumber;
|
|
339
|
+
value: z.ZodObject<{
|
|
340
|
+
text: z.ZodString;
|
|
341
|
+
}, z.core.$loose>;
|
|
342
|
+
}, z.core.$loose>;
|
|
343
|
+
export declare const TRELLO_PROVIDER_CUSTOM_FIELD_SCHEMA: z.ZodObject<{
|
|
344
|
+
display: z.ZodPrefault<z.ZodObject<{
|
|
345
|
+
cardFront: z.ZodPrefault<z.ZodBoolean>;
|
|
346
|
+
}, z.core.$loose>>;
|
|
347
|
+
fieldGroup: z.ZodOptional<z.ZodString>;
|
|
348
|
+
id: z.ZodString;
|
|
349
|
+
idModel: z.ZodString;
|
|
350
|
+
modelType: z.ZodLiteral<"board">;
|
|
351
|
+
name: z.ZodString;
|
|
352
|
+
options: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
353
|
+
color: z.ZodPrefault<z.ZodString>;
|
|
354
|
+
id: z.ZodString;
|
|
355
|
+
idCustomField: z.ZodString;
|
|
356
|
+
pos: z.ZodNumber;
|
|
357
|
+
value: z.ZodObject<{
|
|
358
|
+
text: z.ZodString;
|
|
359
|
+
}, z.core.$loose>;
|
|
360
|
+
}, z.core.$loose>>>;
|
|
361
|
+
pos: z.ZodNumber;
|
|
362
|
+
type: z.ZodEnum<{
|
|
363
|
+
number: "number";
|
|
364
|
+
date: "date";
|
|
365
|
+
text: "text";
|
|
366
|
+
checkbox: "checkbox";
|
|
367
|
+
list: "list";
|
|
368
|
+
}>;
|
|
369
|
+
}, z.core.$loose>;
|
|
370
|
+
export declare const TRELLO_PROVIDER_CUSTOM_FIELD_ITEM_SCHEMA: z.ZodObject<{
|
|
371
|
+
id: z.ZodString;
|
|
372
|
+
idCustomField: z.ZodString;
|
|
373
|
+
idModel: z.ZodString;
|
|
374
|
+
idValue: z.ZodOptional<z.ZodString>;
|
|
375
|
+
modelType: z.ZodLiteral<"card">;
|
|
376
|
+
value: z.ZodOptional<z.ZodObject<{
|
|
377
|
+
checked: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
378
|
+
true: "true";
|
|
379
|
+
false: "false";
|
|
380
|
+
}>]>>;
|
|
381
|
+
date: z.ZodOptional<z.ZodString>;
|
|
382
|
+
number: z.ZodOptional<z.ZodString>;
|
|
383
|
+
text: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$loose>>;
|
|
385
|
+
}, z.core.$loose>;
|
|
230
386
|
/**
|
|
231
387
|
* Normalizes one Trello member response.
|
|
232
388
|
*
|
|
233
389
|
* @param member - Provider member resource.
|
|
234
390
|
*/
|
|
235
391
|
export declare function toTrelloMember(member: z.output<typeof TRELLO_PROVIDER_MEMBER_SCHEMA>): z.output<typeof TRELLO_MEMBER_SCHEMA>;
|
|
392
|
+
/**
|
|
393
|
+
* Normalizes one Trello Workspace response.
|
|
394
|
+
*
|
|
395
|
+
* @param workspace - Provider Workspace resource.
|
|
396
|
+
*/
|
|
397
|
+
export declare function toTrelloWorkspace(workspace: z.output<typeof TRELLO_PROVIDER_WORKSPACE_SCHEMA>): z.output<typeof TRELLO_WORKSPACE_SCHEMA>;
|
|
236
398
|
/**
|
|
237
399
|
* Normalizes one Trello board response.
|
|
238
400
|
*
|
|
239
401
|
* @param board - Provider board resource.
|
|
240
402
|
*/
|
|
241
403
|
export declare function toTrelloBoard(board: z.output<typeof TRELLO_PROVIDER_BOARD_SCHEMA>): z.output<typeof TRELLO_BOARD_SCHEMA>;
|
|
404
|
+
/**
|
|
405
|
+
* Normalizes one Trello board membership response.
|
|
406
|
+
*
|
|
407
|
+
* @param membership - Provider board membership resource.
|
|
408
|
+
*/
|
|
409
|
+
export declare function toTrelloBoardMembership(membership: z.output<typeof TRELLO_PROVIDER_BOARD_MEMBERSHIP_SCHEMA>): z.output<typeof TRELLO_BOARD_MEMBERSHIP_SCHEMA>;
|
|
242
410
|
/**
|
|
243
411
|
* Normalizes one Trello list response.
|
|
244
412
|
*
|
|
@@ -281,3 +449,21 @@ export declare function toTrelloCheckItem(item: z.output<typeof TRELLO_PROVIDER_
|
|
|
281
449
|
* @param checklist - Provider checklist resource.
|
|
282
450
|
*/
|
|
283
451
|
export declare function toTrelloChecklist(checklist: z.output<typeof TRELLO_PROVIDER_CHECKLIST_SCHEMA>): z.output<typeof TRELLO_CHECKLIST_SCHEMA>;
|
|
452
|
+
/**
|
|
453
|
+
* Normalizes one Trello Custom Field option.
|
|
454
|
+
*
|
|
455
|
+
* @param option - Provider Custom Field option.
|
|
456
|
+
*/
|
|
457
|
+
export declare function toTrelloCustomFieldOption(option: z.output<typeof TRELLO_PROVIDER_CUSTOM_FIELD_OPTION_SCHEMA>): z.output<typeof TRELLO_CUSTOM_FIELD_OPTION_SCHEMA>;
|
|
458
|
+
/**
|
|
459
|
+
* Normalizes one Trello Custom Field definition.
|
|
460
|
+
*
|
|
461
|
+
* @param field - Provider Custom Field definition.
|
|
462
|
+
*/
|
|
463
|
+
export declare function toTrelloCustomField(field: z.output<typeof TRELLO_PROVIDER_CUSTOM_FIELD_SCHEMA>): z.output<typeof TRELLO_CUSTOM_FIELD_SCHEMA>;
|
|
464
|
+
/**
|
|
465
|
+
* Normalizes one typed Trello card Custom Field value.
|
|
466
|
+
*
|
|
467
|
+
* @param item - Provider Custom Field item.
|
|
468
|
+
*/
|
|
469
|
+
export declare function toTrelloCustomFieldItem(item: z.output<typeof TRELLO_PROVIDER_CUSTOM_FIELD_ITEM_SCHEMA>): z.output<typeof TRELLO_CUSTOM_FIELD_ITEM_SCHEMA>;
|
package/dist/trello/schemas.js
CHANGED
|
@@ -18,6 +18,20 @@ export const TRELLO_MEMBER_SCHEMA = z.object({
|
|
|
18
18
|
/** Unique Trello username. */
|
|
19
19
|
username: z.string(),
|
|
20
20
|
});
|
|
21
|
+
export const TRELLO_WORKSPACE_SCHEMA = z.object({
|
|
22
|
+
/** Last activity time across the Workspace. */
|
|
23
|
+
lastActivityAt: z.date().nullable(),
|
|
24
|
+
/** Human-readable Workspace name. */
|
|
25
|
+
displayName: z.string(),
|
|
26
|
+
/** Stable Trello Workspace ID. */
|
|
27
|
+
id: z.string(),
|
|
28
|
+
/** URL-safe Workspace name. */
|
|
29
|
+
name: z.string(),
|
|
30
|
+
/** Public Trello Workspace URL. */
|
|
31
|
+
url: z.string().nullable(),
|
|
32
|
+
/** Public Workspace website, when configured. */
|
|
33
|
+
website: z.string().nullable(),
|
|
34
|
+
});
|
|
21
35
|
export const TRELLO_BOARD_SCHEMA = z.object({
|
|
22
36
|
/** Whether the board is archived. */
|
|
23
37
|
closed: z.boolean(),
|
|
@@ -40,6 +54,18 @@ export const TRELLO_BOARD_SCHEMA = z.object({
|
|
|
40
54
|
/** Full Trello board URL. */
|
|
41
55
|
url: z.string(),
|
|
42
56
|
});
|
|
57
|
+
export const TRELLO_BOARD_MEMBERSHIP_SCHEMA = z.object({
|
|
58
|
+
/** Whether the member is deactivated on this board. */
|
|
59
|
+
deactivated: z.boolean(),
|
|
60
|
+
/** Stable Trello board membership ID. */
|
|
61
|
+
id: z.string(),
|
|
62
|
+
/** Stable Trello member ID represented by this membership. */
|
|
63
|
+
memberId: z.string(),
|
|
64
|
+
/** Member's role on this board. */
|
|
65
|
+
memberType: z.enum(["admin", "normal", "observer"]),
|
|
66
|
+
/** Whether this membership is an unconfirmed invitation. */
|
|
67
|
+
unconfirmed: z.boolean(),
|
|
68
|
+
});
|
|
43
69
|
export const TRELLO_LIST_SCHEMA = z.object({
|
|
44
70
|
/** Stable ID of the containing board. */
|
|
45
71
|
boardId: z.string(),
|
|
@@ -160,6 +186,53 @@ export const TRELLO_CHECKLIST_SCHEMA = z.object({
|
|
|
160
186
|
/** Trello ordering position. */
|
|
161
187
|
position: z.number(),
|
|
162
188
|
});
|
|
189
|
+
export const TRELLO_CUSTOM_FIELD_OPTION_SCHEMA = z.object({
|
|
190
|
+
/** Trello label color, or `none`. */
|
|
191
|
+
color: z.string(),
|
|
192
|
+
/** Stable Trello Custom Field ID. */
|
|
193
|
+
customFieldId: z.string(),
|
|
194
|
+
/** Stable Trello Custom Field option ID. */
|
|
195
|
+
id: z.string(),
|
|
196
|
+
/** Trello ordering position. */
|
|
197
|
+
position: z.number(),
|
|
198
|
+
/** Human-readable dropdown value. */
|
|
199
|
+
text: z.string(),
|
|
200
|
+
});
|
|
201
|
+
export const TRELLO_CUSTOM_FIELD_SCHEMA = z.object({
|
|
202
|
+
/** Whether the field is displayed on card fronts. */
|
|
203
|
+
displayOnCardFront: z.boolean(),
|
|
204
|
+
/** Stable Trello field-group hash. */
|
|
205
|
+
fieldGroup: z.string().optional(),
|
|
206
|
+
/** Stable Trello Custom Field ID. */
|
|
207
|
+
id: z.string(),
|
|
208
|
+
/** Board containing the Custom Field. */
|
|
209
|
+
modelId: z.string(),
|
|
210
|
+
/** Custom Field name. */
|
|
211
|
+
name: z.string(),
|
|
212
|
+
/** Dropdown options, for list fields. */
|
|
213
|
+
options: TRELLO_CUSTOM_FIELD_OPTION_SCHEMA.array(),
|
|
214
|
+
/** Trello ordering position. */
|
|
215
|
+
position: z.number(),
|
|
216
|
+
/** Custom Field value type. */
|
|
217
|
+
type: z.enum(["checkbox", "date", "list", "number", "text"]),
|
|
218
|
+
});
|
|
219
|
+
export const TRELLO_CUSTOM_FIELD_VALUE_SCHEMA = z.discriminatedUnion("type", [
|
|
220
|
+
z.object({ checked: z.boolean(), type: z.literal("checkbox") }),
|
|
221
|
+
z.object({ date: z.date(), type: z.literal("date") }),
|
|
222
|
+
z.object({ optionId: z.string(), type: z.literal("list") }),
|
|
223
|
+
z.object({ number: z.string(), type: z.literal("number") }),
|
|
224
|
+
z.object({ text: z.string(), type: z.literal("text") }),
|
|
225
|
+
]);
|
|
226
|
+
export const TRELLO_CUSTOM_FIELD_ITEM_SCHEMA = z.object({
|
|
227
|
+
/** Card containing the value. */
|
|
228
|
+
cardId: z.string(),
|
|
229
|
+
/** Custom Field definition represented by the value. */
|
|
230
|
+
customFieldId: z.string(),
|
|
231
|
+
/** Stable Trello Custom Field item ID. */
|
|
232
|
+
id: z.string(),
|
|
233
|
+
/** Typed value stored on the card. */
|
|
234
|
+
value: TRELLO_CUSTOM_FIELD_VALUE_SCHEMA,
|
|
235
|
+
});
|
|
163
236
|
export const TRELLO_PROVIDER_MEMBER_SCHEMA = z.looseObject({
|
|
164
237
|
avatarUrl: z.string().nullable().optional(),
|
|
165
238
|
fullName: z.string(),
|
|
@@ -168,6 +241,14 @@ export const TRELLO_PROVIDER_MEMBER_SCHEMA = z.looseObject({
|
|
|
168
241
|
url: z.string().nullable().optional(),
|
|
169
242
|
username: z.string(),
|
|
170
243
|
});
|
|
244
|
+
export const TRELLO_PROVIDER_WORKSPACE_SCHEMA = z.looseObject({
|
|
245
|
+
dateLastActivity: z.string().nullable().optional(),
|
|
246
|
+
displayName: z.string(),
|
|
247
|
+
id: z.string(),
|
|
248
|
+
name: z.string(),
|
|
249
|
+
url: z.string().nullable().optional(),
|
|
250
|
+
website: z.string().nullable().optional(),
|
|
251
|
+
});
|
|
171
252
|
export const TRELLO_PROVIDER_BOARD_SCHEMA = z.looseObject({
|
|
172
253
|
closed: z.boolean().prefault(false),
|
|
173
254
|
dateLastActivity: z.string().nullable().optional(),
|
|
@@ -180,6 +261,13 @@ export const TRELLO_PROVIDER_BOARD_SCHEMA = z.looseObject({
|
|
|
180
261
|
subscribed: z.boolean().prefault(false),
|
|
181
262
|
url: z.string().prefault(""),
|
|
182
263
|
});
|
|
264
|
+
export const TRELLO_PROVIDER_BOARD_MEMBERSHIP_SCHEMA = z.looseObject({
|
|
265
|
+
deactivated: z.boolean(),
|
|
266
|
+
id: z.string(),
|
|
267
|
+
idMember: z.string(),
|
|
268
|
+
memberType: z.enum(["admin", "normal", "observer"]),
|
|
269
|
+
unconfirmed: z.boolean(),
|
|
270
|
+
});
|
|
183
271
|
export const TRELLO_PROVIDER_LIST_SCHEMA = z.looseObject({
|
|
184
272
|
closed: z.boolean().prefault(false),
|
|
185
273
|
id: z.string(),
|
|
@@ -247,6 +335,40 @@ export const TRELLO_PROVIDER_CHECKLIST_SCHEMA = z.looseObject({
|
|
|
247
335
|
name: z.string(),
|
|
248
336
|
pos: z.number(),
|
|
249
337
|
});
|
|
338
|
+
export const TRELLO_PROVIDER_CUSTOM_FIELD_OPTION_SCHEMA = z.looseObject({
|
|
339
|
+
color: z.string().prefault("none"),
|
|
340
|
+
id: z.string(),
|
|
341
|
+
idCustomField: z.string(),
|
|
342
|
+
pos: z.number(),
|
|
343
|
+
value: z.looseObject({ text: z.string() }),
|
|
344
|
+
});
|
|
345
|
+
export const TRELLO_PROVIDER_CUSTOM_FIELD_SCHEMA = z.looseObject({
|
|
346
|
+
display: z
|
|
347
|
+
.looseObject({ cardFront: z.boolean().prefault(true) })
|
|
348
|
+
.prefault({ cardFront: true }),
|
|
349
|
+
fieldGroup: z.string().optional(),
|
|
350
|
+
id: z.string(),
|
|
351
|
+
idModel: z.string(),
|
|
352
|
+
modelType: z.literal("board"),
|
|
353
|
+
name: z.string(),
|
|
354
|
+
options: TRELLO_PROVIDER_CUSTOM_FIELD_OPTION_SCHEMA.array().prefault([]),
|
|
355
|
+
pos: z.number(),
|
|
356
|
+
type: z.enum(["checkbox", "date", "list", "number", "text"]),
|
|
357
|
+
});
|
|
358
|
+
const TRELLO_PROVIDER_CUSTOM_FIELD_VALUE_SCHEMA = z.looseObject({
|
|
359
|
+
checked: z.union([z.boolean(), z.enum(["true", "false"])]).optional(),
|
|
360
|
+
date: z.string().optional(),
|
|
361
|
+
number: z.string().optional(),
|
|
362
|
+
text: z.string().optional(),
|
|
363
|
+
});
|
|
364
|
+
export const TRELLO_PROVIDER_CUSTOM_FIELD_ITEM_SCHEMA = z.looseObject({
|
|
365
|
+
id: z.string(),
|
|
366
|
+
idCustomField: z.string(),
|
|
367
|
+
idModel: z.string(),
|
|
368
|
+
idValue: z.string().optional(),
|
|
369
|
+
modelType: z.literal("card"),
|
|
370
|
+
value: TRELLO_PROVIDER_CUSTOM_FIELD_VALUE_SCHEMA.optional(),
|
|
371
|
+
});
|
|
250
372
|
/**
|
|
251
373
|
* Normalizes one Trello member response.
|
|
252
374
|
*
|
|
@@ -262,6 +384,21 @@ export function toTrelloMember(member) {
|
|
|
262
384
|
username: member.username,
|
|
263
385
|
};
|
|
264
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* Normalizes one Trello Workspace response.
|
|
389
|
+
*
|
|
390
|
+
* @param workspace - Provider Workspace resource.
|
|
391
|
+
*/
|
|
392
|
+
export function toTrelloWorkspace(workspace) {
|
|
393
|
+
return {
|
|
394
|
+
displayName: workspace.displayName,
|
|
395
|
+
id: workspace.id,
|
|
396
|
+
lastActivityAt: OPTIONAL_DATE_SCHEMA.parse(workspace.dateLastActivity),
|
|
397
|
+
name: workspace.name,
|
|
398
|
+
url: workspace.url ?? null,
|
|
399
|
+
website: workspace.website ?? null,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
265
402
|
/**
|
|
266
403
|
* Normalizes one Trello board response.
|
|
267
404
|
*
|
|
@@ -281,6 +418,20 @@ export function toTrelloBoard(board) {
|
|
|
281
418
|
url: board.url,
|
|
282
419
|
};
|
|
283
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* Normalizes one Trello board membership response.
|
|
423
|
+
*
|
|
424
|
+
* @param membership - Provider board membership resource.
|
|
425
|
+
*/
|
|
426
|
+
export function toTrelloBoardMembership(membership) {
|
|
427
|
+
return {
|
|
428
|
+
deactivated: membership.deactivated,
|
|
429
|
+
id: membership.id,
|
|
430
|
+
memberId: membership.idMember,
|
|
431
|
+
memberType: membership.memberType,
|
|
432
|
+
unconfirmed: membership.unconfirmed,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
284
435
|
/**
|
|
285
436
|
* Normalizes one Trello list response.
|
|
286
437
|
*
|
|
@@ -399,3 +550,72 @@ export function toTrelloChecklist(checklist) {
|
|
|
399
550
|
position: checklist.pos,
|
|
400
551
|
};
|
|
401
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Normalizes one Trello Custom Field option.
|
|
555
|
+
*
|
|
556
|
+
* @param option - Provider Custom Field option.
|
|
557
|
+
*/
|
|
558
|
+
export function toTrelloCustomFieldOption(option) {
|
|
559
|
+
return {
|
|
560
|
+
color: option.color,
|
|
561
|
+
customFieldId: option.idCustomField,
|
|
562
|
+
id: option.id,
|
|
563
|
+
position: option.pos,
|
|
564
|
+
text: option.value.text,
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Normalizes one Trello Custom Field definition.
|
|
569
|
+
*
|
|
570
|
+
* @param field - Provider Custom Field definition.
|
|
571
|
+
*/
|
|
572
|
+
export function toTrelloCustomField(field) {
|
|
573
|
+
return {
|
|
574
|
+
displayOnCardFront: field.display.cardFront,
|
|
575
|
+
fieldGroup: field.fieldGroup,
|
|
576
|
+
id: field.id,
|
|
577
|
+
modelId: field.idModel,
|
|
578
|
+
name: field.name,
|
|
579
|
+
options: field.options.map(toTrelloCustomFieldOption),
|
|
580
|
+
position: field.pos,
|
|
581
|
+
type: field.type,
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Normalizes one typed Trello card Custom Field value.
|
|
586
|
+
*
|
|
587
|
+
* @param item - Provider Custom Field item.
|
|
588
|
+
*/
|
|
589
|
+
export function toTrelloCustomFieldItem(item) {
|
|
590
|
+
return {
|
|
591
|
+
cardId: item.idModel,
|
|
592
|
+
customFieldId: item.idCustomField,
|
|
593
|
+
id: item.id,
|
|
594
|
+
value: toTrelloCustomFieldValue(item),
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Converts the provider's key-selected value into a public discriminated union.
|
|
599
|
+
*
|
|
600
|
+
* @param item - Provider Custom Field item.
|
|
601
|
+
* @throws When the provider item contains no supported typed value.
|
|
602
|
+
*/
|
|
603
|
+
function toTrelloCustomFieldValue(item) {
|
|
604
|
+
if (item.idValue)
|
|
605
|
+
return { optionId: item.idValue, type: "list" };
|
|
606
|
+
if (item.value?.checked !== undefined) {
|
|
607
|
+
return {
|
|
608
|
+
checked: typeof item.value.checked === "boolean"
|
|
609
|
+
? item.value.checked
|
|
610
|
+
: item.value.checked === "true",
|
|
611
|
+
type: "checkbox",
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
if (item.value?.date !== undefined)
|
|
615
|
+
return { date: new Date(item.value.date), type: "date" };
|
|
616
|
+
if (item.value?.number !== undefined)
|
|
617
|
+
return { number: item.value.number, type: "number" };
|
|
618
|
+
if (item.value?.text !== undefined)
|
|
619
|
+
return { text: item.value.text, type: "text" };
|
|
620
|
+
throw new Error(`Trello Custom Field item ${item.id} has no typed value.`);
|
|
621
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/integration-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"description": "Shared integration payload contracts and provider primitives for Automate.ax.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@automate.ax/codec": "0.
|
|
51
|
+
"@automate.ax/codec": "0.95.0",
|
|
52
52
|
"@cfworker/json-schema": "^4.1.1",
|
|
53
53
|
"@googleapis/calendar": "^15.0.0",
|
|
54
54
|
"@googleapis/forms": "^6.0.1",
|
package/src/close/api.ts
CHANGED
|
@@ -36,6 +36,7 @@ interface CloseRequestOptions<TSchema extends z.ZodType> {
|
|
|
36
36
|
/** Error returned by a rejected Close API request. */
|
|
37
37
|
export class CloseApiError extends Error {
|
|
38
38
|
readonly details: Encodable
|
|
39
|
+
readonly retryAfter?: string
|
|
39
40
|
readonly status: number
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -43,11 +44,13 @@ export class CloseApiError extends Error {
|
|
|
43
44
|
*
|
|
44
45
|
* @param status - HTTP response status.
|
|
45
46
|
* @param details - Codec-safe response details.
|
|
47
|
+
* @param retryAfter - Raw provider retry timing, when present.
|
|
46
48
|
*/
|
|
47
|
-
constructor(status: number, details: Encodable) {
|
|
49
|
+
constructor(status: number, details: Encodable, retryAfter?: string) {
|
|
48
50
|
super(`Close API request failed (${status}).`)
|
|
49
51
|
this.name = "CloseApiError"
|
|
50
52
|
this.details = details
|
|
53
|
+
this.retryAfter = retryAfter
|
|
51
54
|
this.status = status
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -128,6 +131,7 @@ export function getCloseApi(secret: unknown) {
|
|
|
128
131
|
throw new CloseApiError(
|
|
129
132
|
response.status,
|
|
130
133
|
result.success ? result.data : { response: text },
|
|
134
|
+
response.headers.get("Retry-After") ?? undefined,
|
|
131
135
|
)
|
|
132
136
|
}
|
|
133
137
|
return options.responseSchema.parse(result.data)
|