@bluecopa/core 0.1.22 → 0.1.23

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.
@@ -0,0 +1,23 @@
1
+ export interface User {
2
+ id?: string;
3
+ email?: string;
4
+ firstName?: string;
5
+ lastName?: string;
6
+ externalId?: string;
7
+ active?: boolean;
8
+ organizationId?: string;
9
+ metadata?: Record<string, any>;
10
+ organizationExternalId?: string;
11
+ createdBy?: string;
12
+ createdDate?: string;
13
+ lastModifiedBy?: string;
14
+ lastModifiedDate?: string;
15
+ entityVersion?: number;
16
+ _links?: Record<string, any>;
17
+ }
18
+ /**
19
+ * Gets all users in the current workspace
20
+ * @returns Promise<User[]> The list of users
21
+ * @throws Error if the request fails
22
+ */
23
+ export declare function getAllUsers(): Promise<User[]>;
@@ -1 +1,2 @@
1
1
  export { getLoggedInUserDetails, type UserDetails } from './getLoggedInUserDetails';
2
+ export { getAllUsers, type User } from './getAllUsers';
@@ -0,0 +1,21 @@
1
+ export interface HttpTrigger {
2
+ id?: string;
3
+ name?: string;
4
+ description?: string;
5
+ url?: string;
6
+ active?: boolean;
7
+ metadata?: Record<string, any>;
8
+ schema?: Record<string, any>;
9
+ createdBy?: string;
10
+ createdDate?: string;
11
+ lastModifiedBy?: string;
12
+ lastModifiedDate?: string;
13
+ entityVersion?: number;
14
+ _links?: Record<string, any>;
15
+ }
16
+ /**
17
+ * Gets all HTTP triggers (webhooks) in the current workspace
18
+ * @returns Promise<HttpTrigger[]> The list of HTTP triggers
19
+ * @throws Error if the request fails
20
+ */
21
+ export declare function getAllHttpTriggers(): Promise<HttpTrigger[]>;
@@ -1,3 +1,4 @@
1
1
  export * from './triggerHttpWorkflowById';
2
2
  export * from './triggerWorkflowById';
3
3
  export * from './getWorkflowInstanceStatusById';
4
+ export * from './getAllHttpTriggers';
package/dist/index.d.ts CHANGED
@@ -16,3 +16,5 @@ export type { ReassignTaskRequest, ReassignTaskResponse } from './api/process/re
16
16
  export type { FileUploadRequest, FileUploadResponse } from './api/file/fileUpload';
17
17
  export type { FileDownloadRequest } from './api/file/fileDownload';
18
18
  export type { GetFileUrlRequest, GetFileUrlResponse } from './api/file/getFileUrlByFileId';
19
+ export type { User } from './api/user/getAllUsers';
20
+ export type { HttpTrigger } from './api/workflow/getAllHttpTriggers';
package/dist/index.es.js CHANGED
@@ -100,8 +100,23 @@ async function getLoggedInUserDetails() {
100
100
  throw { message, status };
101
101
  }
102
102
  }
103
+ async function getAllUsers() {
104
+ var _a, _b, _c;
105
+ try {
106
+ const response = await apiClient.get("/user/get-all");
107
+ if (!response.data) {
108
+ throw { message: "Failed to fetch users", status: 500 };
109
+ }
110
+ return response.data;
111
+ } catch (error) {
112
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching users";
113
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
114
+ throw { message, status };
115
+ }
116
+ }
103
117
  const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
104
118
  __proto__: null,
119
+ getAllUsers,
105
120
  getLoggedInUserDetails
106
121
  }, Symbol.toStringTag, { value: "Module" }));
107
122
  async function triggerHttpWorkflowById({
@@ -159,9 +174,24 @@ const getWorkflowInstanceStatusById = async (request) => {
159
174
  throw { message, status };
160
175
  }
161
176
  };
177
+ async function getAllHttpTriggers() {
178
+ var _a, _b, _c;
179
+ try {
180
+ const response = await apiClient.get("/http-trigger/get-all");
181
+ if (!response.data) {
182
+ throw { message: "Failed to fetch HTTP triggers", status: 500 };
183
+ }
184
+ return response.data;
185
+ } catch (error) {
186
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching HTTP triggers";
187
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
188
+ throw { message, status };
189
+ }
190
+ }
162
191
  const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
163
192
  __proto__: null,
164
193
  WorkflowStatus,
194
+ getAllHttpTriggers,
165
195
  getWorkflowInstanceStatusById,
166
196
  triggerHttpWorkflowById,
167
197
  triggerWorkflowById