@exulu/backend 1.20.0 → 1.22.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/dist/index.d.cts CHANGED
@@ -43,7 +43,7 @@ interface Item {
43
43
  index: number;
44
44
  content: string;
45
45
  source: string;
46
- embedding: number;
46
+ embedding_size: number;
47
47
  createdAt: string;
48
48
  updatedAt: string;
49
49
  }[];
@@ -245,20 +245,21 @@ interface ExuluWorkflow {
245
245
  id: string;
246
246
  name: string;
247
247
  description?: string;
248
- rights_mode?: 'private' | 'users' | 'roles' | 'public';
249
- RBAC?: {
250
- users?: Array<{
251
- id: string;
252
- rights: 'read' | 'write';
253
- }>;
254
- roles?: Array<{
255
- id: string;
256
- rights: 'read' | 'write';
257
- }>;
258
- };
248
+ rights_mode?: ExuluRightsMode;
249
+ RBAC?: ExuluRBAC;
259
250
  variables?: WorkflowVariable[];
260
251
  steps_json?: WorkflowStep[];
261
252
  }
253
+ interface ExuluRBAC {
254
+ users?: Array<{
255
+ id: string;
256
+ rights: 'read' | 'write';
257
+ }>;
258
+ roles?: Array<{
259
+ id: string;
260
+ rights: 'read' | 'write';
261
+ }>;
262
+ }
262
263
  type ExuluEvalRunnerInstance = {
263
264
  name: string;
264
265
  description: string;
@@ -377,10 +378,6 @@ declare class ExuluContext {
377
378
  chunks?: number;
378
379
  job?: string;
379
380
  }>;
380
- updateItem(user: string, item: Item, role?: string, trigger?: STATISTICS_LABELS): Promise<{
381
- id: string;
382
- job?: string;
383
- }>;
384
381
  embeddings: {
385
382
  generate: {
386
383
  one: ({ item, user, role, trigger }: {
@@ -393,13 +390,12 @@ declare class ExuluContext {
393
390
  job?: string;
394
391
  chunks?: number;
395
392
  }>;
396
- all: (context: ExuluContext, userId?: string, roleId?: string) => Promise<string[]>;
393
+ all: (userId?: string, roleId?: string) => Promise<{
394
+ jobs: string[];
395
+ items: number;
396
+ }>;
397
397
  };
398
398
  };
399
- insertItem(user: string, item: Item, upsert?: boolean, role?: string, trigger?: STATISTICS_LABELS): Promise<{
400
- id: string;
401
- job?: string;
402
- }>;
403
399
  getItems: ({ statistics, limit, sort, order, page, name, user, role, archived, query, method }: {
404
400
  statistics?: ExuluStatisticParams;
405
401
  page: number;
@@ -511,7 +507,10 @@ declare class ExuluApp {
511
507
  }>;
512
508
  all: ({ context: contextId }: {
513
509
  context: string;
514
- }) => Promise<string[]>;
510
+ }) => Promise<{
511
+ jobs: string[];
512
+ items: number;
513
+ }>;
515
514
  };
516
515
  };
517
516
  bullmq: {
@@ -1441,7 +1440,9 @@ declare const ExuluOtel: {
1441
1440
  };
1442
1441
 
1443
1442
  declare const db: {
1444
- init: () => Promise<void>;
1443
+ init: ({ contexts }: {
1444
+ contexts: ExuluContext[];
1445
+ }) => Promise<void>;
1445
1446
  api: {
1446
1447
  key: {
1447
1448
  generate: (name: string, email: string) => Promise<{
package/dist/index.d.ts CHANGED
@@ -43,7 +43,7 @@ interface Item {
43
43
  index: number;
44
44
  content: string;
45
45
  source: string;
46
- embedding: number;
46
+ embedding_size: number;
47
47
  createdAt: string;
48
48
  updatedAt: string;
49
49
  }[];
@@ -245,20 +245,21 @@ interface ExuluWorkflow {
245
245
  id: string;
246
246
  name: string;
247
247
  description?: string;
248
- rights_mode?: 'private' | 'users' | 'roles' | 'public';
249
- RBAC?: {
250
- users?: Array<{
251
- id: string;
252
- rights: 'read' | 'write';
253
- }>;
254
- roles?: Array<{
255
- id: string;
256
- rights: 'read' | 'write';
257
- }>;
258
- };
248
+ rights_mode?: ExuluRightsMode;
249
+ RBAC?: ExuluRBAC;
259
250
  variables?: WorkflowVariable[];
260
251
  steps_json?: WorkflowStep[];
261
252
  }
253
+ interface ExuluRBAC {
254
+ users?: Array<{
255
+ id: string;
256
+ rights: 'read' | 'write';
257
+ }>;
258
+ roles?: Array<{
259
+ id: string;
260
+ rights: 'read' | 'write';
261
+ }>;
262
+ }
262
263
  type ExuluEvalRunnerInstance = {
263
264
  name: string;
264
265
  description: string;
@@ -377,10 +378,6 @@ declare class ExuluContext {
377
378
  chunks?: number;
378
379
  job?: string;
379
380
  }>;
380
- updateItem(user: string, item: Item, role?: string, trigger?: STATISTICS_LABELS): Promise<{
381
- id: string;
382
- job?: string;
383
- }>;
384
381
  embeddings: {
385
382
  generate: {
386
383
  one: ({ item, user, role, trigger }: {
@@ -393,13 +390,12 @@ declare class ExuluContext {
393
390
  job?: string;
394
391
  chunks?: number;
395
392
  }>;
396
- all: (context: ExuluContext, userId?: string, roleId?: string) => Promise<string[]>;
393
+ all: (userId?: string, roleId?: string) => Promise<{
394
+ jobs: string[];
395
+ items: number;
396
+ }>;
397
397
  };
398
398
  };
399
- insertItem(user: string, item: Item, upsert?: boolean, role?: string, trigger?: STATISTICS_LABELS): Promise<{
400
- id: string;
401
- job?: string;
402
- }>;
403
399
  getItems: ({ statistics, limit, sort, order, page, name, user, role, archived, query, method }: {
404
400
  statistics?: ExuluStatisticParams;
405
401
  page: number;
@@ -511,7 +507,10 @@ declare class ExuluApp {
511
507
  }>;
512
508
  all: ({ context: contextId }: {
513
509
  context: string;
514
- }) => Promise<string[]>;
510
+ }) => Promise<{
511
+ jobs: string[];
512
+ items: number;
513
+ }>;
515
514
  };
516
515
  };
517
516
  bullmq: {
@@ -1441,7 +1440,9 @@ declare const ExuluOtel: {
1441
1440
  };
1442
1441
 
1443
1442
  declare const db: {
1444
- init: () => Promise<void>;
1443
+ init: ({ contexts }: {
1444
+ contexts: ExuluContext[];
1445
+ }) => Promise<void>;
1445
1446
  api: {
1446
1447
  key: {
1447
1448
  generate: (name: string, email: string) => Promise<{