geniebox-shared-lib 1.0.72 → 1.0.74

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.
@@ -1,5 +1,5 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- import type { handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
2
+ import type { handleServerStreamingCall, handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
3
3
  import { Observable } from "rxjs";
4
4
  export declare const protobufPackage = "ai";
5
5
  export interface AICallResponse {
@@ -8,6 +8,11 @@ export interface AICallResponse {
8
8
  export interface AIStatusResponse {
9
9
  requestId: string;
10
10
  status: string;
11
+ logs?: Array<{
12
+ message: string;
13
+ level?: 'info' | 'warn' | 'error';
14
+ timestamp?: string;
15
+ }>;
11
16
  }
12
17
  export interface AIResultResponse {
13
18
  requestId: string;
@@ -33,6 +38,18 @@ export interface AICancelRequest {
33
38
  endpoint: string;
34
39
  uuid: string;
35
40
  }
41
+ export interface AIStreamRequest {
42
+ endpoint: string;
43
+ payload: string;
44
+ }
45
+ export interface AIStreamResponse {
46
+ requestId: string;
47
+ /** "start", "data", "log", "done", "error" */
48
+ type: string;
49
+ data: string;
50
+ chunk: number;
51
+ timestamp: string;
52
+ }
36
53
  export declare const AI_PACKAGE_NAME = "ai";
37
54
  export declare const AICallResponse: MessageFns<AICallResponse>;
38
55
  export declare const AIStatusResponse: MessageFns<AIStatusResponse>;
@@ -42,17 +59,21 @@ export declare const AICallRequest: MessageFns<AICallRequest>;
42
59
  export declare const AIStatusRequest: MessageFns<AIStatusRequest>;
43
60
  export declare const AIResultRequest: MessageFns<AIResultRequest>;
44
61
  export declare const AICancelRequest: MessageFns<AICancelRequest>;
62
+ export declare const AIStreamRequest: MessageFns<AIStreamRequest>;
63
+ export declare const AIStreamResponse: MessageFns<AIStreamResponse>;
45
64
  export interface AIServiceClient {
46
65
  call(request: AICallRequest, metadata?: Metadata): Observable<AICallResponse>;
47
66
  status(request: AIStatusRequest, metadata?: Metadata): Observable<AIStatusResponse>;
48
67
  result(request: AIResultRequest, metadata?: Metadata): Observable<AIResultResponse>;
49
68
  cancel(request: AICancelRequest, metadata?: Metadata): Observable<AICancelResponse>;
69
+ stream(request: AIStreamRequest, metadata?: Metadata): Observable<AIStreamResponse>;
50
70
  }
51
71
  export interface AIServiceController {
52
72
  call(request: AICallRequest, metadata?: Metadata): Promise<AICallResponse> | Observable<AICallResponse> | AICallResponse;
53
73
  status(request: AIStatusRequest, metadata?: Metadata): Promise<AIStatusResponse> | Observable<AIStatusResponse> | AIStatusResponse;
54
74
  result(request: AIResultRequest, metadata?: Metadata): Promise<AIResultResponse> | Observable<AIResultResponse> | AIResultResponse;
55
75
  cancel(request: AICancelRequest, metadata?: Metadata): Promise<AICancelResponse> | Observable<AICancelResponse> | AICancelResponse;
76
+ stream(request: AIStreamRequest, metadata?: Metadata): Observable<AIStreamResponse>;
56
77
  }
57
78
  export declare function AIServiceControllerMethods(): (constructor: Function) => void;
58
79
  export declare const AI_SERVICE_NAME = "AIService";
@@ -94,12 +115,22 @@ export declare const AIServiceService: {
94
115
  readonly responseSerialize: (value: AICancelResponse) => Buffer;
95
116
  readonly responseDeserialize: (value: Buffer) => AICancelResponse;
96
117
  };
118
+ readonly stream: {
119
+ readonly path: "/ai.AIService/stream";
120
+ readonly requestStream: false;
121
+ readonly responseStream: true;
122
+ readonly requestSerialize: (value: AIStreamRequest) => Buffer;
123
+ readonly requestDeserialize: (value: Buffer) => AIStreamRequest;
124
+ readonly responseSerialize: (value: AIStreamResponse) => Buffer;
125
+ readonly responseDeserialize: (value: Buffer) => AIStreamResponse;
126
+ };
97
127
  };
98
128
  export interface AIServiceServer extends UntypedServiceImplementation {
99
129
  call: handleUnaryCall<AICallRequest, AICallResponse>;
100
130
  status: handleUnaryCall<AIStatusRequest, AIStatusResponse>;
101
131
  result: handleUnaryCall<AIResultRequest, AIResultResponse>;
102
132
  cancel: handleUnaryCall<AICancelRequest, AICancelResponse>;
133
+ stream: handleServerStreamingCall<AIStreamRequest, AIStreamResponse>;
103
134
  }
104
135
  export interface MessageFns<T> {
105
136
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
@@ -5,7 +5,7 @@
5
5
  // protoc v5.28.2
6
6
  // source: ai.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AIServiceService = exports.AI_SERVICE_NAME = exports.AICancelRequest = exports.AIResultRequest = exports.AIStatusRequest = exports.AICallRequest = exports.AICancelResponse = exports.AIResultResponse = exports.AIStatusResponse = exports.AICallResponse = exports.AI_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.AIServiceService = exports.AI_SERVICE_NAME = exports.AIStreamResponse = exports.AIStreamRequest = exports.AICancelRequest = exports.AIResultRequest = exports.AIStatusRequest = exports.AICallRequest = exports.AICancelResponse = exports.AIResultResponse = exports.AIStatusResponse = exports.AICallResponse = exports.AI_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.AIServiceControllerMethods = AIServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const wire_1 = require("@bufbuild/protobuf/wire");
@@ -346,9 +346,125 @@ exports.AICancelRequest = {
346
346
  return message;
347
347
  },
348
348
  };
349
+ function createBaseAIStreamRequest() {
350
+ return { endpoint: "", payload: "" };
351
+ }
352
+ exports.AIStreamRequest = {
353
+ encode(message, writer = new wire_1.BinaryWriter()) {
354
+ if (message.endpoint !== "") {
355
+ writer.uint32(10).string(message.endpoint);
356
+ }
357
+ if (message.payload !== "") {
358
+ writer.uint32(18).string(message.payload);
359
+ }
360
+ return writer;
361
+ },
362
+ decode(input, length) {
363
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
364
+ const end = length === undefined ? reader.len : reader.pos + length;
365
+ const message = createBaseAIStreamRequest();
366
+ while (reader.pos < end) {
367
+ const tag = reader.uint32();
368
+ switch (tag >>> 3) {
369
+ case 1: {
370
+ if (tag !== 10) {
371
+ break;
372
+ }
373
+ message.endpoint = reader.string();
374
+ continue;
375
+ }
376
+ case 2: {
377
+ if (tag !== 18) {
378
+ break;
379
+ }
380
+ message.payload = reader.string();
381
+ continue;
382
+ }
383
+ }
384
+ if ((tag & 7) === 4 || tag === 0) {
385
+ break;
386
+ }
387
+ reader.skip(tag & 7);
388
+ }
389
+ return message;
390
+ },
391
+ };
392
+ function createBaseAIStreamResponse() {
393
+ return { requestId: "", type: "", data: "", chunk: 0, timestamp: "" };
394
+ }
395
+ exports.AIStreamResponse = {
396
+ encode(message, writer = new wire_1.BinaryWriter()) {
397
+ if (message.requestId !== "") {
398
+ writer.uint32(10).string(message.requestId);
399
+ }
400
+ if (message.type !== "") {
401
+ writer.uint32(18).string(message.type);
402
+ }
403
+ if (message.data !== "") {
404
+ writer.uint32(26).string(message.data);
405
+ }
406
+ if (message.chunk !== 0) {
407
+ writer.uint32(32).int32(message.chunk);
408
+ }
409
+ if (message.timestamp !== "") {
410
+ writer.uint32(42).string(message.timestamp);
411
+ }
412
+ return writer;
413
+ },
414
+ decode(input, length) {
415
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
416
+ const end = length === undefined ? reader.len : reader.pos + length;
417
+ const message = createBaseAIStreamResponse();
418
+ while (reader.pos < end) {
419
+ const tag = reader.uint32();
420
+ switch (tag >>> 3) {
421
+ case 1: {
422
+ if (tag !== 10) {
423
+ break;
424
+ }
425
+ message.requestId = reader.string();
426
+ continue;
427
+ }
428
+ case 2: {
429
+ if (tag !== 18) {
430
+ break;
431
+ }
432
+ message.type = reader.string();
433
+ continue;
434
+ }
435
+ case 3: {
436
+ if (tag !== 26) {
437
+ break;
438
+ }
439
+ message.data = reader.string();
440
+ continue;
441
+ }
442
+ case 4: {
443
+ if (tag !== 32) {
444
+ break;
445
+ }
446
+ message.chunk = reader.int32();
447
+ continue;
448
+ }
449
+ case 5: {
450
+ if (tag !== 42) {
451
+ break;
452
+ }
453
+ message.timestamp = reader.string();
454
+ continue;
455
+ }
456
+ }
457
+ if ((tag & 7) === 4 || tag === 0) {
458
+ break;
459
+ }
460
+ reader.skip(tag & 7);
461
+ }
462
+ return message;
463
+ },
464
+ };
349
465
  function AIServiceControllerMethods() {
350
466
  return function (constructor) {
351
- const grpcMethods = ["call", "status", "result", "cancel"];
467
+ const grpcMethods = ["call", "status", "result", "cancel", "stream"];
352
468
  for (const method of grpcMethods) {
353
469
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
354
470
  (0, microservices_1.GrpcMethod)("AIService", method)(constructor.prototype[method], method, descriptor);
@@ -398,4 +514,13 @@ exports.AIServiceService = {
398
514
  responseSerialize: (value) => Buffer.from(exports.AICancelResponse.encode(value).finish()),
399
515
  responseDeserialize: (value) => exports.AICancelResponse.decode(value),
400
516
  },
517
+ stream: {
518
+ path: "/ai.AIService/stream",
519
+ requestStream: false,
520
+ responseStream: true,
521
+ requestSerialize: (value) => Buffer.from(exports.AIStreamRequest.encode(value).finish()),
522
+ requestDeserialize: (value) => exports.AIStreamRequest.decode(value),
523
+ responseSerialize: (value) => Buffer.from(exports.AIStreamResponse.encode(value).finish()),
524
+ responseDeserialize: (value) => exports.AIStreamResponse.decode(value),
525
+ },
401
526
  };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { EventClient } from "./event/event.client";
8
8
  export { KeyClient } from "./key/key.client";
9
9
  export { MessageFns as UserMessageFns, protobufPackage as UserProtobufPackage, User, CreateUserRequest, CreateUserPersonal, UpdateUserRequest, GetByIdRequest, UserResponse, UsersResponse, FindByEmailRequest, FindByPhoneRequest, UpdateUserPersonal, UpdatePasswordRequest, UpdateEmailVerificationRequest, ResetPasswordData, GetEmailVerificationStatusRequest, EmailVerificationStatusResponse, UserServiceService as UserService, } from "./user/user.interface";
10
10
  export { MessageFns as AuthMessageFns, protobufPackage as AuthProtobufPackage, LoginCredentials, RegisterCredentials, LogoutRequest, RefreshRequest, AuthResponse, RefreshTokenResponse, RecoverRequest, ResetPasswordRequest, ConfirmEmailRequest, ConfirmEmailByCodeRequest, ConfirmEmailResponse, CheckEmailVerifiedRequest, CheckEmailVerifiedResponse, ResendConfirmationCodeRequest, } from "./auth/auth.interface";
11
- export { MessageFns as AIMessageFns, protobufPackage as AIProtobufPackage, AICallRequest, AICallResponse, AIStatusRequest, AIStatusResponse, AIResultRequest, AIResultResponse, AICancelRequest, AICancelResponse, AIServiceService as AIService, } from "./ai/ai.interface";
11
+ export { MessageFns as AIMessageFns, protobufPackage as AIProtobufPackage, AICallRequest, AICallResponse, AIStatusRequest, AIStatusResponse, AIResultRequest, AIResultResponse, AICancelRequest, AICancelResponse, AIStreamRequest, AIStreamResponse, AIServiceService as AIService, } from "./ai/ai.interface";
12
12
  export { MessageFns as OpenAIMessageFns, protobufPackage as OpenAIProtobufPackage, CreateRequest as OpenAICreateRequest, CreateResponse as OpenAICreateResponse, OpenAIServiceService as OpenAIService, } from "./openai/openai.interface";
13
13
  export { UploadRequest, UploadResponse, DownloadRequest, DownloadResponse, DeleteRequest, DeleteResponse, FileServiceService as FileService, protobufPackage as FileProtobufPackage, } from "./file/file.interface";
14
14
  export { MessageFns as EventMessageFns, protobufPackage as EventProtobufPackage, SubscribeRequest, EventMessage, EventServiceService as EventService, } from "./event/event.interface";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AIService = exports.AICancelResponse = exports.AICancelRequest = exports.AIResultResponse = exports.AIResultRequest = exports.AIStatusResponse = exports.AIStatusRequest = exports.AICallResponse = exports.AICallRequest = exports.AIProtobufPackage = exports.ResendConfirmationCodeRequest = exports.CheckEmailVerifiedResponse = exports.CheckEmailVerifiedRequest = exports.ConfirmEmailResponse = exports.ConfirmEmailByCodeRequest = exports.ConfirmEmailRequest = exports.ResetPasswordRequest = exports.RecoverRequest = exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.EmailVerificationStatusResponse = exports.GetEmailVerificationStatusRequest = exports.ResetPasswordData = exports.UpdateEmailVerificationRequest = exports.UpdatePasswordRequest = exports.UpdateUserPersonal = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.UsersResponse = exports.UserResponse = exports.GetByIdRequest = exports.UpdateUserRequest = exports.CreateUserPersonal = exports.CreateUserRequest = exports.User = exports.UserProtobufPackage = exports.KeyClient = exports.EventClient = exports.FileClient = exports.OpenAIClient = exports.AIClient = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
4
- exports.KeyService = exports.GetKeysByUserRequest = exports.KeysResponse = exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.FileProtobufPackage = exports.FileService = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = exports.DownloadRequest = exports.UploadResponse = exports.UploadRequest = exports.OpenAIService = exports.OpenAICreateResponse = exports.OpenAICreateRequest = exports.OpenAIProtobufPackage = void 0;
3
+ exports.AIStreamRequest = exports.AICancelResponse = exports.AICancelRequest = exports.AIResultResponse = exports.AIResultRequest = exports.AIStatusResponse = exports.AIStatusRequest = exports.AICallResponse = exports.AICallRequest = exports.AIProtobufPackage = exports.ResendConfirmationCodeRequest = exports.CheckEmailVerifiedResponse = exports.CheckEmailVerifiedRequest = exports.ConfirmEmailResponse = exports.ConfirmEmailByCodeRequest = exports.ConfirmEmailRequest = exports.ResetPasswordRequest = exports.RecoverRequest = exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.EmailVerificationStatusResponse = exports.GetEmailVerificationStatusRequest = exports.ResetPasswordData = exports.UpdateEmailVerificationRequest = exports.UpdatePasswordRequest = exports.UpdateUserPersonal = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.UsersResponse = exports.UserResponse = exports.GetByIdRequest = exports.UpdateUserRequest = exports.CreateUserPersonal = exports.CreateUserRequest = exports.User = exports.UserProtobufPackage = exports.KeyClient = exports.EventClient = exports.FileClient = exports.OpenAIClient = exports.AIClient = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
4
+ exports.KeyService = exports.GetKeysByUserRequest = exports.KeysResponse = exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.FileProtobufPackage = exports.FileService = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = exports.DownloadRequest = exports.UploadResponse = exports.UploadRequest = exports.OpenAIService = exports.OpenAICreateResponse = exports.OpenAICreateRequest = exports.OpenAIProtobufPackage = exports.AIService = exports.AIStreamResponse = void 0;
5
5
  var shared_module_1 = require("./shared.module");
6
6
  Object.defineProperty(exports, "SharedModule", { enumerable: true, get: function () { return shared_module_1.SharedModule; } });
7
7
  var user_client_1 = require("./user/user.client");
@@ -71,6 +71,8 @@ Object.defineProperty(exports, "AIResultRequest", { enumerable: true, get: funct
71
71
  Object.defineProperty(exports, "AIResultResponse", { enumerable: true, get: function () { return ai_interface_1.AIResultResponse; } });
72
72
  Object.defineProperty(exports, "AICancelRequest", { enumerable: true, get: function () { return ai_interface_1.AICancelRequest; } });
73
73
  Object.defineProperty(exports, "AICancelResponse", { enumerable: true, get: function () { return ai_interface_1.AICancelResponse; } });
74
+ Object.defineProperty(exports, "AIStreamRequest", { enumerable: true, get: function () { return ai_interface_1.AIStreamRequest; } });
75
+ Object.defineProperty(exports, "AIStreamResponse", { enumerable: true, get: function () { return ai_interface_1.AIStreamResponse; } });
74
76
  Object.defineProperty(exports, "AIService", { enumerable: true, get: function () { return ai_interface_1.AIServiceService; } });
75
77
  // ============================
76
78
  // OpenAI exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geniebox-shared-lib",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "Shared NestJS library with gRPC clients",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",