@stack-spot/portal-network 0.3.0 → 0.4.0-beta.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/CHANGELOG.md +15 -0
- package/dist/api/account.d.ts +2368 -0
- package/dist/api/account.d.ts.map +1 -0
- package/dist/api/account.js +1521 -0
- package/dist/api/account.js.map +1 -0
- package/dist/api/ai.d.ts +1432 -0
- package/dist/api/ai.d.ts.map +1 -0
- package/dist/api/ai.js +1342 -0
- package/dist/api/ai.js.map +1 -0
- package/dist/api/apiRuntime.d.ts +922 -0
- package/dist/api/apiRuntime.d.ts.map +1 -0
- package/dist/api/apiRuntime.js +599 -0
- package/dist/api/apiRuntime.js.map +1 -0
- package/dist/api/cloudAccount.d.ts +473 -0
- package/dist/api/cloudAccount.d.ts.map +1 -0
- package/dist/api/cloudAccount.js +300 -0
- package/dist/api/cloudAccount.js.map +1 -0
- package/dist/api/cloudServices.d.ts +1233 -0
- package/dist/api/cloudServices.d.ts.map +1 -0
- package/dist/api/cloudServices.js +715 -0
- package/dist/api/cloudServices.js.map +1 -0
- package/dist/api/insights.d.ts +123 -0
- package/dist/api/insights.d.ts.map +1 -0
- package/dist/api/insights.js +112 -0
- package/dist/api/insights.js.map +1 -0
- package/dist/api/secrets.d.ts +100 -0
- package/dist/api/secrets.d.ts.map +1 -0
- package/dist/api/secrets.js +101 -0
- package/dist/api/secrets.js.map +1 -0
- package/dist/api/serviceCatalog.d.ts +737 -0
- package/dist/api/serviceCatalog.d.ts.map +1 -0
- package/dist/api/serviceCatalog.js +611 -0
- package/dist/api/serviceCatalog.js.map +1 -0
- package/dist/api/workflows.d.ts +366 -0
- package/dist/api/workflows.d.ts.map +1 -0
- package/dist/api/workflows.js +175 -0
- package/dist/api/workflows.js.map +1 -0
- package/dist/api/workspace.js +1476 -0
- package/dist/api/workspace.js.map +1 -0
- package/dist/api/workspaceManager.d.ts +1121 -0
- package/dist/api/workspaceManager.d.ts.map +1 -0
- package/dist/api/workspaceManager.js +357 -0
- package/dist/api/workspaceManager.js.map +1 -0
- package/dist/api/workspaceSearchEngine.d.ts +93 -0
- package/dist/api/workspaceSearchEngine.d.ts.map +1 -0
- package/dist/api/workspaceSearchEngine.js +55 -0
- package/dist/api/workspaceSearchEngine.js.map +1 -0
- package/dist/apis.json +129 -0
- package/dist/client/account.d.ts +449 -0
- package/dist/client/account.d.ts.map +1 -0
- package/dist/client/account.js +501 -0
- package/dist/client/account.js.map +1 -0
- package/dist/client/secrets.d.ts +50 -0
- package/dist/client/secrets.d.ts.map +1 -0
- package/dist/client/secrets.js +78 -0
- package/dist/client/secrets.js.map +1 -0
- package/dist/error/CanceledError.d.ts +8 -0
- package/dist/error/CanceledError.d.ts.map +1 -0
- package/dist/error/CanceledError.js +10 -0
- package/dist/error/CanceledError.js.map +1 -0
- package/dist/error/DefaultAPIError.d.ts +34 -0
- package/dist/error/DefaultAPIError.d.ts.map +1 -0
- package/dist/error/DefaultAPIError.js +82 -0
- package/dist/error/DefaultAPIError.js.map +1 -0
- package/dist/error/StackspotAPIError.d.ts +50 -0
- package/dist/error/StackspotAPIError.d.ts.map +1 -0
- package/dist/error/StackspotAPIError.js +54 -0
- package/dist/error/StackspotAPIError.js.map +1 -0
- package/dist/error/dictionary/account.d.ts +57 -0
- package/dist/error/dictionary/account.d.ts.map +1 -0
- package/dist/error/dictionary/account.js +57 -0
- package/dist/error/dictionary/account.js.map +1 -0
- package/dist/error/dictionary/action.d.ts +163 -0
- package/dist/error/dictionary/action.d.ts.map +1 -0
- package/dist/error/dictionary/action.js +163 -0
- package/dist/error/dictionary/action.js.map +1 -0
- package/dist/error/dictionary/base.d.ts +21 -0
- package/dist/error/dictionary/base.d.ts.map +1 -0
- package/dist/error/dictionary/base.js +21 -0
- package/dist/error/dictionary/base.js.map +1 -0
- package/dist/error/dictionary/cnt-fields.d.ts +13 -0
- package/dist/error/dictionary/cnt-fields.d.ts.map +1 -0
- package/dist/error/dictionary/cnt-fields.js +13 -0
- package/dist/error/dictionary/cnt-fields.js.map +1 -0
- package/dist/error/dictionary/cnt.d.ts +79 -0
- package/dist/error/dictionary/cnt.d.ts.map +1 -0
- package/dist/error/dictionary/cnt.js +79 -0
- package/dist/error/dictionary/cnt.js.map +1 -0
- package/dist/error/dictionary/rte.d.ts +23 -0
- package/dist/error/dictionary/rte.d.ts.map +1 -0
- package/dist/error/dictionary/rte.js +23 -0
- package/dist/error/dictionary/rte.js.map +1 -0
- package/dist/error/dictionary/rtm.d.ts +9 -0
- package/dist/error/dictionary/rtm.d.ts.map +1 -0
- package/dist/error/dictionary/rtm.js +9 -0
- package/dist/error/dictionary/rtm.js.map +1 -0
- package/dist/error/dictionary/secrets.d.ts +13 -0
- package/dist/error/dictionary/secrets.d.ts.map +1 -0
- package/dist/error/dictionary/secrets.js +13 -0
- package/dist/error/dictionary/secrets.js.map +1 -0
- package/dist/error/dictionary/workspace-fields.d.ts +9 -0
- package/dist/error/dictionary/workspace-fields.d.ts.map +1 -0
- package/dist/error/dictionary/workspace-fields.js +9 -0
- package/dist/error/dictionary/workspace-fields.js.map +1 -0
- package/dist/error/dictionary/workspace.d.ts +99 -0
- package/dist/error/dictionary/workspace.d.ts.map +1 -0
- package/dist/error/dictionary/workspace.js +99 -0
- package/dist/error/dictionary/workspace.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/network/AutoInfiniteQuery.d.ts +23 -0
- package/dist/network/AutoInfiniteQuery.d.ts.map +1 -0
- package/dist/network/AutoInfiniteQuery.js +70 -0
- package/dist/network/AutoInfiniteQuery.js.map +1 -0
- package/dist/network/AutoMutation.d.ts +10 -0
- package/dist/network/AutoMutation.d.ts.map +1 -0
- package/dist/network/AutoMutation.js +20 -0
- package/dist/network/AutoMutation.js.map +1 -0
- package/dist/network/AutoOperation.d.ts +19 -0
- package/dist/network/AutoOperation.d.ts.map +1 -0
- package/dist/network/AutoOperation.js +105 -0
- package/dist/network/AutoOperation.js.map +1 -0
- package/dist/network/AutoQuery.d.ts +19 -0
- package/dist/network/AutoQuery.d.ts.map +1 -0
- package/dist/network/AutoQuery.js +73 -0
- package/dist/network/AutoQuery.js.map +1 -0
- package/dist/network/ManualInfiniteQuery.d.ts +26 -0
- package/dist/network/ManualInfiniteQuery.d.ts.map +1 -0
- package/dist/network/ManualInfiniteQuery.js +62 -0
- package/dist/network/ManualInfiniteQuery.js.map +1 -0
- package/dist/network/ManualMutation.d.ts +11 -0
- package/dist/network/ManualMutation.d.ts.map +1 -0
- package/dist/network/ManualMutation.js +35 -0
- package/dist/network/ManualMutation.js.map +1 -0
- package/dist/network/ManualOperation.d.ts +14 -0
- package/dist/network/ManualOperation.d.ts.map +1 -0
- package/dist/network/ManualOperation.js +64 -0
- package/dist/network/ManualOperation.js.map +1 -0
- package/dist/network/ManualQuery.d.ts +20 -0
- package/dist/network/ManualQuery.d.ts.map +1 -0
- package/dist/network/ManualQuery.js +80 -0
- package/dist/network/ManualQuery.js.map +1 -0
- package/dist/network/NetworkClient.d.ts +58 -0
- package/dist/network/NetworkClient.d.ts.map +1 -0
- package/dist/network/NetworkClient.js +107 -0
- package/dist/network/NetworkClient.js.map +1 -0
- package/dist/network/ReactQueryNetworkClient.d.ts +78 -0
- package/dist/network/ReactQueryNetworkClient.d.ts.map +1 -0
- package/dist/network/ReactQueryNetworkClient.js +134 -0
- package/dist/network/ReactQueryNetworkClient.js.map +1 -0
- package/dist/network/react-query-client.d.ts +6 -0
- package/dist/network/react-query-client.d.ts.map +1 -0
- package/dist/network/react-query-client.js +6 -0
- package/dist/network/react-query-client.js.map +1 -0
- package/dist/network/types.d.ts +235 -0
- package/dist/network/types.d.ts.map +1 -0
- package/dist/network/types.js +2 -0
- package/dist/network/types.js.map +1 -0
- package/dist/utils/use-extended-list.d.ts +39 -0
- package/dist/utils/use-extended-list.d.ts.map +1 -0
- package/dist/utils/use-extended-list.js +36 -0
- package/dist/utils/use-extended-list.js.map +1 -0
- package/package.json +2 -3
- package/src/api/secrets.ts +279 -0
- package/src/apis.json +8 -0
- package/src/client/account.ts +124 -3
- package/src/client/secrets.ts +56 -0
- package/src/error/DefaultAPIError.ts +4 -5
- package/src/error/dictionary/account.ts +2 -0
- package/src/error/dictionary/secrets.ts +14 -0
- package/src/index.ts +1 -0
- package/src/network/AutoQuery.ts +3 -1
- package/src/network/ManualInfiniteQuery.ts +4 -1
- package/src/network/ManualMutation.ts +2 -0
- package/src/network/ManualOperation.ts +16 -5
- package/src/network/ManualQuery.ts +2 -0
- package/src/network/ReactQueryNetworkClient.ts +9 -16
- package/src/network/types.ts +1 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
+
import { accountDataIsAvailable, addResourcesToGroup, addRoleToMember, bindGroupMembers, bindRoleGroups, bindRoles, bindToGroups, bindToRoles, create, createAccountRole, createPartner, createUser, deactivateFidoCredentials, defaults, deleteAccountRole, deleteMember, deletePartner, deleteResourceFromGroup, deleteRole, deleteV1GroupsByGroupId, enableFidoCredentials, getAccountMembers1, getAllMemberFidoCredentials, getFeatures, getGroupById, getGroupResources, getGroups, getMemberById, getMemberGroups, getMembers, getPartnerAccount, getPartnersSharingAllowed, getPersonalClientCredentials, getResources1, getResourcesAndActionsWithStatus, getRoleGroups, getRoleMembers, getRoles, getRoles1, getRoles2, removeRoleFromMember, resetPassword, save, update1, updateAccountRole, updatePartnerAccountAdminData, updatePartnerAccountData, updateRoleWithNewActions, updateUser, validateNewPartnerData, validatePartnerAssociationLimit, } from '../api/account.js';
|
|
3
|
+
import apis from '../apis.json';
|
|
4
|
+
import { DefaultAPIError } from '../error/DefaultAPIError.js';
|
|
5
|
+
import { accountDictionary } from '../error/dictionary/account.js';
|
|
6
|
+
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
7
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
8
|
+
class AccountClient extends ReactQueryNetworkClient {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(apis.account.url, defaults);
|
|
11
|
+
/**
|
|
12
|
+
* Gets credentials from personal service client (create if not exists one to the logged user).
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(this, "generatePersonalClientCredentials", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value: this.mutation(getPersonalClientCredentials)
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Creates a Feature Flag
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(this, "createFeatureFlag", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: this.mutation(create)
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Returns information if account data (name and slug) are available to be registered
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(this, "isAvailable", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: this.query(accountDataIsAvailable)
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Lists all Feature Flags in an Account
|
|
40
|
+
*/
|
|
41
|
+
Object.defineProperty(this, "featureFlags", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: this.query(getFeatures)
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Gets Partners with whom it is allowed to share content.
|
|
49
|
+
*/
|
|
50
|
+
Object.defineProperty(this, "partners", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: this.query(getPartnersSharingAllowed)
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Gets Partner by account Id
|
|
58
|
+
*/
|
|
59
|
+
Object.defineProperty(this, "partner", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: this.query(getPartnerAccount)
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Creates an Account Order for Partner
|
|
67
|
+
*/
|
|
68
|
+
Object.defineProperty(this, "createPartner", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
configurable: true,
|
|
71
|
+
writable: true,
|
|
72
|
+
value: this.mutation(createPartner)
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Updates Partner Account data.
|
|
76
|
+
*/
|
|
77
|
+
Object.defineProperty(this, "updatePartner", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
value: this.mutation(updatePartnerAccountData)
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Updates Partner Account Admin data.
|
|
85
|
+
*/
|
|
86
|
+
Object.defineProperty(this, "updatePartnerAdmin", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: this.mutation(updatePartnerAccountAdminData)
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* Deletes Partner
|
|
94
|
+
*/
|
|
95
|
+
Object.defineProperty(this, "deactivatePartner", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: this.mutation(deletePartner)
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* Validates new Partner account data
|
|
103
|
+
*/
|
|
104
|
+
Object.defineProperty(this, "validateNewPartnerData", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
configurable: true,
|
|
107
|
+
writable: true,
|
|
108
|
+
value: this.mutation(validateNewPartnerData)
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* Validates the association limit for the partner. Yields `{ isValid: true }` if valid or `{ isValid: false, message: string }`
|
|
112
|
+
* otherwise.
|
|
113
|
+
*/
|
|
114
|
+
Object.defineProperty(this, "validatePartnerAssociationLimit", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
configurable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
value: this.query({
|
|
119
|
+
name: 'validatePartnerAssociationLimit',
|
|
120
|
+
request: async (signal) => {
|
|
121
|
+
try {
|
|
122
|
+
await validatePartnerAssociationLimit({ signal });
|
|
123
|
+
return { isValid: true, message: '' };
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
if (error instanceof HttpError) {
|
|
127
|
+
const stkError = this.buildStackSpotError(error);
|
|
128
|
+
if (stkError.status === 422 || stkError.code === 'BAD_USER_INPUT')
|
|
129
|
+
return { isValid: false, message: stkError.translate() };
|
|
130
|
+
}
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
/**
|
|
137
|
+
* Gets member by id.
|
|
138
|
+
*/
|
|
139
|
+
Object.defineProperty(this, "member", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
configurable: true,
|
|
142
|
+
writable: true,
|
|
143
|
+
value: this.query(getMemberById)
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Gets all members (paginated).
|
|
147
|
+
*/
|
|
148
|
+
Object.defineProperty(this, "allMembers", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
configurable: true,
|
|
151
|
+
writable: true,
|
|
152
|
+
value: this.infiniteQuery(getAccountMembers1)
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* Gets member Groups (paginated).
|
|
156
|
+
*/
|
|
157
|
+
Object.defineProperty(this, "memberGroups", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
configurable: true,
|
|
160
|
+
writable: true,
|
|
161
|
+
value: this.infiniteQuery(getMemberGroups)
|
|
162
|
+
});
|
|
163
|
+
/**
|
|
164
|
+
* Gets member roles (paginated).
|
|
165
|
+
*/
|
|
166
|
+
Object.defineProperty(this, "memberRoles", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
configurable: true,
|
|
169
|
+
writable: true,
|
|
170
|
+
value: this.infiniteQuery(getRoles1)
|
|
171
|
+
});
|
|
172
|
+
/**
|
|
173
|
+
* Gets member resources.
|
|
174
|
+
*/
|
|
175
|
+
Object.defineProperty(this, "memberResources", {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
configurable: true,
|
|
178
|
+
writable: true,
|
|
179
|
+
value: this.query(getResources1)
|
|
180
|
+
});
|
|
181
|
+
/**
|
|
182
|
+
* Gets All Fido credentials for the given member (paginated).
|
|
183
|
+
*/
|
|
184
|
+
Object.defineProperty(this, "fidoCredentials", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
configurable: true,
|
|
187
|
+
writable: true,
|
|
188
|
+
value: this.infiniteQuery(getAllMemberFidoCredentials, { accumulator: 'items' })
|
|
189
|
+
});
|
|
190
|
+
/**
|
|
191
|
+
* Creates member on current tenant.
|
|
192
|
+
*/
|
|
193
|
+
Object.defineProperty(this, "createMember", {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
configurable: true,
|
|
196
|
+
writable: true,
|
|
197
|
+
value: this.mutation(createUser)
|
|
198
|
+
});
|
|
199
|
+
/**
|
|
200
|
+
* Updates member on current tenant.
|
|
201
|
+
*/
|
|
202
|
+
Object.defineProperty(this, "updateMember", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
configurable: true,
|
|
205
|
+
writable: true,
|
|
206
|
+
value: this.mutation(updateUser)
|
|
207
|
+
});
|
|
208
|
+
/**
|
|
209
|
+
* Adds a member to several groups.
|
|
210
|
+
*/
|
|
211
|
+
Object.defineProperty(this, "addMemberToGroups", {
|
|
212
|
+
enumerable: true,
|
|
213
|
+
configurable: true,
|
|
214
|
+
writable: true,
|
|
215
|
+
value: this.mutation(bindToGroups)
|
|
216
|
+
});
|
|
217
|
+
/**
|
|
218
|
+
* Attributes several roles to a member.
|
|
219
|
+
*/
|
|
220
|
+
Object.defineProperty(this, "addRolesToMember", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: true,
|
|
223
|
+
writable: true,
|
|
224
|
+
value: this.mutation(bindToRoles)
|
|
225
|
+
});
|
|
226
|
+
/**
|
|
227
|
+
* Removes a role from a member.
|
|
228
|
+
*/
|
|
229
|
+
Object.defineProperty(this, "removeRoleFromMember", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
configurable: true,
|
|
232
|
+
writable: true,
|
|
233
|
+
value: this.mutation(removeRoleFromMember)
|
|
234
|
+
});
|
|
235
|
+
/**
|
|
236
|
+
* Sends an e-mail to reset the password of the member with the provided e-mail address.
|
|
237
|
+
*/
|
|
238
|
+
Object.defineProperty(this, "resetMemberPassword", {
|
|
239
|
+
enumerable: true,
|
|
240
|
+
configurable: true,
|
|
241
|
+
writable: true,
|
|
242
|
+
value: this.mutation(resetPassword)
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Enables Fido credentials for the given member.
|
|
246
|
+
*/
|
|
247
|
+
Object.defineProperty(this, "enableFidoCredentials", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
configurable: true,
|
|
250
|
+
writable: true,
|
|
251
|
+
value: this.mutation(enableFidoCredentials)
|
|
252
|
+
});
|
|
253
|
+
/**
|
|
254
|
+
* Disables Fido credentials for the given member.
|
|
255
|
+
*/
|
|
256
|
+
Object.defineProperty(this, "disableFidoCredentials", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
configurable: true,
|
|
259
|
+
writable: true,
|
|
260
|
+
value: this.mutation(deactivateFidoCredentials)
|
|
261
|
+
});
|
|
262
|
+
/**
|
|
263
|
+
* Gets group by id.
|
|
264
|
+
*/
|
|
265
|
+
Object.defineProperty(this, "group", {
|
|
266
|
+
enumerable: true,
|
|
267
|
+
configurable: true,
|
|
268
|
+
writable: true,
|
|
269
|
+
value: this.query(getGroupById)
|
|
270
|
+
});
|
|
271
|
+
/**
|
|
272
|
+
* Get all groups (paginated).
|
|
273
|
+
*/
|
|
274
|
+
Object.defineProperty(this, "allGroups", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
configurable: true,
|
|
277
|
+
writable: true,
|
|
278
|
+
value: this.infiniteQuery(getGroups)
|
|
279
|
+
});
|
|
280
|
+
/**
|
|
281
|
+
* Creates a group.
|
|
282
|
+
*/
|
|
283
|
+
Object.defineProperty(this, "createGroup", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
configurable: true,
|
|
286
|
+
writable: true,
|
|
287
|
+
value: this.mutation(save)
|
|
288
|
+
});
|
|
289
|
+
/**
|
|
290
|
+
* Updates a group.
|
|
291
|
+
*/
|
|
292
|
+
Object.defineProperty(this, "updateGroup", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
configurable: true,
|
|
295
|
+
writable: true,
|
|
296
|
+
value: this.mutation(update1)
|
|
297
|
+
});
|
|
298
|
+
/**
|
|
299
|
+
* Deletes a group.
|
|
300
|
+
*/
|
|
301
|
+
Object.defineProperty(this, "deleteGroup", {
|
|
302
|
+
enumerable: true,
|
|
303
|
+
configurable: true,
|
|
304
|
+
writable: true,
|
|
305
|
+
value: this.mutation(deleteV1GroupsByGroupId)
|
|
306
|
+
});
|
|
307
|
+
/**
|
|
308
|
+
* Gets all members in a group (paginated).
|
|
309
|
+
*/
|
|
310
|
+
Object.defineProperty(this, "groupMembers", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
configurable: true,
|
|
313
|
+
writable: true,
|
|
314
|
+
value: this.infiniteQuery(getMembers)
|
|
315
|
+
});
|
|
316
|
+
/**
|
|
317
|
+
* Adds several members to a group
|
|
318
|
+
*/
|
|
319
|
+
Object.defineProperty(this, "addMembersToGroup", {
|
|
320
|
+
enumerable: true,
|
|
321
|
+
configurable: true,
|
|
322
|
+
writable: true,
|
|
323
|
+
value: this.mutation(bindGroupMembers)
|
|
324
|
+
});
|
|
325
|
+
/**
|
|
326
|
+
* Removes a member from a group
|
|
327
|
+
*/
|
|
328
|
+
Object.defineProperty(this, "removeMemberFromGroup", {
|
|
329
|
+
enumerable: true,
|
|
330
|
+
configurable: true,
|
|
331
|
+
writable: true,
|
|
332
|
+
value: this.mutation(deleteMember)
|
|
333
|
+
});
|
|
334
|
+
/**
|
|
335
|
+
* Gets all roles of a group.
|
|
336
|
+
*/
|
|
337
|
+
Object.defineProperty(this, "groupRoles", {
|
|
338
|
+
enumerable: true,
|
|
339
|
+
configurable: true,
|
|
340
|
+
writable: true,
|
|
341
|
+
value: this.infiniteQuery(getRoles2)
|
|
342
|
+
});
|
|
343
|
+
/**
|
|
344
|
+
* Adds several roles to a group.
|
|
345
|
+
*/
|
|
346
|
+
Object.defineProperty(this, "addRolesToGroup", {
|
|
347
|
+
enumerable: true,
|
|
348
|
+
configurable: true,
|
|
349
|
+
writable: true,
|
|
350
|
+
value: this.mutation(bindRoles)
|
|
351
|
+
});
|
|
352
|
+
/**
|
|
353
|
+
* Removes a role from a group.
|
|
354
|
+
*/
|
|
355
|
+
Object.defineProperty(this, "removeRoleFromGroup", {
|
|
356
|
+
enumerable: true,
|
|
357
|
+
configurable: true,
|
|
358
|
+
writable: true,
|
|
359
|
+
value: this.mutation(deleteRole)
|
|
360
|
+
});
|
|
361
|
+
/**
|
|
362
|
+
* Gets all resources of a group (paginated).
|
|
363
|
+
*/
|
|
364
|
+
Object.defineProperty(this, "groupResources", {
|
|
365
|
+
enumerable: true,
|
|
366
|
+
configurable: true,
|
|
367
|
+
writable: true,
|
|
368
|
+
value: this.infiniteQuery(getGroupResources)
|
|
369
|
+
});
|
|
370
|
+
/**
|
|
371
|
+
* Adds several resources to a group.
|
|
372
|
+
*/
|
|
373
|
+
Object.defineProperty(this, "addResourcesToGroup", {
|
|
374
|
+
enumerable: true,
|
|
375
|
+
configurable: true,
|
|
376
|
+
writable: true,
|
|
377
|
+
value: this.mutation(addResourcesToGroup)
|
|
378
|
+
});
|
|
379
|
+
/**
|
|
380
|
+
* Removes a resource from a group.
|
|
381
|
+
*/
|
|
382
|
+
Object.defineProperty(this, "removeResourceFromGroup", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
configurable: true,
|
|
385
|
+
writable: true,
|
|
386
|
+
value: this.mutation(deleteResourceFromGroup)
|
|
387
|
+
});
|
|
388
|
+
/**
|
|
389
|
+
* Gets all roles in the account (paginated)
|
|
390
|
+
*/
|
|
391
|
+
Object.defineProperty(this, "allRoles", {
|
|
392
|
+
enumerable: true,
|
|
393
|
+
configurable: true,
|
|
394
|
+
writable: true,
|
|
395
|
+
value: this.infiniteQuery(getRoles)
|
|
396
|
+
});
|
|
397
|
+
/**
|
|
398
|
+
* Get a role by id
|
|
399
|
+
*/
|
|
400
|
+
Object.defineProperty(this, "role", {
|
|
401
|
+
enumerable: true,
|
|
402
|
+
configurable: true,
|
|
403
|
+
writable: true,
|
|
404
|
+
value: this.query({
|
|
405
|
+
name: 'account.role',
|
|
406
|
+
request: async (signal, { id }) => {
|
|
407
|
+
const roles = await getRoles({ filterBy: 'id', filterValue: id }, { signal });
|
|
408
|
+
if (!roles.length)
|
|
409
|
+
throw new StackspotAPIError({ status: 404 });
|
|
410
|
+
return roles[0];
|
|
411
|
+
},
|
|
412
|
+
})
|
|
413
|
+
});
|
|
414
|
+
/**
|
|
415
|
+
* Gets all members with the provided role (paginated)
|
|
416
|
+
*/
|
|
417
|
+
Object.defineProperty(this, "roleMembers", {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
configurable: true,
|
|
420
|
+
writable: true,
|
|
421
|
+
value: this.infiniteQuery(getRoleMembers)
|
|
422
|
+
});
|
|
423
|
+
/**
|
|
424
|
+
* Creates a role
|
|
425
|
+
*/
|
|
426
|
+
Object.defineProperty(this, "createRole", {
|
|
427
|
+
enumerable: true,
|
|
428
|
+
configurable: true,
|
|
429
|
+
writable: true,
|
|
430
|
+
value: this.mutation(createAccountRole)
|
|
431
|
+
});
|
|
432
|
+
/**
|
|
433
|
+
* Updates a role
|
|
434
|
+
*/
|
|
435
|
+
Object.defineProperty(this, "updateRole", {
|
|
436
|
+
enumerable: true,
|
|
437
|
+
configurable: true,
|
|
438
|
+
writable: true,
|
|
439
|
+
value: this.mutation(updateAccountRole)
|
|
440
|
+
});
|
|
441
|
+
/**
|
|
442
|
+
* Deletes a role
|
|
443
|
+
*/
|
|
444
|
+
Object.defineProperty(this, "deleteRole", {
|
|
445
|
+
enumerable: true,
|
|
446
|
+
configurable: true,
|
|
447
|
+
writable: true,
|
|
448
|
+
value: this.mutation(deleteAccountRole)
|
|
449
|
+
});
|
|
450
|
+
/**
|
|
451
|
+
* Adds a role to several members
|
|
452
|
+
*/
|
|
453
|
+
Object.defineProperty(this, "addRoleToMembers", {
|
|
454
|
+
enumerable: true,
|
|
455
|
+
configurable: true,
|
|
456
|
+
writable: true,
|
|
457
|
+
value: this.mutation(addRoleToMember)
|
|
458
|
+
});
|
|
459
|
+
/**
|
|
460
|
+
* Gets all groups with the provided role (paginated)
|
|
461
|
+
*/
|
|
462
|
+
Object.defineProperty(this, "roleGroups", {
|
|
463
|
+
enumerable: true,
|
|
464
|
+
configurable: true,
|
|
465
|
+
writable: true,
|
|
466
|
+
value: this.infiniteQuery(getRoleGroups)
|
|
467
|
+
});
|
|
468
|
+
/**
|
|
469
|
+
* Adds a role to several groups
|
|
470
|
+
*/
|
|
471
|
+
Object.defineProperty(this, "addRoleToGroups", {
|
|
472
|
+
enumerable: true,
|
|
473
|
+
configurable: true,
|
|
474
|
+
writable: true,
|
|
475
|
+
value: this.mutation(bindRoleGroups)
|
|
476
|
+
});
|
|
477
|
+
/**
|
|
478
|
+
* Get the actions a role is allowed to perform
|
|
479
|
+
*/
|
|
480
|
+
Object.defineProperty(this, "rolePermissions", {
|
|
481
|
+
enumerable: true,
|
|
482
|
+
configurable: true,
|
|
483
|
+
writable: true,
|
|
484
|
+
value: this.infiniteQuery(getResourcesAndActionsWithStatus)
|
|
485
|
+
});
|
|
486
|
+
/**
|
|
487
|
+
* Updates a role with new actions
|
|
488
|
+
*/
|
|
489
|
+
Object.defineProperty(this, "updateRolePermissions", {
|
|
490
|
+
enumerable: true,
|
|
491
|
+
configurable: true,
|
|
492
|
+
writable: true,
|
|
493
|
+
value: this.mutation(updateRoleWithNewActions)
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
buildStackSpotError(error) {
|
|
497
|
+
return new DefaultAPIError(error.data, error.status, accountDictionary, error.headers);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
export const accountClient = new AccountClient();
|
|
501
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/client/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,aAAa,EACnE,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,aAAa,EAAE,uBAAuB,EAAE,UAAU,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EACtH,2BAA2B,EAAE,WAAW,EACxC,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,EACV,iBAAiB,EAAE,yBAAyB,EAC5C,4BAA4B,EAC5B,aAAa,EACb,gCAAgC,EAChC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,6BAA6B,EAC1H,wBAAwB,EACxB,wBAAwB,EACxB,UAAU,EACV,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,gBAAgB,CAAA;AACvB,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA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I,CAAC,QAAQ,CAAC,cAAc,CAAC;WAAA;QAC/C;;WAEG;QACH;;;;mBAAkB,IAAI,CAAC,aAAa,CAAC,gCAAgC,CAAC;WAAA;QACtE;;WAEG;QACH;;;;mBAAwB,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC;WAAA;IAvO/D,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACxF,CAAC;CAoOF;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
+
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
3
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
4
|
+
declare class SecretClient extends ReactQueryNetworkClient {
|
|
5
|
+
constructor();
|
|
6
|
+
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
7
|
+
/**
|
|
8
|
+
* Create a key
|
|
9
|
+
*/
|
|
10
|
+
createKey: import("../network/types.js").MutationObject<{
|
|
11
|
+
createKeyRequest: import("../api/secrets.js").CreateKeyRequest;
|
|
12
|
+
}, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Get all keys
|
|
15
|
+
*/
|
|
16
|
+
getAllKeys: import("../network/types.js").QueryObject<void, import("../api/secrets.js").SecretKeyResponse[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete a key
|
|
19
|
+
*/
|
|
20
|
+
deleteKey: import("../network/types.js").MutationObject<{
|
|
21
|
+
key: string;
|
|
22
|
+
}, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Update a key's description
|
|
25
|
+
*/
|
|
26
|
+
updateKey: import("../network/types.js").MutationObject<{
|
|
27
|
+
key: string;
|
|
28
|
+
editKeyRequest: import("../api/secrets.js").EditKeyRequest;
|
|
29
|
+
}, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Get which secrets are defined or undefined for a user
|
|
32
|
+
*/
|
|
33
|
+
getAvailability: import("../network/types.js").QueryObject<void, import("../api/secrets.js").SecretAvailabilityResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Update a secret's value
|
|
36
|
+
*/
|
|
37
|
+
updateSecretValue: import("../network/types.js").MutationObject<{
|
|
38
|
+
key: string;
|
|
39
|
+
updateSecretValueRequest: import("../api/secrets.js").UpdateSecretValueRequest;
|
|
40
|
+
}, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete a secret's value
|
|
43
|
+
*/
|
|
44
|
+
deleteSecretValue: import("../network/types.js").MutationObject<{
|
|
45
|
+
key: string;
|
|
46
|
+
}, unknown>;
|
|
47
|
+
}
|
|
48
|
+
export declare const secretsClient: SecretClient;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=secrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/client/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAM7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,YAAa,SAAQ,uBAAuB;;IAKhD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,SAAS;;gBAA2B;IAEpC;;OAEG;IACH,UAAU,6FAAsB;IAEhC;;OAEG;IACH,SAAS;;gBAA2B;IAEpC;;OAEG;IACH,SAAS;;;gBAAyB;IAElC;;OAEG;IACH,eAAe,oGAA8B;IAE7C;;OAEG;IACH,iBAAiB;;;gBAAmC;IAEpD;;OAEG;IACH,iBAAiB;;gBAAmC;CAErD;AAED,eAAO,MAAM,aAAa,cAAqB,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createKey, defaults, deleteKey, deleteSecretValue, editKey, getAll1, getAvailability, updateSecretValue } from '../api/secrets.js';
|
|
2
|
+
import apis from '../apis.json';
|
|
3
|
+
import { DefaultAPIError } from '../error/DefaultAPIError.js';
|
|
4
|
+
import { secretsDictionary } from '../error/dictionary/secrets.js';
|
|
5
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
6
|
+
class SecretClient extends ReactQueryNetworkClient {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(apis.secrets.url, defaults);
|
|
9
|
+
/**
|
|
10
|
+
* Create a key
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(this, "createKey", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: this.mutation(createKey)
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Get all keys
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(this, "getAllKeys", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: this.query(getAll1)
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Delete a key
|
|
29
|
+
*/
|
|
30
|
+
Object.defineProperty(this, "deleteKey", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: this.mutation(deleteKey)
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Update a key's description
|
|
38
|
+
*/
|
|
39
|
+
Object.defineProperty(this, "updateKey", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: this.mutation(editKey)
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Get which secrets are defined or undefined for a user
|
|
47
|
+
*/
|
|
48
|
+
Object.defineProperty(this, "getAvailability", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: this.query(getAvailability)
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Update a secret's value
|
|
56
|
+
*/
|
|
57
|
+
Object.defineProperty(this, "updateSecretValue", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true,
|
|
61
|
+
value: this.mutation(updateSecretValue)
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Delete a secret's value
|
|
65
|
+
*/
|
|
66
|
+
Object.defineProperty(this, "deleteSecretValue", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: this.mutation(deleteSecretValue)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
buildStackSpotError(error) {
|
|
74
|
+
return new DefaultAPIError(error.data, error.status, secretsDictionary, error.headers);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export const secretsClient = new SecretClient();
|
|
78
|
+
//# sourceMappingURL=secrets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/client/secrets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACxI,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,MAAM,YAAa,SAAQ,uBAAuB;IAChD;QACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAOnC;;WAEG;QACH;;;;mBAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;WAAA;QAEpC;;WAEG;QACH;;;;mBAAa,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;WAAA;QAEhC;;WAEG;QACH;;;;mBAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;WAAA;QAEpC;;WAEG;QACH;;;;mBAAY,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;WAAA;QAElC;;WAEG;QACH;;;;mBAAkB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;WAAA;QAE7C;;WAEG;QACH;;;;mBAAoB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WAAA;QAEpD;;WAEG;QACH;;;;mBAAoB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WAAA;IAvCpD,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACxF,CAAC;CAqCF;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StackspotAPIError } from './StackspotAPIError.js';
|
|
2
|
+
/**
|
|
3
|
+
* This error is thrown when a request is canceled by the user before it completes.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CanceledError extends StackspotAPIError {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=CanceledError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanceledError.d.ts","sourceRoot":"","sources":["../../src/error/CanceledError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;GAEG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;;CAInD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StackspotAPIError } from './StackspotAPIError.js';
|
|
2
|
+
/**
|
|
3
|
+
* This error is thrown when a request is canceled by the user before it completes.
|
|
4
|
+
*/
|
|
5
|
+
export class CanceledError extends StackspotAPIError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super({ status: 0, message: lang => lang === 'en' ? 'Canceled by the user' : 'Cancelado pelo usuário' });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CanceledError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanceledError.js","sourceRoot":"","sources":["../../src/error/CanceledError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAClD;QACE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAA;IAC1G,CAAC;CACF"}
|