@cargo-ai/api 1.0.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/build/src/api/ai/index.d.ts +78 -0
- package/build/src/api/ai/index.d.ts.map +1 -0
- package/build/src/api/ai/index.js +530 -0
- package/build/src/api/billing/index.d.ts +25 -0
- package/build/src/api/billing/index.d.ts.map +1 -0
- package/build/src/api/billing/index.js +155 -0
- package/build/src/api/connection/index.d.ts +28 -0
- package/build/src/api/connection/index.d.ts.map +1 -0
- package/build/src/api/connection/index.js +172 -0
- package/build/src/api/expression/index.d.ts +26 -0
- package/build/src/api/expression/index.d.ts.map +1 -0
- package/build/src/api/expression/index.js +115 -0
- package/build/src/api/index.d.ts +72 -0
- package/build/src/api/index.d.ts.map +1 -0
- package/build/src/api/index.js +51 -0
- package/build/src/api/orchestration/index.d.ts +66 -0
- package/build/src/api/orchestration/index.d.ts.map +1 -0
- package/build/src/api/orchestration/index.js +625 -0
- package/build/src/api/revenueOrganization/index.d.ts +37 -0
- package/build/src/api/revenueOrganization/index.d.ts.map +1 -0
- package/build/src/api/revenueOrganization/index.js +241 -0
- package/build/src/api/segmentation/index.d.ts +28 -0
- package/build/src/api/segmentation/index.d.ts.map +1 -0
- package/build/src/api/segmentation/index.js +188 -0
- package/build/src/api/storage/index.d.ts +45 -0
- package/build/src/api/storage/index.d.ts.map +1 -0
- package/build/src/api/storage/index.js +402 -0
- package/build/src/api/systemOfRecordIntegration/index.d.ts +29 -0
- package/build/src/api/systemOfRecordIntegration/index.d.ts.map +1 -0
- package/build/src/api/systemOfRecordIntegration/index.js +151 -0
- package/build/src/api/userManagement/index.d.ts +14 -0
- package/build/src/api/userManagement/index.d.ts.map +1 -0
- package/build/src/api/userManagement/index.js +33 -0
- package/build/src/api/workspaceManagement/index.d.ts +43 -0
- package/build/src/api/workspaceManagement/index.d.ts.map +1 -0
- package/build/src/api/workspaceManagement/index.js +283 -0
- package/build/src/client.d.ts +5 -0
- package/build/src/client.d.ts.map +1 -0
- package/build/src/client.js +24 -0
- package/build/src/fetcher/client.d.ts +7 -0
- package/build/src/fetcher/client.d.ts.map +1 -0
- package/build/src/fetcher/client.js +9 -0
- package/build/src/fetcher/error.d.ts +101 -0
- package/build/src/fetcher/error.d.ts.map +1 -0
- package/build/src/fetcher/error.js +184 -0
- package/build/src/fetcher/fetcher.d.ts +12 -0
- package/build/src/fetcher/fetcher.d.ts.map +1 -0
- package/build/src/fetcher/fetcher.js +1 -0
- package/build/src/fetcher/index.d.ts +34 -0
- package/build/src/fetcher/index.d.ts.map +1 -0
- package/build/src/fetcher/index.js +78 -0
- package/build/src/index.d.ts +5 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +3 -0
- package/build/src/store/ai.d.ts +481 -0
- package/build/src/store/ai.d.ts.map +1 -0
- package/build/src/store/ai.js +112 -0
- package/build/src/store/billing.d.ts +140 -0
- package/build/src/store/billing.d.ts.map +1 -0
- package/build/src/store/billing.js +62 -0
- package/build/src/store/connection.d.ts +183 -0
- package/build/src/store/connection.d.ts.map +1 -0
- package/build/src/store/connection.js +88 -0
- package/build/src/store/expression.d.ts +112 -0
- package/build/src/store/expression.d.ts.map +1 -0
- package/build/src/store/expression.js +27 -0
- package/build/src/store/index.d.ts +14 -0
- package/build/src/store/index.d.ts.map +1 -0
- package/build/src/store/index.js +25 -0
- package/build/src/store/orchestration.d.ts +942 -0
- package/build/src/store/orchestration.d.ts.map +1 -0
- package/build/src/store/orchestration.js +217 -0
- package/build/src/store/revenueOrganization.d.ts +201 -0
- package/build/src/store/revenueOrganization.d.ts.map +1 -0
- package/build/src/store/revenueOrganization.js +68 -0
- package/build/src/store/segmentation.d.ts +566 -0
- package/build/src/store/segmentation.d.ts.map +1 -0
- package/build/src/store/segmentation.js +103 -0
- package/build/src/store/storage.d.ts +1096 -0
- package/build/src/store/storage.d.ts.map +1 -0
- package/build/src/store/storage.js +174 -0
- package/build/src/store/systemOfRecordIntegration.d.ts +122 -0
- package/build/src/store/systemOfRecordIntegration.d.ts.map +1 -0
- package/build/src/store/systemOfRecordIntegration.js +53 -0
- package/build/src/store/userManagement.d.ts +34 -0
- package/build/src/store/userManagement.d.ts.map +1 -0
- package/build/src/store/userManagement.js +22 -0
- package/build/src/store/workspaceManagement.d.ts +215 -0
- package/build/src/store/workspaceManagement.d.ts.map +1 -0
- package/build/src/store/workspaceManagement.js +103 -0
- package/build/src/types.d.ts +6 -0
- package/build/src/types.d.ts.map +1 -0
- package/build/src/types.js +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/workspaceManagement/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,UAAU,kCAAkC;IAC1C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE;QACT,GAAG,EAAE,CACH,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,oBAAoB,KAClD,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAC1D,MAAM,EAAE,CACN,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,sBAAsB,KACpD,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAC5D,MAAM,EAAE,CACN,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,sBAAsB,KACpD,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;KAC7D,CAAC;IACF,IAAI,EAAE;QACJ,MAAM,EAAE,CACN,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,iBAAiB,KAC/C,OAAO,CAAC,IAAI,CAAC,CAAC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AC,CAAC;KACzC,CAAC;IACF,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;KAC5D,CAAC;IACF,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACxE,GAAG,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9D,MAAM,EAAE,CACN,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,mBAAmB,KACjD,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACzD,MAAM,EAAE,CACN,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,mBAAmB,KACjD,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACzD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,iBAErC,kCAAkC,KAAG,sBAqYvC,CAAC"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { getErrorWithReasonErrorMessage, zodFetcherUploadFileErrorReason, } from "../../fetcher/index.js";
|
|
2
|
+
import { WorkspaceManagement } from "../../store/index.js";
|
|
3
|
+
export const buildWorkspaceManagementApi = ({ fetcher, }) => {
|
|
4
|
+
async function createUser(payload) {
|
|
5
|
+
await fetcher.fetch({
|
|
6
|
+
method: "post",
|
|
7
|
+
endpoint: `/workspaceManagement/users`,
|
|
8
|
+
payload,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
async function updateUser(payload) {
|
|
12
|
+
try {
|
|
13
|
+
const { userUuid, ...other } = payload;
|
|
14
|
+
await fetcher.fetch({
|
|
15
|
+
method: "put",
|
|
16
|
+
endpoint: `/workspaceManagement/users/${userUuid}`,
|
|
17
|
+
payload: other,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodUpdateUserErrorReason, {
|
|
22
|
+
userNotFound: "User not found",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function removeUser(payload) {
|
|
27
|
+
try {
|
|
28
|
+
await fetcher.fetch({
|
|
29
|
+
method: "delete",
|
|
30
|
+
endpoint: "/workspaceManagement/users",
|
|
31
|
+
payload,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodRemoveUserErrorReason, {
|
|
36
|
+
invalidUserEmail: "User email is invalid",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function upsertUserPermission(payload) {
|
|
41
|
+
try {
|
|
42
|
+
await fetcher.fetch({
|
|
43
|
+
method: "post",
|
|
44
|
+
endpoint: `/workspaceManagement/users/permissions`,
|
|
45
|
+
payload,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodUpsertUserPermissionErrorReason, {
|
|
50
|
+
failedToCreateUsers: "Failed to create users",
|
|
51
|
+
failedToUpsertPermissions: "Failed to add permissions",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function removeUserPermission(payload) {
|
|
56
|
+
const { userUuid, ...other } = payload;
|
|
57
|
+
try {
|
|
58
|
+
await fetcher.fetch({
|
|
59
|
+
method: "delete",
|
|
60
|
+
endpoint: `/workspaceManagement/users/${userUuid}/permissions`,
|
|
61
|
+
payload: other,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodRemoveUserPermissionErrorReason, {
|
|
66
|
+
userNotFound: "User not found",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function allWorkspaces(payload) {
|
|
71
|
+
const result = await fetcher.fetch({
|
|
72
|
+
method: "get",
|
|
73
|
+
endpoint: `/workspaceManagement/workspaces/list`,
|
|
74
|
+
forceTokenRefresh: payload.refresh,
|
|
75
|
+
});
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
async function allUsers(payload) {
|
|
79
|
+
const result = await fetcher.fetch({
|
|
80
|
+
method: "get",
|
|
81
|
+
endpoint: `/workspaceManagement/users/list`,
|
|
82
|
+
params: payload,
|
|
83
|
+
});
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
async function getCurrentUser() {
|
|
87
|
+
const result = await fetcher.fetch({
|
|
88
|
+
method: "get",
|
|
89
|
+
endpoint: `/workspaceManagement/users/current`,
|
|
90
|
+
});
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
async function createWorkspace(payload) {
|
|
94
|
+
try {
|
|
95
|
+
const result = await fetcher.fetch({
|
|
96
|
+
method: "post",
|
|
97
|
+
endpoint: `/workspaceManagement/workspaces`,
|
|
98
|
+
payload,
|
|
99
|
+
});
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodCreateWorkspaceErrorReason, {
|
|
104
|
+
userNotFound: "User not found.",
|
|
105
|
+
roleNotFound: "Role not found.",
|
|
106
|
+
failedToScheduleSync: "Failed to schedule sync.",
|
|
107
|
+
systemOfRecordAlreadyUsedByAnotherWorkspace: "System of record already used by another workspace.",
|
|
108
|
+
cannotSetupClient: "Cannot setup client.",
|
|
109
|
+
missingPermissions: "Missing permissions.",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function updateWorkspace(payload) {
|
|
114
|
+
try {
|
|
115
|
+
const result = await fetcher.fetch({
|
|
116
|
+
method: "put",
|
|
117
|
+
endpoint: "/workspaceManagement/workspaces/current",
|
|
118
|
+
payload,
|
|
119
|
+
});
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodUpdateWorkspaceErrorReason, {
|
|
124
|
+
workspaceNotFound: "Workspace not found.",
|
|
125
|
+
failedToScheduleSync: "Failed to schedule sync.",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function uploadFile(payload) {
|
|
130
|
+
const { file, onProgress, onComplete, onError } = payload;
|
|
131
|
+
const formData = new FormData();
|
|
132
|
+
formData.append("file", file);
|
|
133
|
+
try {
|
|
134
|
+
await fetcher.uploadFile("/workspaceManagement/files/upload", {
|
|
135
|
+
formData,
|
|
136
|
+
onProgress,
|
|
137
|
+
onComplete,
|
|
138
|
+
onError,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
throw getErrorWithReasonErrorMessage(error, zodFetcherUploadFileErrorReason, {
|
|
143
|
+
noFile: "No file provided",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async function listFileColumns(payload) {
|
|
148
|
+
try {
|
|
149
|
+
const result = await fetcher.fetch({
|
|
150
|
+
method: "get",
|
|
151
|
+
endpoint: "/workspaceManagement/files/listColumns",
|
|
152
|
+
params: payload,
|
|
153
|
+
});
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodListFileColumnsErrorReason, {
|
|
158
|
+
noColumnsFound: "No columns found in the file.",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async function createToken(payload) {
|
|
163
|
+
const result = await fetcher.fetch({
|
|
164
|
+
method: "post",
|
|
165
|
+
endpoint: "/workspaceManagement/tokens",
|
|
166
|
+
payload,
|
|
167
|
+
});
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
async function allTokens() {
|
|
171
|
+
const result = await fetcher.fetch({
|
|
172
|
+
method: "get",
|
|
173
|
+
endpoint: "/workspaceManagement/tokens/list",
|
|
174
|
+
});
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
async function removeToken(uuid) {
|
|
178
|
+
await fetcher.fetch({
|
|
179
|
+
method: "delete",
|
|
180
|
+
endpoint: `/workspaceManagement/tokens/${uuid}`,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
async function allRoles() {
|
|
184
|
+
const result = await fetcher.fetch({
|
|
185
|
+
method: "get",
|
|
186
|
+
endpoint: "/workspaceManagement/roles/list",
|
|
187
|
+
});
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
async function getFolder(uuid) {
|
|
191
|
+
try {
|
|
192
|
+
const result = await fetcher.fetch({
|
|
193
|
+
method: "get",
|
|
194
|
+
endpoint: `/workspaceManagement/folders/${uuid}`,
|
|
195
|
+
});
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodGetFolderErrorReason, {
|
|
200
|
+
folderNotFound: "Folder not found.",
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async function createFolder(payload) {
|
|
205
|
+
const result = await fetcher.fetch({
|
|
206
|
+
method: "post",
|
|
207
|
+
endpoint: "/workspaceManagement/folders",
|
|
208
|
+
payload,
|
|
209
|
+
});
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
async function allFolders() {
|
|
213
|
+
const result = await fetcher.fetch({
|
|
214
|
+
method: "get",
|
|
215
|
+
endpoint: "/workspaceManagement/folders/list",
|
|
216
|
+
});
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
async function removeFolder(uuid) {
|
|
220
|
+
try {
|
|
221
|
+
await fetcher.fetch({
|
|
222
|
+
method: "delete",
|
|
223
|
+
endpoint: `/workspaceManagement/folders/${uuid}`,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodRemoveFolderErrorReason, {
|
|
228
|
+
folderNotFound: "Folder not found.",
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
async function updateFolder(payload) {
|
|
233
|
+
const { uuid, ...other } = payload;
|
|
234
|
+
try {
|
|
235
|
+
const result = await fetcher.fetch({
|
|
236
|
+
method: "put",
|
|
237
|
+
endpoint: `/workspaceManagement/folders/${uuid}`,
|
|
238
|
+
payload: other,
|
|
239
|
+
});
|
|
240
|
+
return result;
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
throw getErrorWithReasonErrorMessage(error, WorkspaceManagement.Api.zodUpdateFolderErrorReason, {
|
|
244
|
+
folderNotFound: "Folder not found.",
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
workspace: {
|
|
250
|
+
all: allWorkspaces,
|
|
251
|
+
create: createWorkspace,
|
|
252
|
+
update: updateWorkspace,
|
|
253
|
+
},
|
|
254
|
+
file: {
|
|
255
|
+
upload: uploadFile,
|
|
256
|
+
listColumns: listFileColumns,
|
|
257
|
+
},
|
|
258
|
+
user: {
|
|
259
|
+
create: createUser,
|
|
260
|
+
remove: removeUser,
|
|
261
|
+
update: updateUser,
|
|
262
|
+
all: allUsers,
|
|
263
|
+
getCurrent: getCurrentUser,
|
|
264
|
+
upsertPermission: upsertUserPermission,
|
|
265
|
+
removePermission: removeUserPermission,
|
|
266
|
+
},
|
|
267
|
+
token: {
|
|
268
|
+
create: createToken,
|
|
269
|
+
all: allTokens,
|
|
270
|
+
remove: removeToken,
|
|
271
|
+
},
|
|
272
|
+
role: {
|
|
273
|
+
all: allRoles,
|
|
274
|
+
},
|
|
275
|
+
folder: {
|
|
276
|
+
get: getFolder,
|
|
277
|
+
all: allFolders,
|
|
278
|
+
create: createFolder,
|
|
279
|
+
update: updateFolder,
|
|
280
|
+
remove: removeFolder,
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { QueryClient } from "react-query";
|
|
2
|
+
export { QueryClientProvider as ApiProvider } from "react-query";
|
|
3
|
+
export { ReactQueryDevtools as ApiDevtools } from "react-query/devtools";
|
|
4
|
+
export declare const apiClient: QueryClient;
|
|
5
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AAItD,OAAO,EAAE,mBAAmB,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,kBAAkB,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKzE,eAAO,MAAM,SAAS,aAqBpB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { QueryCache, QueryClient } from "react-query";
|
|
2
|
+
import { determineIfIsFetcherError } from "./fetcher/error.js";
|
|
3
|
+
export { QueryClientProvider as ApiProvider } from "react-query";
|
|
4
|
+
export { ReactQueryDevtools as ApiDevtools } from "react-query/devtools";
|
|
5
|
+
const MAX_RETRIES = 3;
|
|
6
|
+
const HTTP_STATUS_TO_NOT_RETRY = [404, 401];
|
|
7
|
+
export const apiClient = new QueryClient({
|
|
8
|
+
queryCache: new QueryCache(),
|
|
9
|
+
defaultOptions: {
|
|
10
|
+
queries: {
|
|
11
|
+
retry: (failureCount, error) => {
|
|
12
|
+
if (failureCount > MAX_RETRIES) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (determineIfIsFetcherError(error) === true &&
|
|
16
|
+
error.type !== "NetworkError" &&
|
|
17
|
+
HTTP_STATUS_TO_NOT_RETRY.includes(error.status) === true) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/fetcher/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC;AAEnC,eAAO,MAAM,WAAW,iBAAkB,kBAAkB,KAAG,MAS9D,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { AxiosError } from "axios";
|
|
2
|
+
import type * as Zod from "zod/v4";
|
|
3
|
+
type HttpStatus = number;
|
|
4
|
+
type HttpStatusText = string;
|
|
5
|
+
interface BaseFetcherError extends Error {
|
|
6
|
+
originalError?: Error;
|
|
7
|
+
toJSON(): Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
export interface FetcherNetworkError extends BaseFetcherError {
|
|
10
|
+
type: "NetworkError";
|
|
11
|
+
}
|
|
12
|
+
export interface FetcherAuthorizationError<T> extends BaseFetcherError {
|
|
13
|
+
type: "AuthorizationError";
|
|
14
|
+
status: HttpStatus;
|
|
15
|
+
statusText: HttpStatusText;
|
|
16
|
+
reason?: string;
|
|
17
|
+
data: T;
|
|
18
|
+
}
|
|
19
|
+
export interface FetcherRequestError<T> extends BaseFetcherError {
|
|
20
|
+
type: "RequestError";
|
|
21
|
+
status: HttpStatus;
|
|
22
|
+
statusText: HttpStatusText;
|
|
23
|
+
reason?: string;
|
|
24
|
+
data: T;
|
|
25
|
+
}
|
|
26
|
+
export interface FetcherServerError<T> extends BaseFetcherError {
|
|
27
|
+
type: "ServerError";
|
|
28
|
+
status: HttpStatus;
|
|
29
|
+
statusText: HttpStatusText;
|
|
30
|
+
reason?: string;
|
|
31
|
+
data: T;
|
|
32
|
+
}
|
|
33
|
+
export type FetcherError<T = any> = FetcherNetworkError | FetcherRequestError<T> | FetcherAuthorizationError<T> | FetcherServerError<T>;
|
|
34
|
+
export type FetcherErrorType = "NetworkError" | "RequestError" | "ServerError" | "AuthorizationError";
|
|
35
|
+
export declare class FetcherNetworkErrorClass extends Error implements FetcherNetworkError {
|
|
36
|
+
type: "NetworkError";
|
|
37
|
+
originalError?: Error;
|
|
38
|
+
constructor(originalError?: Error);
|
|
39
|
+
toJSON(): {
|
|
40
|
+
name: string;
|
|
41
|
+
message: string;
|
|
42
|
+
type: "NetworkError";
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare class FetcherAuthorizationErrorClass<T> extends Error implements FetcherAuthorizationError<T> {
|
|
46
|
+
originalError?: Error;
|
|
47
|
+
type: "AuthorizationError";
|
|
48
|
+
status: HttpStatus;
|
|
49
|
+
statusText: HttpStatusText;
|
|
50
|
+
reason?: string;
|
|
51
|
+
data: T;
|
|
52
|
+
constructor(status: HttpStatus, statusText: HttpStatusText, data: T, originalError?: Error);
|
|
53
|
+
toJSON(): {
|
|
54
|
+
name: string;
|
|
55
|
+
message: string;
|
|
56
|
+
type: "AuthorizationError";
|
|
57
|
+
status: number;
|
|
58
|
+
statusText: string;
|
|
59
|
+
data: T;
|
|
60
|
+
reason: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export declare class FetcherRequestErrorClass<T> extends Error implements FetcherRequestError<T> {
|
|
64
|
+
originalError?: Error;
|
|
65
|
+
type: "RequestError";
|
|
66
|
+
status: HttpStatus;
|
|
67
|
+
statusText: HttpStatusText;
|
|
68
|
+
reason?: string;
|
|
69
|
+
data: T;
|
|
70
|
+
constructor(status: HttpStatus, statusText: HttpStatusText, data: T, originalError?: Error);
|
|
71
|
+
toJSON(): {
|
|
72
|
+
name: string;
|
|
73
|
+
message: string;
|
|
74
|
+
type: "RequestError";
|
|
75
|
+
status: number;
|
|
76
|
+
statusText: string;
|
|
77
|
+
data: T;
|
|
78
|
+
reason: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export declare class FetcherServerErrorClass<T> extends Error implements FetcherServerError<T> {
|
|
82
|
+
originalError?: Error;
|
|
83
|
+
type: "ServerError";
|
|
84
|
+
status: HttpStatus;
|
|
85
|
+
statusText: HttpStatusText;
|
|
86
|
+
reason?: string;
|
|
87
|
+
data: T;
|
|
88
|
+
constructor(status: HttpStatus, statusText: HttpStatusText, data: T, originalError?: Error);
|
|
89
|
+
toJSON(): {
|
|
90
|
+
name: string;
|
|
91
|
+
message: string;
|
|
92
|
+
type: "ServerError";
|
|
93
|
+
status: number;
|
|
94
|
+
statusText: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export declare const fromFetcherError: <T>(axiosError: AxiosError<T, any>) => Promise<FetcherError<T>>;
|
|
98
|
+
export declare const determineIfIsFetcherError: (error: unknown) => error is FetcherError<any>;
|
|
99
|
+
export declare const getErrorWithReasonErrorMessage: <Output extends string>(error: unknown, zodSchema: Zod.ZodType<Output, unknown, Zod.z.core.$ZodTypeInternals<Output, unknown>>, errorMessages: Record<Output, string | ((data: Record<string, unknown>) => string | undefined) | undefined>) => unknown;
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/fetcher/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,KAAK,GAAG,MAAM,QAAQ,CAAC;AAEnC,KAAK,UAAU,GAAG,MA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cAAc,EAC1B,IAAI,EAAE,CAAC,EACP,aAAa,CAAC,EAAE,KAAK;IAoBhB,MAAM;;;;;;;CASd;AAED,eAAO,MAAM,gBAAgB,iEAiC5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAC7B,OAAO,+BAkBf,CAAC;AAEF,eAAO,MAAM,8BAA8B,iCAClC,OAAO,yIAIK,OAAO,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,GAAG,SAAS,mBAEhE,OA8BF,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
const getFetcherErrorTypeFromStatus = (status) => {
|
|
2
|
+
if (status === 0 || status === undefined) {
|
|
3
|
+
return "NetworkError";
|
|
4
|
+
}
|
|
5
|
+
if (status === 401) {
|
|
6
|
+
return "AuthorizationError";
|
|
7
|
+
}
|
|
8
|
+
if (status >= 400 && status < 499) {
|
|
9
|
+
return "RequestError";
|
|
10
|
+
}
|
|
11
|
+
return "ServerError";
|
|
12
|
+
};
|
|
13
|
+
export class FetcherNetworkErrorClass extends Error {
|
|
14
|
+
type = "NetworkError";
|
|
15
|
+
originalError;
|
|
16
|
+
constructor(originalError) {
|
|
17
|
+
super("API request failure: Network error");
|
|
18
|
+
Object.setPrototypeOf(this, FetcherNetworkErrorClass.prototype);
|
|
19
|
+
if (Error.captureStackTrace) {
|
|
20
|
+
Error.captureStackTrace(this, FetcherNetworkErrorClass);
|
|
21
|
+
}
|
|
22
|
+
this.name = this.type;
|
|
23
|
+
this.originalError = originalError;
|
|
24
|
+
this.message = "Network error";
|
|
25
|
+
}
|
|
26
|
+
toJSON() {
|
|
27
|
+
return {
|
|
28
|
+
name: this.name,
|
|
29
|
+
message: this.message,
|
|
30
|
+
type: this.type,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export class FetcherAuthorizationErrorClass extends Error {
|
|
35
|
+
originalError;
|
|
36
|
+
type = "AuthorizationError";
|
|
37
|
+
status;
|
|
38
|
+
statusText;
|
|
39
|
+
reason;
|
|
40
|
+
data;
|
|
41
|
+
constructor(status, statusText, data, originalError) {
|
|
42
|
+
super("API request failure: Authorization error");
|
|
43
|
+
Object.setPrototypeOf(this, FetcherRequestErrorClass.prototype);
|
|
44
|
+
if (Error.captureStackTrace) {
|
|
45
|
+
Error.captureStackTrace(this, FetcherRequestErrorClass);
|
|
46
|
+
}
|
|
47
|
+
const errorMessage = data.errorMessage;
|
|
48
|
+
const reason = data.reason;
|
|
49
|
+
this.name = this.type;
|
|
50
|
+
this.originalError = originalError;
|
|
51
|
+
this.message = errorMessage !== undefined ? errorMessage : "Not authorized";
|
|
52
|
+
this.reason = reason;
|
|
53
|
+
this.status = status;
|
|
54
|
+
this.statusText = statusText;
|
|
55
|
+
this.data = data;
|
|
56
|
+
}
|
|
57
|
+
toJSON() {
|
|
58
|
+
return {
|
|
59
|
+
name: this.name,
|
|
60
|
+
message: this.message,
|
|
61
|
+
type: this.type,
|
|
62
|
+
status: this.status,
|
|
63
|
+
statusText: this.statusText,
|
|
64
|
+
data: this.data,
|
|
65
|
+
reason: this.reason,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export class FetcherRequestErrorClass extends Error {
|
|
70
|
+
originalError;
|
|
71
|
+
type = "RequestError";
|
|
72
|
+
status;
|
|
73
|
+
statusText;
|
|
74
|
+
reason;
|
|
75
|
+
data;
|
|
76
|
+
constructor(status, statusText, data, originalError) {
|
|
77
|
+
super("API request failure: Bad request error");
|
|
78
|
+
Object.setPrototypeOf(this, FetcherRequestErrorClass.prototype);
|
|
79
|
+
if (Error.captureStackTrace) {
|
|
80
|
+
Error.captureStackTrace(this, FetcherRequestErrorClass);
|
|
81
|
+
}
|
|
82
|
+
this.name = this.type;
|
|
83
|
+
this.originalError = originalError;
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
+
this.message = data.errorMessage || "Unknown error";
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
+
this.reason = data.reason;
|
|
88
|
+
this.status = status;
|
|
89
|
+
this.statusText = statusText;
|
|
90
|
+
this.data = data;
|
|
91
|
+
}
|
|
92
|
+
toJSON() {
|
|
93
|
+
return {
|
|
94
|
+
name: this.name,
|
|
95
|
+
message: this.message,
|
|
96
|
+
type: this.type,
|
|
97
|
+
status: this.status,
|
|
98
|
+
statusText: this.statusText,
|
|
99
|
+
data: this.data,
|
|
100
|
+
reason: this.reason,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export class FetcherServerErrorClass extends Error {
|
|
105
|
+
originalError;
|
|
106
|
+
type = "ServerError";
|
|
107
|
+
status;
|
|
108
|
+
statusText;
|
|
109
|
+
reason;
|
|
110
|
+
data;
|
|
111
|
+
constructor(status, statusText, data, originalError) {
|
|
112
|
+
super("API request failure: Server error");
|
|
113
|
+
Object.setPrototypeOf(this, FetcherServerErrorClass.prototype);
|
|
114
|
+
if (Error.captureStackTrace) {
|
|
115
|
+
Error.captureStackTrace(this, FetcherServerErrorClass);
|
|
116
|
+
}
|
|
117
|
+
this.name = this.type;
|
|
118
|
+
this.originalError = originalError;
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
120
|
+
this.message = data.errorMessage || "Server error";
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
122
|
+
this.reason = data.reason;
|
|
123
|
+
this.status = status;
|
|
124
|
+
this.statusText = statusText;
|
|
125
|
+
this.data = data;
|
|
126
|
+
}
|
|
127
|
+
toJSON() {
|
|
128
|
+
return {
|
|
129
|
+
name: this.name,
|
|
130
|
+
message: this.message,
|
|
131
|
+
type: this.type,
|
|
132
|
+
status: this.status,
|
|
133
|
+
statusText: this.statusText,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export const fromFetcherError = async (axiosError) => {
|
|
138
|
+
const errorType = getFetcherErrorTypeFromStatus(axiosError.response?.status);
|
|
139
|
+
switch (errorType) {
|
|
140
|
+
case "NetworkError":
|
|
141
|
+
return new FetcherNetworkErrorClass(axiosError);
|
|
142
|
+
case "AuthorizationError":
|
|
143
|
+
return new FetcherAuthorizationErrorClass(axiosError.response.status, axiosError.response.statusText, axiosError.response.data, axiosError);
|
|
144
|
+
case "RequestError":
|
|
145
|
+
return new FetcherRequestErrorClass(axiosError.response.status, axiosError.response.statusText, axiosError.response.data, axiosError);
|
|
146
|
+
default:
|
|
147
|
+
return new FetcherServerErrorClass(axiosError.response.status, axiosError.response.statusText, axiosError.response.data, axiosError);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
export const determineIfIsFetcherError = (error) => {
|
|
151
|
+
if (!error) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const errorType = error.type;
|
|
155
|
+
if (errorType === "NetworkError" ||
|
|
156
|
+
errorType === "AuthorizationError" ||
|
|
157
|
+
errorType === "RequestError" ||
|
|
158
|
+
errorType === "ServerError") {
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
return false;
|
|
162
|
+
};
|
|
163
|
+
export const getErrorWithReasonErrorMessage = (error, zodSchema, errorMessages) => {
|
|
164
|
+
if (error instanceof FetcherRequestErrorClass === false) {
|
|
165
|
+
return error;
|
|
166
|
+
}
|
|
167
|
+
if (error.data.errorMessage) {
|
|
168
|
+
error.message = error.data.errorMessage;
|
|
169
|
+
return error;
|
|
170
|
+
}
|
|
171
|
+
const parsedResult = zodSchema.safeParse(error.reason);
|
|
172
|
+
if (parsedResult.success === false) {
|
|
173
|
+
return error;
|
|
174
|
+
}
|
|
175
|
+
const errorMessage = errorMessages[parsedResult.data];
|
|
176
|
+
if (errorMessage === undefined) {
|
|
177
|
+
return error;
|
|
178
|
+
}
|
|
179
|
+
if (typeof errorMessage === "function") {
|
|
180
|
+
return errorMessage(error.data);
|
|
181
|
+
}
|
|
182
|
+
error.message = errorMessage;
|
|
183
|
+
return error;
|
|
184
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FetcherRequestMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
2
|
+
export type FetcherRequest = {
|
|
3
|
+
method: FetcherRequestMethod;
|
|
4
|
+
endpoint: string;
|
|
5
|
+
params?: Record<string, any>;
|
|
6
|
+
forceTokenRefresh?: boolean;
|
|
7
|
+
replaceNullByUndefined?: boolean;
|
|
8
|
+
payload?: Record<string, any>;
|
|
9
|
+
withoutWorkspace?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=fetcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/fetcher/fetcher.ts"],"names":[],"mappings":"AAAA,KAAK,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExE,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|