@stack-spot/portal-network 0.208.3 → 0.210.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/accountAssetManager.d.ts +279 -0
- package/dist/api/accountAssetManager.d.ts.map +1 -0
- package/dist/api/accountAssetManager.js +167 -0
- package/dist/api/accountAssetManager.js.map +1 -0
- package/dist/api-addresses.d.ts +13 -20
- package/dist/api-addresses.d.ts.map +1 -1
- package/dist/api-addresses.js +59 -17
- package/dist/api-addresses.js.map +1 -1
- package/dist/apis-itau.json +8 -0
- package/dist/apis.json +8 -0
- package/dist/client/account-asset-manager.d.ts +110 -0
- package/dist/client/account-asset-manager.d.ts.map +1 -0
- package/dist/client/account-asset-manager.js +160 -0
- package/dist/client/account-asset-manager.js.map +1 -0
- package/dist/client/ai.d.ts +24 -1
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +19 -1
- package/dist/client/ai.js.map +1 -1
- package/dist/error/dictionary/accountAssetManager.d.ts +11 -0
- package/dist/error/dictionary/accountAssetManager.d.ts.map +1 -0
- package/dist/error/dictionary/accountAssetManager.js +11 -0
- package/dist/error/dictionary/accountAssetManager.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/network/NetworkClient.d.ts.map +1 -1
- package/dist/network/NetworkClient.js +11 -2
- package/dist/network/NetworkClient.js.map +1 -1
- package/dist/network/types.d.ts +1 -0
- package/dist/network/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/readme.md +42 -1
- package/src/api/accountAssetManager.ts +655 -0
- package/src/api-addresses.ts +92 -37
- package/src/apis-itau.json +8 -0
- package/src/apis.json +8 -0
- package/src/client/account-asset-manager.ts +100 -0
- package/src/client/ai.ts +10 -0
- package/src/error/dictionary/accountAssetManager.ts +12 -0
- package/src/index.ts +2 -1
- package/src/network/NetworkClient.ts +12 -3
- package/src/network/types.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.210.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.209.0...portal-network@v0.210.0) (2025-12-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* change local running ([#1925](https://github.com/stack-spot/portal-commons/issues/1925)) ([5a9c201](https://github.com/stack-spot/portal-commons/commit/5a9c201868de8fdbb835cdb045da74ab222b01dd))
|
|
9
|
+
|
|
10
|
+
## [0.209.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.208.3...portal-network@v0.209.0) (2025-12-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* 3310 analytics token get info ([#1783](https://github.com/stack-spot/portal-commons/issues/1783)) ([11b1b4c](https://github.com/stack-spot/portal-commons/commit/11b1b4c94a8fe69e966f18c2f1d4a732901ff55c))
|
|
16
|
+
* folders and projects ([#1895](https://github.com/stack-spot/portal-commons/issues/1895)) ([55b598d](https://github.com/stack-spot/portal-commons/commit/55b598d8af3c3b68ebe4b056ec25a399c2a01cf8))
|
|
17
|
+
|
|
3
18
|
## [0.208.3](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.208.2...portal-network@v0.208.3) (2025-12-17)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EDP Backend for StackSpot Asset Management
|
|
3
|
+
* 0.0.1
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
export declare const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders>;
|
|
9
|
+
export declare const servers: {
|
|
10
|
+
generatedServerUrl: string;
|
|
11
|
+
};
|
|
12
|
+
export type CreateProjectRequest = {
|
|
13
|
+
/** Project name */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Project unique slug */
|
|
16
|
+
slug: string;
|
|
17
|
+
/** Project description */
|
|
18
|
+
description: string;
|
|
19
|
+
/** Folder ULID where the project will be created. Required. */
|
|
20
|
+
folderId: string;
|
|
21
|
+
};
|
|
22
|
+
export type ApiIdResponse = {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
export type ValidationDetail = {
|
|
26
|
+
code: string;
|
|
27
|
+
values: string[];
|
|
28
|
+
};
|
|
29
|
+
export type ErrorBody = {
|
|
30
|
+
code: string;
|
|
31
|
+
details: string;
|
|
32
|
+
status: string;
|
|
33
|
+
validationDetails?: ValidationDetail[];
|
|
34
|
+
};
|
|
35
|
+
export type CreateAssetRequest = {
|
|
36
|
+
/** New asset's name */
|
|
37
|
+
name: string;
|
|
38
|
+
/** New asset's name */
|
|
39
|
+
slug: string;
|
|
40
|
+
/** New asset's description */
|
|
41
|
+
description: string;
|
|
42
|
+
/** New asset's type */
|
|
43
|
+
"type": string;
|
|
44
|
+
/** Asset's createdBy user. Required only for Service Token. */
|
|
45
|
+
createdBy?: string;
|
|
46
|
+
};
|
|
47
|
+
export type FolderResponse = {
|
|
48
|
+
/** Folder ID */
|
|
49
|
+
id: string;
|
|
50
|
+
/** Folder name */
|
|
51
|
+
name: string;
|
|
52
|
+
/** Folder slug */
|
|
53
|
+
slug: string;
|
|
54
|
+
/** Folder description */
|
|
55
|
+
description: string;
|
|
56
|
+
/** Folder creation date */
|
|
57
|
+
createdAt: string;
|
|
58
|
+
/** Folder creator */
|
|
59
|
+
createdBy: string;
|
|
60
|
+
/** Sub folders */
|
|
61
|
+
folders: any[];
|
|
62
|
+
};
|
|
63
|
+
export type CreateFolderRequest = {
|
|
64
|
+
/** New folder's name */
|
|
65
|
+
name: string;
|
|
66
|
+
/** New folder's unique slug */
|
|
67
|
+
slug: string;
|
|
68
|
+
/** New folder's description */
|
|
69
|
+
description: string;
|
|
70
|
+
/** Parent folder's api id, null if creating root folder. ULID Format */
|
|
71
|
+
parentFolderId?: string;
|
|
72
|
+
};
|
|
73
|
+
export type AssetTypeResponse = {
|
|
74
|
+
apiId: string;
|
|
75
|
+
name: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
export type CreateAssetTypeRequest = {
|
|
79
|
+
/** New asset type's name */
|
|
80
|
+
name: string;
|
|
81
|
+
/** New asset type's description */
|
|
82
|
+
description: string;
|
|
83
|
+
/** Asset type's createdBy user. Required only for Service Token. */
|
|
84
|
+
createdBy?: string;
|
|
85
|
+
};
|
|
86
|
+
export type ProjectAssetsResponse = {
|
|
87
|
+
/** Asset's id */
|
|
88
|
+
id: string;
|
|
89
|
+
/** Asset's name */
|
|
90
|
+
name: string;
|
|
91
|
+
/** Asset's type */
|
|
92
|
+
"type": string;
|
|
93
|
+
};
|
|
94
|
+
export type ProjectDetailsResponse = {
|
|
95
|
+
/** Projects's id */
|
|
96
|
+
id: string;
|
|
97
|
+
/** Projects's name */
|
|
98
|
+
name: string;
|
|
99
|
+
/** Projects's unique slug */
|
|
100
|
+
slug: string;
|
|
101
|
+
/** Projects's description */
|
|
102
|
+
description: string;
|
|
103
|
+
/** Creation date of the project */
|
|
104
|
+
createdAt: string;
|
|
105
|
+
/** Creator of the project */
|
|
106
|
+
createdBy: string;
|
|
107
|
+
/** Folder's id */
|
|
108
|
+
folderId: string;
|
|
109
|
+
/** Assets linked to a project */
|
|
110
|
+
assets: ProjectAssetsResponse[];
|
|
111
|
+
};
|
|
112
|
+
export type UpdateProjectRequest = {
|
|
113
|
+
/** Project name */
|
|
114
|
+
name?: string;
|
|
115
|
+
/** Project description */
|
|
116
|
+
description?: string;
|
|
117
|
+
};
|
|
118
|
+
export type ProjectResponse = {
|
|
119
|
+
/** Project id */
|
|
120
|
+
id: string;
|
|
121
|
+
/** Project name */
|
|
122
|
+
name: string;
|
|
123
|
+
/** Project description */
|
|
124
|
+
description: string;
|
|
125
|
+
/** Project slug */
|
|
126
|
+
slug: string;
|
|
127
|
+
/** Project status */
|
|
128
|
+
status: "ACTIVE" | "DRAFT";
|
|
129
|
+
};
|
|
130
|
+
export type UpdateAssetRequest = {
|
|
131
|
+
/** Asset's name */
|
|
132
|
+
name: string;
|
|
133
|
+
/** Asset's description */
|
|
134
|
+
description: string;
|
|
135
|
+
/** Asset's updatedBy user. Required only for Service Token. */
|
|
136
|
+
updatedBy?: string;
|
|
137
|
+
};
|
|
138
|
+
export type FolderProjectResponse = {
|
|
139
|
+
/** Project's id */
|
|
140
|
+
id: string;
|
|
141
|
+
/** Project's name */
|
|
142
|
+
name: string;
|
|
143
|
+
/** Project's created by */
|
|
144
|
+
createdBy: string;
|
|
145
|
+
};
|
|
146
|
+
export type FoldersDetailsResponse = {
|
|
147
|
+
/** Folder's id */
|
|
148
|
+
id: string;
|
|
149
|
+
/** Folder's name */
|
|
150
|
+
name: string;
|
|
151
|
+
/** Folder's unique slug */
|
|
152
|
+
slug: string;
|
|
153
|
+
/** Folder's description */
|
|
154
|
+
description: string;
|
|
155
|
+
/** Creator of the folder */
|
|
156
|
+
createdBy: string;
|
|
157
|
+
/** Creator of the folder */
|
|
158
|
+
createdAt: string;
|
|
159
|
+
/** Projects linked to a folder */
|
|
160
|
+
projects?: FolderProjectResponse[];
|
|
161
|
+
/** Folder linked to a folder */
|
|
162
|
+
folders?: FoldersDetailsResponse[];
|
|
163
|
+
};
|
|
164
|
+
export type UpdateFolderRequest = {
|
|
165
|
+
/** Folder name */
|
|
166
|
+
name: string;
|
|
167
|
+
/** Folder description */
|
|
168
|
+
description: string;
|
|
169
|
+
};
|
|
170
|
+
export type UpdateAssetTypeRequest = {
|
|
171
|
+
/** Asset type's name */
|
|
172
|
+
name: string;
|
|
173
|
+
/** Asset type's description */
|
|
174
|
+
description: string;
|
|
175
|
+
/** Asset type's updatedBy user. Required only for Service Token. */
|
|
176
|
+
updatedBy?: string;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Create project
|
|
180
|
+
*/
|
|
181
|
+
export declare function saveProject({ createProjectRequest }: {
|
|
182
|
+
createProjectRequest: CreateProjectRequest;
|
|
183
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
184
|
+
/**
|
|
185
|
+
* Create asset
|
|
186
|
+
*/
|
|
187
|
+
export declare function saveAsset({ projectId, createAssetRequest }: {
|
|
188
|
+
projectId: string;
|
|
189
|
+
createAssetRequest: CreateAssetRequest;
|
|
190
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
191
|
+
/**
|
|
192
|
+
* List folders
|
|
193
|
+
*/
|
|
194
|
+
export declare function listFolders(opts?: Oazapfts.RequestOpts): Promise<FolderResponse[]>;
|
|
195
|
+
/**
|
|
196
|
+
* Create folder
|
|
197
|
+
*/
|
|
198
|
+
export declare function saveFolder({ createFolderRequest }: {
|
|
199
|
+
createFolderRequest: CreateFolderRequest;
|
|
200
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
201
|
+
/**
|
|
202
|
+
* List assets type
|
|
203
|
+
*/
|
|
204
|
+
export declare function listAssetTypes({ name }: {
|
|
205
|
+
name?: string;
|
|
206
|
+
}, opts?: Oazapfts.RequestOpts): Promise<AssetTypeResponse[]>;
|
|
207
|
+
/**
|
|
208
|
+
* Create asset type
|
|
209
|
+
*/
|
|
210
|
+
export declare function saveAssetType({ createAssetTypeRequest }: {
|
|
211
|
+
createAssetTypeRequest: CreateAssetTypeRequest;
|
|
212
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
213
|
+
/**
|
|
214
|
+
* Get project details
|
|
215
|
+
*/
|
|
216
|
+
export declare function getProjectDetails({ projectId }: {
|
|
217
|
+
projectId: string;
|
|
218
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ProjectDetailsResponse>;
|
|
219
|
+
/**
|
|
220
|
+
* Delete project
|
|
221
|
+
*/
|
|
222
|
+
export declare function deleteProject({ projectId }: {
|
|
223
|
+
projectId: string;
|
|
224
|
+
}, opts?: Oazapfts.RequestOpts): Promise<unknown>;
|
|
225
|
+
/**
|
|
226
|
+
* Update project
|
|
227
|
+
*/
|
|
228
|
+
export declare function updateProject({ projectId, updateProjectRequest }: {
|
|
229
|
+
projectId: string;
|
|
230
|
+
updateProjectRequest: UpdateProjectRequest;
|
|
231
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ProjectResponse>;
|
|
232
|
+
/**
|
|
233
|
+
* Disassociate asset from project
|
|
234
|
+
*/
|
|
235
|
+
export declare function disassociateProjectAsset({ projectId, assetId }: {
|
|
236
|
+
projectId: string;
|
|
237
|
+
assetId: string;
|
|
238
|
+
}, opts?: Oazapfts.RequestOpts): Promise<unknown>;
|
|
239
|
+
/**
|
|
240
|
+
* Update asset
|
|
241
|
+
*/
|
|
242
|
+
export declare function updateAsset({ projectId, assetId, updateAssetRequest }: {
|
|
243
|
+
projectId: string;
|
|
244
|
+
assetId: string;
|
|
245
|
+
updateAssetRequest: UpdateAssetRequest;
|
|
246
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
247
|
+
/**
|
|
248
|
+
* Get folder details
|
|
249
|
+
*/
|
|
250
|
+
export declare function getFolderDetails({ folderId }: {
|
|
251
|
+
folderId: string;
|
|
252
|
+
}, opts?: Oazapfts.RequestOpts): Promise<FoldersDetailsResponse>;
|
|
253
|
+
/**
|
|
254
|
+
* Delete folder
|
|
255
|
+
*/
|
|
256
|
+
export declare function deleteFolder({ folderId }: {
|
|
257
|
+
folderId: string;
|
|
258
|
+
}, opts?: Oazapfts.RequestOpts): Promise<unknown>;
|
|
259
|
+
/**
|
|
260
|
+
* Update folder
|
|
261
|
+
*/
|
|
262
|
+
export declare function updateFolders({ folderId, updateFolderRequest }: {
|
|
263
|
+
folderId: string;
|
|
264
|
+
updateFolderRequest: UpdateFolderRequest;
|
|
265
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
266
|
+
/**
|
|
267
|
+
* Delete asset type
|
|
268
|
+
*/
|
|
269
|
+
export declare function deleteAssetType({ assetTypeId }: {
|
|
270
|
+
assetTypeId: string;
|
|
271
|
+
}, opts?: Oazapfts.RequestOpts): Promise<unknown>;
|
|
272
|
+
/**
|
|
273
|
+
* Update asset type
|
|
274
|
+
*/
|
|
275
|
+
export declare function updateAssetType({ assetTypeId, updateAssetTypeRequest }: {
|
|
276
|
+
assetTypeId: string;
|
|
277
|
+
updateAssetTypeRequest: UpdateAssetTypeRequest;
|
|
278
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ApiIdResponse>;
|
|
279
|
+
//# sourceMappingURL=accountAssetManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountAssetManager.d.ts","sourceRoot":"","sources":["../../src/api/accountAssetManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CAAC;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG;IAC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
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EDP Backend for StackSpot Asset Management
|
|
3
|
+
* 0.0.1
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
+
export const defaults = {
|
|
10
|
+
headers: {},
|
|
11
|
+
baseUrl: "https://account-asset-manager.dev.stackspot.com",
|
|
12
|
+
};
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {
|
|
15
|
+
generatedServerUrl: "https://account-asset-manager.dev.stackspot.com"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Create project
|
|
19
|
+
*/
|
|
20
|
+
export function saveProject({ createProjectRequest }, opts) {
|
|
21
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/account/projects", oazapfts.json({
|
|
22
|
+
...opts,
|
|
23
|
+
method: "POST",
|
|
24
|
+
body: createProjectRequest
|
|
25
|
+
})));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create asset
|
|
29
|
+
*/
|
|
30
|
+
export function saveAsset({ projectId, createAssetRequest }, opts) {
|
|
31
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/projects/${encodeURIComponent(projectId)}/assets`, oazapfts.json({
|
|
32
|
+
...opts,
|
|
33
|
+
method: "POST",
|
|
34
|
+
body: createAssetRequest
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* List folders
|
|
39
|
+
*/
|
|
40
|
+
export function listFolders(opts) {
|
|
41
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/account/folders", {
|
|
42
|
+
...opts
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create folder
|
|
47
|
+
*/
|
|
48
|
+
export function saveFolder({ createFolderRequest }, opts) {
|
|
49
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/account/folders", oazapfts.json({
|
|
50
|
+
...opts,
|
|
51
|
+
method: "POST",
|
|
52
|
+
body: createFolderRequest
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* List assets type
|
|
57
|
+
*/
|
|
58
|
+
export function listAssetTypes({ name }, opts) {
|
|
59
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/assets/types${QS.query(QS.explode({
|
|
60
|
+
name
|
|
61
|
+
}))}`, {
|
|
62
|
+
...opts
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create asset type
|
|
67
|
+
*/
|
|
68
|
+
export function saveAssetType({ createAssetTypeRequest }, opts) {
|
|
69
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/account/assets/types", oazapfts.json({
|
|
70
|
+
...opts,
|
|
71
|
+
method: "POST",
|
|
72
|
+
body: createAssetTypeRequest
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get project details
|
|
77
|
+
*/
|
|
78
|
+
export function getProjectDetails({ projectId }, opts) {
|
|
79
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/projects/${encodeURIComponent(projectId)}`, {
|
|
80
|
+
...opts
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete project
|
|
85
|
+
*/
|
|
86
|
+
export function deleteProject({ projectId }, opts) {
|
|
87
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/projects/${encodeURIComponent(projectId)}`, {
|
|
88
|
+
...opts,
|
|
89
|
+
method: "DELETE"
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Update project
|
|
94
|
+
*/
|
|
95
|
+
export function updateProject({ projectId, updateProjectRequest }, opts) {
|
|
96
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/projects/${encodeURIComponent(projectId)}`, oazapfts.json({
|
|
97
|
+
...opts,
|
|
98
|
+
method: "PATCH",
|
|
99
|
+
body: updateProjectRequest
|
|
100
|
+
})));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Disassociate asset from project
|
|
104
|
+
*/
|
|
105
|
+
export function disassociateProjectAsset({ projectId, assetId }, opts) {
|
|
106
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/projects/${encodeURIComponent(projectId)}/assets/${encodeURIComponent(assetId)}`, {
|
|
107
|
+
...opts,
|
|
108
|
+
method: "DELETE"
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Update asset
|
|
113
|
+
*/
|
|
114
|
+
export function updateAsset({ projectId, assetId, updateAssetRequest }, opts) {
|
|
115
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/projects/${encodeURIComponent(projectId)}/assets/${encodeURIComponent(assetId)}`, oazapfts.json({
|
|
116
|
+
...opts,
|
|
117
|
+
method: "PATCH",
|
|
118
|
+
body: updateAssetRequest
|
|
119
|
+
})));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get folder details
|
|
123
|
+
*/
|
|
124
|
+
export function getFolderDetails({ folderId }, opts) {
|
|
125
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/folders/${encodeURIComponent(folderId)}`, {
|
|
126
|
+
...opts
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Delete folder
|
|
131
|
+
*/
|
|
132
|
+
export function deleteFolder({ folderId }, opts) {
|
|
133
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/folders/${encodeURIComponent(folderId)}`, {
|
|
134
|
+
...opts,
|
|
135
|
+
method: "DELETE"
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Update folder
|
|
140
|
+
*/
|
|
141
|
+
export function updateFolders({ folderId, updateFolderRequest }, opts) {
|
|
142
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/folders/${encodeURIComponent(folderId)}`, oazapfts.json({
|
|
143
|
+
...opts,
|
|
144
|
+
method: "PATCH",
|
|
145
|
+
body: updateFolderRequest
|
|
146
|
+
})));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Delete asset type
|
|
150
|
+
*/
|
|
151
|
+
export function deleteAssetType({ assetTypeId }, opts) {
|
|
152
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/assets/types/${encodeURIComponent(assetTypeId)}`, {
|
|
153
|
+
...opts,
|
|
154
|
+
method: "DELETE"
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Update asset type
|
|
159
|
+
*/
|
|
160
|
+
export function updateAssetType({ assetTypeId, updateAssetTypeRequest }, opts) {
|
|
161
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/account/assets/types/${encodeURIComponent(assetTypeId)}`, oazapfts.json({
|
|
162
|
+
...opts,
|
|
163
|
+
method: "PATCH",
|
|
164
|
+
body: updateAssetTypeRequest
|
|
165
|
+
})));
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=accountAssetManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountAssetManager.js","sourceRoot":"","sources":["../../src/api/accountAssetManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,iDAAiD;CAC7D,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,k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E,QAAQ;KACnB,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,mBAAmB,EAG5D,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAkBlC,uBAAuB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpE,GAAG,IAAI;QACP,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,mBAAmB;KAC5B,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,WAAW,EAE5C,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAelC,4BAA4B,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAAE;QAC9D,GAAG,IAAI;QACP,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAGpE,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAkBlC,4BAA4B,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;QAC5E,GAAG,IAAI;QACP,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,sBAAsB;KAC/B,CAAC,CAAC,CAAC,CAAC;AACT,CAAC"}
|
package/dist/api-addresses.d.ts
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
|
+
import { APIMap } from '@stack-spot/opa';
|
|
1
2
|
import apisJson from './apis.json';
|
|
2
3
|
import { Env, Tenant } from './network/types.js';
|
|
3
4
|
type ApisKeys = keyof typeof apisJson;
|
|
5
|
+
declare global {
|
|
6
|
+
interface ImportMeta {
|
|
7
|
+
readonly env: {
|
|
8
|
+
VITE_NETWORK_OVERRIDES: string;
|
|
9
|
+
DEV: boolean;
|
|
10
|
+
PROD: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
4
14
|
type ApiConfig = {
|
|
5
15
|
url: Record<Env, string>;
|
|
6
16
|
docs?: string;
|
|
7
17
|
};
|
|
8
|
-
type PartialApiConfig = {
|
|
9
|
-
url: Partial<Record<Env, string>>;
|
|
10
|
-
docs?: string;
|
|
11
|
-
};
|
|
12
18
|
type Apis = Record<ApisKeys, ApiConfig>;
|
|
13
|
-
type
|
|
14
|
-
type ApiAddress = {
|
|
15
|
-
[api: string]: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Returns the API catalog for the given tenant.
|
|
19
|
-
*
|
|
20
|
-
* @param tenant The current tenant (e.g., 'stackspot', 'itau').
|
|
21
|
-
* @returns API catalog containing the URLs per environment.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getApisByTenant(tenant: Tenant): Apis;
|
|
19
|
+
type ApiAddress = Record<ApisKeys, string>;
|
|
24
20
|
/**
|
|
25
21
|
* Returns the base URL for the given environment and tenant, applying any overrides if available
|
|
26
22
|
*
|
|
@@ -30,16 +26,13 @@ export declare function getApisByTenant(tenant: Tenant): Apis;
|
|
|
30
26
|
* @returns {string} the base URL for the given environment and tenant, applying any overrides if available.
|
|
31
27
|
*/
|
|
32
28
|
export declare const getBaseUrlByTenantWithOverride: (baseUrl: Record<Env, string>, targetEnv?: Env, tenant?: Tenant) => string;
|
|
33
|
-
|
|
34
|
-
* Sets the APIs addresses for override.
|
|
35
|
-
* @param customApis a JSON object containing APIs address to override.
|
|
36
|
-
*/
|
|
37
|
-
export declare const setApisOverride: (customApis: PartialApis) => void;
|
|
29
|
+
export declare const getApisBaseUrlConfig: (env?: Env, tenant?: Tenant) => ApiAddress;
|
|
38
30
|
/**
|
|
39
31
|
* Sets the default APIs addresses for each environments.
|
|
40
32
|
* @returns {Apis} an object containing APIs URLs grouped by api name and enviroments.
|
|
41
33
|
*/
|
|
42
34
|
export declare const getApiAddresses: () => Apis;
|
|
43
35
|
export declare const apiAddresses: () => ApiAddress;
|
|
36
|
+
export declare function getPermissionsAPIMap(env: Env, tenant?: Tenant): APIMap;
|
|
44
37
|
export {};
|
|
45
38
|
//# sourceMappingURL=api-addresses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-addresses.d.ts","sourceRoot":"","sources":["../src/api-addresses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-addresses.d.ts","sourceRoot":"","sources":["../src/api-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,QAAQ,MAAM,aAAa,CAAwB;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,KAAK,QAAQ,GAAG,MAAM,OAAO,QAAQ,CAAC;AAKtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB,QAAQ,CAAC,GAAG,EAAE;YACZ,sBAAsB,EAAE,MAAM,CAAC;YAC/B,GAAG,EAAE,OAAO,CAAC;YACb,IAAI,EAAE,OAAO,CAAC;SACf,CAAC;KACH;CACF;AAED,KAAK,SAAS,GAAG;IACf,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAA;AAED,KAAK,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAExC,KAAK,UAAU,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;AA6D1C;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,YAAW,GAAW,EACjG,SAAQ,MAAoB,KAAG,MAgBhC,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,MAAK,GAAW,EAAE,SAAQ,MAAoB,KAAG,UAcrF,CAAA;AAGD;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,IAAmB,CAAA;AAEtD,eAAO,MAAM,YAAY,kBAGxB,CAAA;AA6BD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,GAAE,MAAoB,GAAG,MAAM,CAGnF"}
|
package/dist/api-addresses.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import apisItauJson from './apis-itau.json' assert { type: 'json' };
|
|
2
2
|
import apisJson from './apis.json' assert { type: 'json' };
|
|
3
3
|
import { NetworkClient } from './network/NetworkClient.js';
|
|
4
|
-
|
|
5
|
-
let overrideApis = {};
|
|
4
|
+
const defaultApis = apisJson;
|
|
6
5
|
const apis = {
|
|
7
6
|
'stackspot': apisJson,
|
|
8
7
|
'itau': apisItauJson,
|
|
@@ -13,7 +12,7 @@ const apis = {
|
|
|
13
12
|
* @param tenant The current tenant (e.g., 'stackspot', 'itau').
|
|
14
13
|
* @returns API catalog containing the URLs per environment.
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
function getApisByTenant(tenant) {
|
|
17
16
|
return apis[tenant];
|
|
18
17
|
}
|
|
19
18
|
function transformApisToApiAddress(apis, env) {
|
|
@@ -39,6 +38,19 @@ function matchesBaseUrl(baseUrl, candidate) {
|
|
|
39
38
|
return true;
|
|
40
39
|
});
|
|
41
40
|
}
|
|
41
|
+
const getApiOverride = () => {
|
|
42
|
+
const envs = import.meta.env;
|
|
43
|
+
let overrideAPIsURL = {};
|
|
44
|
+
if (envs.PROD)
|
|
45
|
+
return overrideAPIsURL;
|
|
46
|
+
try {
|
|
47
|
+
overrideAPIsURL = JSON.parse(envs.VITE_NETWORK_OVERRIDES);
|
|
48
|
+
return overrideAPIsURL;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return overrideAPIsURL;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
42
54
|
/**
|
|
43
55
|
* Returns the base URL for the given environment and tenant, applying any overrides if available
|
|
44
56
|
*
|
|
@@ -57,29 +69,59 @@ export const getBaseUrlByTenantWithOverride = (baseUrl, targetEnv = 'prd', tenan
|
|
|
57
69
|
}
|
|
58
70
|
if (!matchesApiName)
|
|
59
71
|
return '';
|
|
60
|
-
const
|
|
61
|
-
if (overrideUrl) {
|
|
62
|
-
return overrideUrl;
|
|
63
|
-
}
|
|
72
|
+
const overrides = getApiOverride();
|
|
64
73
|
const apis = getApisByTenant(tenant);
|
|
65
|
-
|
|
74
|
+
const api = apis[matchesApiName];
|
|
75
|
+
return overrides?.[matchesApiName] ?? api?.url?.[targetEnv];
|
|
66
76
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
export const getApisBaseUrlConfig = (env = 'prd', tenant = 'stackspot') => {
|
|
78
|
+
const overrides = getApiOverride();
|
|
79
|
+
const apis = getApisByTenant(tenant);
|
|
80
|
+
const apiMap = {};
|
|
81
|
+
for (const [key, value] of Object.entries(apis)) {
|
|
82
|
+
if (value?.url && value.url?.[env]) {
|
|
83
|
+
const url = value.url[env];
|
|
84
|
+
const api = key;
|
|
85
|
+
apiMap[api] = url;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { ...apiMap, ...overrides };
|
|
73
89
|
};
|
|
74
90
|
/**
|
|
75
91
|
* Sets the default APIs addresses for each environments.
|
|
76
92
|
* @returns {Apis} an object containing APIs URLs grouped by api name and enviroments.
|
|
77
93
|
*/
|
|
78
|
-
export const getApiAddresses = () =>
|
|
79
|
-
return defaultApis;
|
|
80
|
-
};
|
|
94
|
+
export const getApiAddresses = () => defaultApis;
|
|
81
95
|
export const apiAddresses = () => {
|
|
82
96
|
const env = NetworkClient.getEnv();
|
|
83
97
|
return transformApisToApiAddress(defaultApis, env);
|
|
84
98
|
};
|
|
99
|
+
const networkApiNameToOpaApiName = {
|
|
100
|
+
ai: 'code-buddy',
|
|
101
|
+
dataIntegration: 'data-integration',
|
|
102
|
+
workspaceManager: 'workspace-manager',
|
|
103
|
+
cloudServices: 'cloud-services',
|
|
104
|
+
cloudAccount: 'cloud-account',
|
|
105
|
+
cloudPlatformHorizon: 'cloud-platform-horizon',
|
|
106
|
+
codeShift: 'code-shift',
|
|
107
|
+
genAiInference: 'ai-inference',
|
|
108
|
+
apiRuntime: 'runtime-manager',
|
|
109
|
+
serviceCatalog: 'catalog',
|
|
110
|
+
};
|
|
111
|
+
function resolveApiName(name) {
|
|
112
|
+
return networkApiNameToOpaApiName[name] ?? name;
|
|
113
|
+
}
|
|
114
|
+
function generateApiMap(apis) {
|
|
115
|
+
const apiMap = {};
|
|
116
|
+
for (const [key, url] of Object.entries(apis)) {
|
|
117
|
+
if (url) {
|
|
118
|
+
apiMap[url] = resolveApiName(key);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return apiMap;
|
|
122
|
+
}
|
|
123
|
+
export function getPermissionsAPIMap(env, tenant = 'stackspot') {
|
|
124
|
+
const apis = getApisBaseUrlConfig(env, tenant);
|
|
125
|
+
return generateApiMap(apis);
|
|
126
|
+
}
|
|
85
127
|
//# sourceMappingURL=api-addresses.js.map
|