@epam/ai-dial-chat-api-client 1.3.0-dev.225 → 1.3.0-dev.235

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.
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CreateProjectResponseDto, ListProjectsResponseDto } from '../models/index';
13
+ import type { CreateProjectResponseDto, ListProjectsResponseDto, ProjectDetailsDto, UpdateProjectResponseDto } from '../models/index';
14
14
  export interface CreateProjectRequest {
15
15
  name: string;
16
16
  description?: string;
@@ -18,6 +18,30 @@ export interface CreateProjectRequest {
18
18
  fileNames?: string;
19
19
  files?: Array<Blob>;
20
20
  }
21
+ export interface DeleteProjectRequest {
22
+ id: string;
23
+ ifMatch: string;
24
+ }
25
+ export interface DownloadProjectRequest {
26
+ id: string;
27
+ }
28
+ export interface DownloadProjectFileRequest {
29
+ id: string;
30
+ fileName: string;
31
+ }
32
+ export interface GetProjectRequest {
33
+ id: string;
34
+ }
35
+ export interface UpdateProjectRequest {
36
+ id: string;
37
+ ifMatch: string;
38
+ name: string;
39
+ description?: string;
40
+ instructions?: string;
41
+ fileNames?: string;
42
+ removedFileNames?: string;
43
+ files?: Array<Blob>;
44
+ }
21
45
  /**
22
46
  *
23
47
  */
@@ -32,6 +56,46 @@ export declare class ProjectsApi extends runtime.BaseAPI {
32
56
  * Create a project
33
57
  */
34
58
  createProject(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateProjectResponseDto>;
59
+ /**
60
+ * Deletes the project only if it is still the version named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
61
+ * Delete a project
62
+ */
63
+ deleteProjectRaw(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
64
+ /**
65
+ * Deletes the project only if it is still the version named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
66
+ * Delete a project
67
+ */
68
+ deleteProject(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
69
+ /**
70
+ * Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
71
+ * Download a project as a ZIP archive
72
+ */
73
+ downloadProjectRaw(requestParameters: DownloadProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
74
+ /**
75
+ * Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
76
+ * Download a project as a ZIP archive
77
+ */
78
+ downloadProject(requestParameters: DownloadProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
79
+ /**
80
+ * Streams one file directly under the project `context/` folder as an attachment with `X-Content-Type-Options: nosniff`.
81
+ * Download one context file of a project
82
+ */
83
+ downloadProjectFileRaw(requestParameters: DownloadProjectFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
84
+ /**
85
+ * Streams one file directly under the project `context/` folder as an attachment with `X-Content-Type-Options: nosniff`.
86
+ * Download one context file of a project
87
+ */
88
+ downloadProjectFile(requestParameters: DownloadProjectFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
89
+ /**
90
+ * Returns one project\'s name, description, instructions, context files with their sizes, and the ETag of the version they were read from. The BFF reads the project archive from DIAL Core, because project metadata carries no file sizes; `canEdit` is true only for a project in the caller\'s own bucket.
91
+ * Get a project
92
+ */
93
+ getProjectRaw(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectDetailsDto>>;
94
+ /**
95
+ * Returns one project\'s name, description, instructions, context files with their sizes, and the ETag of the version they were read from. The BFF reads the project archive from DIAL Core, because project metadata carries no file sizes; `canEdit` is true only for a project in the caller\'s own bucket.
96
+ * Get a project
97
+ */
98
+ getProject(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDetailsDto>;
35
99
  /**
36
100
  * Returns every DIAL project visible to the session user: the user\'s own bucket, the public (organization) bucket, and projects shared with the user, merged and de-duplicated by id. The BFF follows DIAL Core paging itself, so the list is complete up to a per-source page cap. A failing source is omitted; the request fails only when both bucket listings fail.
37
101
  * List projects
@@ -42,5 +106,15 @@ export declare class ProjectsApi extends runtime.BaseAPI {
42
106
  * List projects
43
107
  */
44
108
  listProjects(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListProjectsResponseDto>;
109
+ /**
110
+ * Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts and writes the whole project with `If-Match`. A different name then moves the project in its folder and keeps the caller\'s pin. Only a project in the caller\'s own bucket can be saved. Every domain rejection carries a ProjectCreateErrorCode.
111
+ * Save a project edit
112
+ */
113
+ updateProjectRaw(requestParameters: UpdateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateProjectResponseDto>>;
114
+ /**
115
+ * Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts and writes the whole project with `If-Match`. A different name then moves the project in its folder and keeps the caller\'s pin. Only a project in the caller\'s own bucket can be saved. Every domain rejection carries a ProjectCreateErrorCode.
116
+ * Save a project edit
117
+ */
118
+ updateProject(requestParameters: UpdateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateProjectResponseDto>;
45
119
  }
46
120
  //# sourceMappingURL=ProjectsApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectsApi.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/apis/ProjectsApi.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,OAAO,M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GACzD,OAAO,CAAC,iBAAiB,CAAC;IAK7B;;;OAGG;IACG,eAAe,CACnB,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GACzD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IA6BxD;;;OAGG;IACG,YAAY,CAChB,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GACzD,OAAO,CAAC,uBAAuB,CAAC;IAKnC;;;OAGG;IACG,gBAAgB,CACpB,iBAAiB,EAAE,oBAAoB,EACvC,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GACzD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAuGzD;;;OAGG;IACG,aAAa,CACjB,iBAAiB,EAAE,oBAAoB,EACvC,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GACzD,OAAO,CAAC,wBAAwB,CAAC;CAOrC"}
@@ -86,6 +86,155 @@ class ProjectsApi extends runtime.BaseAPI {
86
86
  const response = await this.createProjectRaw(requestParameters, initOverrides);
87
87
  return await response.value();
88
88
  }
89
+ /**
90
+ * Deletes the project only if it is still the version named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
91
+ * Delete a project
92
+ */
93
+ async deleteProjectRaw(requestParameters, initOverrides) {
94
+ if (requestParameters['id'] == null) {
95
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteProject().');
96
+ }
97
+ if (requestParameters['ifMatch'] == null) {
98
+ throw new runtime.RequiredError('ifMatch', 'Required parameter "ifMatch" was null or undefined when calling deleteProject().');
99
+ }
100
+ const queryParameters = {};
101
+ const headerParameters = {};
102
+ if (requestParameters['ifMatch'] != null) {
103
+ headerParameters['If-Match'] = String(requestParameters['ifMatch']);
104
+ }
105
+ if (this.configuration && this.configuration.accessToken) {
106
+ const token = this.configuration.accessToken;
107
+ const tokenString = await token('bearer', []);
108
+ if (tokenString) {
109
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
110
+ }
111
+ }
112
+ let urlPath = `/api/v1/projects/{id}`;
113
+ urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
114
+ const response = await this.request({
115
+ path: urlPath,
116
+ method: 'DELETE',
117
+ headers: headerParameters,
118
+ query: queryParameters,
119
+ }, initOverrides);
120
+ return new runtime.VoidApiResponse(response);
121
+ }
122
+ /**
123
+ * Deletes the project only if it is still the version named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
124
+ * Delete a project
125
+ */
126
+ async deleteProject(requestParameters, initOverrides) {
127
+ await this.deleteProjectRaw(requestParameters, initOverrides);
128
+ }
129
+ /**
130
+ * Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
131
+ * Download a project as a ZIP archive
132
+ */
133
+ async downloadProjectRaw(requestParameters, initOverrides) {
134
+ if (requestParameters['id'] == null) {
135
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling downloadProject().');
136
+ }
137
+ const queryParameters = {};
138
+ const headerParameters = {};
139
+ if (this.configuration && this.configuration.accessToken) {
140
+ const token = this.configuration.accessToken;
141
+ const tokenString = await token('bearer', []);
142
+ if (tokenString) {
143
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
144
+ }
145
+ }
146
+ let urlPath = `/api/v1/projects/{id}/archive`;
147
+ urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
148
+ const response = await this.request({
149
+ path: urlPath,
150
+ method: 'GET',
151
+ headers: headerParameters,
152
+ query: queryParameters,
153
+ }, initOverrides);
154
+ return new runtime.BlobApiResponse(response);
155
+ }
156
+ /**
157
+ * Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
158
+ * Download a project as a ZIP archive
159
+ */
160
+ async downloadProject(requestParameters, initOverrides) {
161
+ const response = await this.downloadProjectRaw(requestParameters, initOverrides);
162
+ return await response.value();
163
+ }
164
+ /**
165
+ * Streams one file directly under the project `context/` folder as an attachment with `X-Content-Type-Options: nosniff`.
166
+ * Download one context file of a project
167
+ */
168
+ async downloadProjectFileRaw(requestParameters, initOverrides) {
169
+ if (requestParameters['id'] == null) {
170
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling downloadProjectFile().');
171
+ }
172
+ if (requestParameters['fileName'] == null) {
173
+ throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling downloadProjectFile().');
174
+ }
175
+ const queryParameters = {};
176
+ const headerParameters = {};
177
+ if (this.configuration && this.configuration.accessToken) {
178
+ const token = this.configuration.accessToken;
179
+ const tokenString = await token('bearer', []);
180
+ if (tokenString) {
181
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
182
+ }
183
+ }
184
+ let urlPath = `/api/v1/projects/{id}/files/{fileName}`;
185
+ urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
186
+ urlPath = urlPath.replace(`{${'fileName'}}`, encodeURIComponent(String(requestParameters['fileName'])));
187
+ const response = await this.request({
188
+ path: urlPath,
189
+ method: 'GET',
190
+ headers: headerParameters,
191
+ query: queryParameters,
192
+ }, initOverrides);
193
+ return new runtime.BlobApiResponse(response);
194
+ }
195
+ /**
196
+ * Streams one file directly under the project `context/` folder as an attachment with `X-Content-Type-Options: nosniff`.
197
+ * Download one context file of a project
198
+ */
199
+ async downloadProjectFile(requestParameters, initOverrides) {
200
+ const response = await this.downloadProjectFileRaw(requestParameters, initOverrides);
201
+ return await response.value();
202
+ }
203
+ /**
204
+ * Returns one project\'s name, description, instructions, context files with their sizes, and the ETag of the version they were read from. The BFF reads the project archive from DIAL Core, because project metadata carries no file sizes; `canEdit` is true only for a project in the caller\'s own bucket.
205
+ * Get a project
206
+ */
207
+ async getProjectRaw(requestParameters, initOverrides) {
208
+ if (requestParameters['id'] == null) {
209
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getProject().');
210
+ }
211
+ const queryParameters = {};
212
+ const headerParameters = {};
213
+ if (this.configuration && this.configuration.accessToken) {
214
+ const token = this.configuration.accessToken;
215
+ const tokenString = await token('bearer', []);
216
+ if (tokenString) {
217
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
218
+ }
219
+ }
220
+ let urlPath = `/api/v1/projects/{id}`;
221
+ urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
222
+ const response = await this.request({
223
+ path: urlPath,
224
+ method: 'GET',
225
+ headers: headerParameters,
226
+ query: queryParameters,
227
+ }, initOverrides);
228
+ return new runtime.JSONApiResponse(response);
229
+ }
230
+ /**
231
+ * Returns one project\'s name, description, instructions, context files with their sizes, and the ETag of the version they were read from. The BFF reads the project archive from DIAL Core, because project metadata carries no file sizes; `canEdit` is true only for a project in the caller\'s own bucket.
232
+ * Get a project
233
+ */
234
+ async getProject(requestParameters, initOverrides) {
235
+ const response = await this.getProjectRaw(requestParameters, initOverrides);
236
+ return await response.value();
237
+ }
89
238
  /**
90
239
  * Returns every DIAL project visible to the session user: the user\'s own bucket, the public (organization) bucket, and projects shared with the user, merged and de-duplicated by id. The BFF follows DIAL Core paging itself, so the list is complete up to a per-source page cap. A failing source is omitted; the request fails only when both bucket listings fail.
91
240
  * List projects
@@ -117,5 +266,85 @@ class ProjectsApi extends runtime.BaseAPI {
117
266
  const response = await this.listProjectsRaw(initOverrides);
118
267
  return await response.value();
119
268
  }
269
+ /**
270
+ * Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts and writes the whole project with `If-Match`. A different name then moves the project in its folder and keeps the caller\'s pin. Only a project in the caller\'s own bucket can be saved. Every domain rejection carries a ProjectCreateErrorCode.
271
+ * Save a project edit
272
+ */
273
+ async updateProjectRaw(requestParameters, initOverrides) {
274
+ if (requestParameters['id'] == null) {
275
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateProject().');
276
+ }
277
+ if (requestParameters['ifMatch'] == null) {
278
+ throw new runtime.RequiredError('ifMatch', 'Required parameter "ifMatch" was null or undefined when calling updateProject().');
279
+ }
280
+ if (requestParameters['name'] == null) {
281
+ throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling updateProject().');
282
+ }
283
+ const queryParameters = {};
284
+ const headerParameters = {};
285
+ if (requestParameters['ifMatch'] != null) {
286
+ headerParameters['If-Match'] = String(requestParameters['ifMatch']);
287
+ }
288
+ if (this.configuration && this.configuration.accessToken) {
289
+ const token = this.configuration.accessToken;
290
+ const tokenString = await token('bearer', []);
291
+ if (tokenString) {
292
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
293
+ }
294
+ }
295
+ const consumes = [
296
+ { contentType: 'multipart/form-data' },
297
+ ];
298
+ // @ts-ignore: canConsumeForm may be unused
299
+ const canConsumeForm = runtime.canConsumeForm(consumes);
300
+ let formParams;
301
+ let useForm = false;
302
+ // use FormData to transmit files using content-type "multipart/form-data"
303
+ useForm = canConsumeForm;
304
+ if (useForm) {
305
+ formParams = new FormData();
306
+ }
307
+ else {
308
+ formParams = new URLSearchParams();
309
+ }
310
+ if (requestParameters['name'] != null) {
311
+ formParams.append('name', requestParameters['name']);
312
+ }
313
+ if (requestParameters['description'] != null) {
314
+ formParams.append('description', requestParameters['description']);
315
+ }
316
+ if (requestParameters['instructions'] != null) {
317
+ formParams.append('instructions', requestParameters['instructions']);
318
+ }
319
+ if (requestParameters['fileNames'] != null) {
320
+ formParams.append('fileNames', requestParameters['fileNames']);
321
+ }
322
+ if (requestParameters['removedFileNames'] != null) {
323
+ formParams.append('removedFileNames', requestParameters['removedFileNames']);
324
+ }
325
+ if (requestParameters['files'] != null) {
326
+ requestParameters['files'].forEach((element) => {
327
+ formParams.append('files', element);
328
+ });
329
+ }
330
+ let urlPath = `/api/v1/projects/{id}`;
331
+ urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
332
+ const response = await this.request({
333
+ path: urlPath,
334
+ method: 'PUT',
335
+ headers: headerParameters,
336
+ query: queryParameters,
337
+ body: formParams,
338
+ }, initOverrides);
339
+ return new runtime.JSONApiResponse(response);
340
+ }
341
+ /**
342
+ * Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts and writes the whole project with `If-Match`. A different name then moves the project in its folder and keeps the caller\'s pin. Only a project in the caller\'s own bucket can be saved. Every domain rejection carries a ProjectCreateErrorCode.
343
+ * Save a project edit
344
+ */
345
+ async updateProject(requestParameters, initOverrides) {
346
+ const response = await this.updateProjectRaw(requestParameters, initOverrides);
347
+ return await response.value();
348
+ }
120
349
  }
121
350
  exports.ProjectsApi = ProjectsApi;
@@ -96,6 +96,7 @@ export declare const GetCatalogPublishHistoryEntityTypeEnum: {
96
96
  readonly Application: "application";
97
97
  readonly Prompt: "prompt";
98
98
  readonly Skill: "skill";
99
+ readonly Project: "project";
99
100
  };
100
101
  export type GetCatalogPublishHistoryEntityTypeEnum = (typeof GetCatalogPublishHistoryEntityTypeEnum)[keyof typeof GetCatalogPublishHistoryEntityTypeEnum];
101
102
  /**
@@ -107,6 +108,7 @@ export declare const GetCatalogUnpublishAccessEntityTypeEnum: {
107
108
  readonly Application: "application";
108
109
  readonly Prompt: "prompt";
109
110
  readonly Skill: "skill";
111
+ readonly Project: "project";
110
112
  };
111
113
  export type GetCatalogUnpublishAccessEntityTypeEnum = (typeof GetCatalogUnpublishAccessEntityTypeEnum)[keyof typeof GetCatalogUnpublishAccessEntityTypeEnum];
112
114
  /**
@@ -118,6 +120,7 @@ export declare const PublishCatalogEntityEntityTypeEnum: {
118
120
  readonly Application: "application";
119
121
  readonly Prompt: "prompt";
120
122
  readonly Skill: "skill";
123
+ readonly Project: "project";
121
124
  };
122
125
  export type PublishCatalogEntityEntityTypeEnum = (typeof PublishCatalogEntityEntityTypeEnum)[keyof typeof PublishCatalogEntityEntityTypeEnum];
123
126
  /**
@@ -129,6 +132,7 @@ export declare const UnpublishCatalogEntityEntityTypeEnum: {
129
132
  readonly Application: "application";
130
133
  readonly Prompt: "prompt";
131
134
  readonly Skill: "skill";
135
+ readonly Project: "project";
132
136
  };
133
137
  export type UnpublishCatalogEntityEntityTypeEnum = (typeof UnpublishCatalogEntityEntityTypeEnum)[keyof typeof UnpublishCatalogEntityEntityTypeEnum];
134
138
  //# sourceMappingURL=PublishApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PublishApi.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/apis/PublishApi.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,+BAA+B;IAC9C,UAAU,EAAE,sCAAsC,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,uCAAuC,CAAC;IACpD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,kCAAkC,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,uBAAuB,CAAC;CAClD;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,oCAAoC,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB,EAAE,yBAAyB,CAAC;CACtD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,OAAO,CAAC,OAAO;IAC7C;;;OAGG;IAC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O,sCAAsC,CAAC,CAAC,MAAM,OAAO,sCAAsC,CAAC,CAAC;AACvG;;GAEG;AACH,eAAO,MAAM,uCAAuC;;;;;;;CAO1C,CAAC;AACX,MAAM,MAAM,uCAAuC,GACjD,CAAC,OAAO,uCAAuC,CAAC,CAAC,MAAM,OAAO,uCAAuC,CAAC,CAAC;AACzG;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;CAOrC,CAAC;AACX,MAAM,MAAM,kCAAkC,GAC5C,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,OAAO,kCAAkC,CAAC,CAAC;AAC/F;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;CAOvC,CAAC;AACX,MAAM,MAAM,oCAAoC,GAC9C,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,OAAO,oCAAoC,CAAC,CAAC"}
@@ -233,6 +233,7 @@ exports.GetCatalogPublishHistoryEntityTypeEnum = {
233
233
  Application: 'application',
234
234
  Prompt: 'prompt',
235
235
  Skill: 'skill',
236
+ Project: 'project',
236
237
  };
237
238
  /**
238
239
  * @export
@@ -243,6 +244,7 @@ exports.GetCatalogUnpublishAccessEntityTypeEnum = {
243
244
  Application: 'application',
244
245
  Prompt: 'prompt',
245
246
  Skill: 'skill',
247
+ Project: 'project',
246
248
  };
247
249
  /**
248
250
  * @export
@@ -253,6 +255,7 @@ exports.PublishCatalogEntityEntityTypeEnum = {
253
255
  Application: 'application',
254
256
  Prompt: 'prompt',
255
257
  Skill: 'skill',
258
+ Project: 'project',
256
259
  };
257
260
  /**
258
261
  * @export
@@ -263,4 +266,5 @@ exports.UnpublishCatalogEntityEntityTypeEnum = {
263
266
  Application: 'application',
264
267
  Prompt: 'prompt',
265
268
  Skill: 'skill',
269
+ Project: 'project',
266
270
  };