@superatomai/sdk-web 0.0.24 → 0.0.25

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/dist/index.cjs CHANGED
@@ -796,8 +796,14 @@ var ArtifactDataSchema = zod.z.object({
796
796
  createdAt: zod.z.string().optional(),
797
797
  updatedAt: zod.z.string().optional()
798
798
  });
799
+ var ArtifactsQueryFiltersSchema = zod.z.object({
800
+ createdBy: zod.z.number().optional(),
801
+ status: zod.z.string().optional(),
802
+ name: zod.z.string().optional(),
803
+ deleted: zod.z.boolean().optional()
804
+ });
799
805
  var ArtifactsRequestPayloadSchema = zod.z.object({
800
- operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne"]),
806
+ operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
801
807
  data: zod.z.object({
802
808
  id: zod.z.number().optional(),
803
809
  name: zod.z.string().optional(),
@@ -805,7 +811,10 @@ var ArtifactsRequestPayloadSchema = zod.z.object({
805
811
  dsl: zod.z.record(zod.z.string(), zod.z.any()).optional(),
806
812
  status: zod.z.string().optional(),
807
813
  deleted: zod.z.boolean().optional(),
808
- limit: zod.z.number().optional()
814
+ limit: zod.z.number().optional(),
815
+ // Query operation fields
816
+ filters: ArtifactsQueryFiltersSchema.optional(),
817
+ sort: zod.z.enum(["ASC", "DESC"]).optional()
809
818
  }).optional()
810
819
  });
811
820
  var ArtifactsRequestMessageSchema = zod.z.object({
@@ -1042,6 +1051,7 @@ __export(services_exports, {
1042
1051
  getRootMenus: () => getRootMenus,
1043
1052
  getUI: () => getUI,
1044
1053
  getUser: () => getUser,
1054
+ queryArtifacts: () => queryArtifacts,
1045
1055
  queryBookmarks: () => queryBookmarks,
1046
1056
  queryDashboards: () => queryDashboards,
1047
1057
  queryMenus: () => queryMenus,
@@ -2040,6 +2050,33 @@ async function getArtifact(client, id, timeout) {
2040
2050
  message: payload.message
2041
2051
  };
2042
2052
  }
2053
+ async function queryArtifacts(client, options = {}, timeout) {
2054
+ const { filters, limit, sort } = options;
2055
+ const messageId = `artifacts_query_${Date.now()}`;
2056
+ const message = ArtifactsRequestMessageSchema.parse({
2057
+ id: messageId,
2058
+ type: "ARTIFACTS",
2059
+ from: { type: client.type },
2060
+ to: { type: "data-agent" },
2061
+ payload: {
2062
+ operation: "query",
2063
+ data: {
2064
+ filters,
2065
+ limit,
2066
+ sort
2067
+ }
2068
+ }
2069
+ });
2070
+ const response = await client.sendWithResponse(message, timeout);
2071
+ const payload = response.payload;
2072
+ return {
2073
+ success: payload.success,
2074
+ error: payload.error,
2075
+ data: Array.isArray(payload.data) ? payload.data : payload.data ? [payload.data] : [],
2076
+ count: payload.count,
2077
+ message: payload.message
2078
+ };
2079
+ }
2043
2080
 
2044
2081
  // src/services/actions.ts
2045
2082
  async function getActions(client, options) {
@@ -3333,6 +3370,14 @@ var SuperatomClient = class {
3333
3370
  this.log("info", "Fetching artifact:", id);
3334
3371
  return getArtifact(this, id, timeout);
3335
3372
  }
3373
+ /**
3374
+ * Query artifacts with filters
3375
+ * Delegates to artifacts service
3376
+ */
3377
+ async queryArtifacts(options = {}, timeout) {
3378
+ this.log("info", "Querying artifacts with filters:", JSON.stringify(options.filters));
3379
+ return queryArtifacts(this, options, timeout);
3380
+ }
3336
3381
  // ==================== Report Management Methods ====================
3337
3382
  // These methods delegate to report service for admin report CRUD operations
3338
3383
  /**