@conduitplatform/grpc-sdk 0.16.24 → 0.16.26

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.esm.js CHANGED
@@ -3395,7 +3395,7 @@ const CreateRoomRequest = {
3395
3395
  },
3396
3396
  };
3397
3397
  function createBaseSendMessageRequest() {
3398
- return { message: "", userId: "", roomId: "", messageType: undefined };
3398
+ return { message: "", userId: "", roomId: "", messageType: undefined, persist: undefined };
3399
3399
  }
3400
3400
  const SendMessageRequest = {
3401
3401
  encode(message, writer = _m0.Writer.create()) {
@@ -3411,6 +3411,9 @@ const SendMessageRequest = {
3411
3411
  if (message.messageType !== undefined) {
3412
3412
  writer.uint32(34).string(message.messageType);
3413
3413
  }
3414
+ if (message.persist !== undefined) {
3415
+ writer.uint32(40).bool(message.persist);
3416
+ }
3414
3417
  return writer;
3415
3418
  },
3416
3419
  decode(input, length) {
@@ -3444,6 +3447,12 @@ const SendMessageRequest = {
3444
3447
  }
3445
3448
  message.messageType = reader.string();
3446
3449
  continue;
3450
+ case 5:
3451
+ if (tag !== 40) {
3452
+ break;
3453
+ }
3454
+ message.persist = reader.bool();
3455
+ continue;
3447
3456
  }
3448
3457
  if ((tag & 7) === 4 || tag === 0) {
3449
3458
  break;
@@ -3458,6 +3467,7 @@ const SendMessageRequest = {
3458
3467
  userId: isSet$9(object.userId) ? globalThis.String(object.userId) : "",
3459
3468
  roomId: isSet$9(object.roomId) ? globalThis.String(object.roomId) : "",
3460
3469
  messageType: isSet$9(object.messageType) ? globalThis.String(object.messageType) : undefined,
3470
+ persist: isSet$9(object.persist) ? globalThis.Boolean(object.persist) : undefined,
3461
3471
  };
3462
3472
  },
3463
3473
  toJSON(message) {
@@ -3474,6 +3484,9 @@ const SendMessageRequest = {
3474
3484
  if (message.messageType !== undefined) {
3475
3485
  obj.messageType = message.messageType;
3476
3486
  }
3487
+ if (message.persist !== undefined) {
3488
+ obj.persist = message.persist;
3489
+ }
3477
3490
  return obj;
3478
3491
  },
3479
3492
  create(base) {
@@ -3485,6 +3498,7 @@ const SendMessageRequest = {
3485
3498
  message.userId = object.userId ?? "";
3486
3499
  message.roomId = object.roomId ?? "";
3487
3500
  message.messageType = object.messageType ?? undefined;
3501
+ message.persist = object.persist ?? undefined;
3488
3502
  return message;
3489
3503
  },
3490
3504
  };
@@ -7780,6 +7794,14 @@ const DatabaseProviderDefinition = {
7780
7794
  responseStream: false,
7781
7795
  options: {},
7782
7796
  },
7797
+ generateId: {
7798
+ name: "GenerateId",
7799
+ requestType: Empty,
7800
+ requestStream: false,
7801
+ responseType: GetDatabaseTypeResponse,
7802
+ responseStream: false,
7803
+ options: {},
7804
+ },
7783
7805
  /** Database queries */
7784
7806
  findOne: {
7785
7807
  name: "findOne",
@@ -8217,6 +8239,114 @@ const RegisterTemplateResponse = {
8217
8239
  return message;
8218
8240
  },
8219
8241
  };
8242
+ function createBaseAttachment() {
8243
+ return { filename: "", contentType: undefined, content: undefined, href: undefined, httpHeaders: undefined };
8244
+ }
8245
+ const Attachment = {
8246
+ encode(message, writer = _m0.Writer.create()) {
8247
+ if (message.filename !== "") {
8248
+ writer.uint32(10).string(message.filename);
8249
+ }
8250
+ if (message.contentType !== undefined) {
8251
+ writer.uint32(18).string(message.contentType);
8252
+ }
8253
+ if (message.content !== undefined) {
8254
+ writer.uint32(26).bytes(message.content);
8255
+ }
8256
+ if (message.href !== undefined) {
8257
+ writer.uint32(34).string(message.href);
8258
+ }
8259
+ if (message.httpHeaders !== undefined) {
8260
+ writer.uint32(42).string(message.httpHeaders);
8261
+ }
8262
+ return writer;
8263
+ },
8264
+ decode(input, length) {
8265
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
8266
+ let end = length === undefined ? reader.len : reader.pos + length;
8267
+ const message = createBaseAttachment();
8268
+ while (reader.pos < end) {
8269
+ const tag = reader.uint32();
8270
+ switch (tag >>> 3) {
8271
+ case 1:
8272
+ if (tag !== 10) {
8273
+ break;
8274
+ }
8275
+ message.filename = reader.string();
8276
+ continue;
8277
+ case 2:
8278
+ if (tag !== 18) {
8279
+ break;
8280
+ }
8281
+ message.contentType = reader.string();
8282
+ continue;
8283
+ case 3:
8284
+ if (tag !== 26) {
8285
+ break;
8286
+ }
8287
+ message.content = reader.bytes();
8288
+ continue;
8289
+ case 4:
8290
+ if (tag !== 34) {
8291
+ break;
8292
+ }
8293
+ message.href = reader.string();
8294
+ continue;
8295
+ case 5:
8296
+ if (tag !== 42) {
8297
+ break;
8298
+ }
8299
+ message.httpHeaders = reader.string();
8300
+ continue;
8301
+ }
8302
+ if ((tag & 7) === 4 || tag === 0) {
8303
+ break;
8304
+ }
8305
+ reader.skipType(tag & 7);
8306
+ }
8307
+ return message;
8308
+ },
8309
+ fromJSON(object) {
8310
+ return {
8311
+ filename: isSet$6(object.filename) ? globalThis.String(object.filename) : "",
8312
+ contentType: isSet$6(object.contentType) ? globalThis.String(object.contentType) : undefined,
8313
+ content: isSet$6(object.content) ? bytesFromBase64(object.content) : undefined,
8314
+ href: isSet$6(object.href) ? globalThis.String(object.href) : undefined,
8315
+ httpHeaders: isSet$6(object.httpHeaders) ? globalThis.String(object.httpHeaders) : undefined,
8316
+ };
8317
+ },
8318
+ toJSON(message) {
8319
+ const obj = {};
8320
+ if (message.filename !== "") {
8321
+ obj.filename = message.filename;
8322
+ }
8323
+ if (message.contentType !== undefined) {
8324
+ obj.contentType = message.contentType;
8325
+ }
8326
+ if (message.content !== undefined) {
8327
+ obj.content = base64FromBytes(message.content);
8328
+ }
8329
+ if (message.href !== undefined) {
8330
+ obj.href = message.href;
8331
+ }
8332
+ if (message.httpHeaders !== undefined) {
8333
+ obj.httpHeaders = message.httpHeaders;
8334
+ }
8335
+ return obj;
8336
+ },
8337
+ create(base) {
8338
+ return Attachment.fromPartial(base ?? {});
8339
+ },
8340
+ fromPartial(object) {
8341
+ const message = createBaseAttachment();
8342
+ message.filename = object.filename ?? "";
8343
+ message.contentType = object.contentType ?? undefined;
8344
+ message.content = object.content ?? undefined;
8345
+ message.href = object.href ?? undefined;
8346
+ message.httpHeaders = object.httpHeaders ?? undefined;
8347
+ return message;
8348
+ },
8349
+ };
8220
8350
  function createBaseSendEmailRequest() {
8221
8351
  return { templateName: "", params: undefined };
8222
8352
  }
@@ -8321,7 +8451,7 @@ const SendEmailRequest_SendEmailParams = {
8321
8451
  writer.uint32(42).string(message.replyTo);
8322
8452
  }
8323
8453
  for (const v of message.attachments) {
8324
- writer.uint32(50).string(v);
8454
+ Attachment.encode(v, writer.uint32(50).fork()).ldelim();
8325
8455
  }
8326
8456
  return writer;
8327
8457
  },
@@ -8378,7 +8508,7 @@ const SendEmailRequest_SendEmailParams = {
8378
8508
  if (tag !== 50) {
8379
8509
  break;
8380
8510
  }
8381
- message.attachments.push(reader.string());
8511
+ message.attachments.push(Attachment.decode(reader, reader.uint32()));
8382
8512
  continue;
8383
8513
  }
8384
8514
  if ((tag & 7) === 4 || tag === 0) {
@@ -8398,7 +8528,7 @@ const SendEmailRequest_SendEmailParams = {
8398
8528
  cc: globalThis.Array.isArray(object?.cc) ? object.cc.map((e) => globalThis.String(e)) : [],
8399
8529
  replyTo: isSet$6(object.replyTo) ? globalThis.String(object.replyTo) : undefined,
8400
8530
  attachments: globalThis.Array.isArray(object?.attachments)
8401
- ? object.attachments.map((e) => globalThis.String(e))
8531
+ ? object.attachments.map((e) => Attachment.fromJSON(e))
8402
8532
  : [],
8403
8533
  };
8404
8534
  },
@@ -8426,7 +8556,7 @@ const SendEmailRequest_SendEmailParams = {
8426
8556
  obj.replyTo = message.replyTo;
8427
8557
  }
8428
8558
  if (message.attachments?.length) {
8429
- obj.attachments = message.attachments;
8559
+ obj.attachments = message.attachments.map((e) => Attachment.toJSON(e));
8430
8560
  }
8431
8561
  return obj;
8432
8562
  },
@@ -8442,7 +8572,7 @@ const SendEmailRequest_SendEmailParams = {
8442
8572
  message.sender = object.sender ?? undefined;
8443
8573
  message.cc = object.cc?.map((e) => e) || [];
8444
8574
  message.replyTo = object.replyTo ?? undefined;
8445
- message.attachments = object.attachments?.map((e) => e) || [];
8575
+ message.attachments = object.attachments?.map((e) => Attachment.fromPartial(e)) || [];
8446
8576
  return message;
8447
8577
  },
8448
8578
  };
@@ -8742,6 +8872,31 @@ const EmailDefinition = {
8742
8872
  },
8743
8873
  },
8744
8874
  };
8875
+ function bytesFromBase64(b64) {
8876
+ if (globalThis.Buffer) {
8877
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
8878
+ }
8879
+ else {
8880
+ const bin = globalThis.atob(b64);
8881
+ const arr = new Uint8Array(bin.length);
8882
+ for (let i = 0; i < bin.length; ++i) {
8883
+ arr[i] = bin.charCodeAt(i);
8884
+ }
8885
+ return arr;
8886
+ }
8887
+ }
8888
+ function base64FromBytes(arr) {
8889
+ if (globalThis.Buffer) {
8890
+ return globalThis.Buffer.from(arr).toString("base64");
8891
+ }
8892
+ else {
8893
+ const bin = [];
8894
+ arr.forEach((byte) => {
8895
+ bin.push(globalThis.String.fromCharCode(byte));
8896
+ });
8897
+ return globalThis.btoa(bin.join(""));
8898
+ }
8899
+ }
8745
8900
  function isSet$6(value) {
8746
8901
  return value !== null && value !== undefined;
8747
8902
  }
@@ -13496,7 +13651,13 @@ class Email extends ConduitModule {
13496
13651
  sender: params.sender,
13497
13652
  replyTo: params.replyTo,
13498
13653
  cc: params.cc ?? [],
13499
- attachments: params.attachments ?? [],
13654
+ attachments: params.attachments?.map(attachment => ({
13655
+ ...attachment,
13656
+ content: attachment.content ? new Uint8Array(attachment.content) : undefined,
13657
+ httpHeaders: attachment.httpHeaders
13658
+ ? JSON.stringify(attachment.httpHeaders)
13659
+ : undefined,
13660
+ })) ?? [],
13500
13661
  },
13501
13662
  }).then(res => {
13502
13663
  return res.sentMessageInfo;
@@ -13805,6 +13966,9 @@ class DatabaseProvider extends ConduitModule {
13805
13966
  getDatabaseType() {
13806
13967
  return this.client.getDatabaseType({});
13807
13968
  }
13969
+ generateId() {
13970
+ return this.client.generateId({}).then(res => res.result);
13971
+ }
13808
13972
  constructSortObj(sort) {
13809
13973
  const sortObj = {};
13810
13974
  sort.forEach((sortVal) => {
@@ -15028,5 +15192,5 @@ class ConduitGrpcSdk {
15028
15192
  }
15029
15193
  }
15030
15194
 
15031
- export { Admin, AdminDefinition, AdminRouterDefinition, AllowedResourcesRequest, AllowedResourcesResponse, AnonymousUserCreateRequest, Authentication, AuthenticationDefinition, Authorization, AuthorizationDefinition, Chat, ChatDefinition, ClientRouterDefinition, ColumnExistenceRequest, ColumnExistenceResponse, ConduitAuthorizedResource, ConduitError, ConduitGrpcSdk, ConduitModelOptionsPermModifyType, ConduitModule, ConduitModuleDefinition, ConduitRouteActions, ConduitRouteReturnDefinition, ConduitSchema, Config, ConfigDefinition, Cookie, CookieOptions, Core, CoreDefinition, CreateFileByUrlRequest, CreateFileRequest, CreateRelationsRequest, CreateRoomRequest, CreateSchemaRequest, CreateTeamRequest, CreateViewRequest, CreateViewRequest_RawQuery, DatabaseProvider, DatabaseProviderDefinition, Decision, DeleteAllRelationsRequest, DeleteFileResponse, DeleteResourceRequest, DeleteRoomRequest, DeleteViewRequest, DropCollectionRequest, DropCollectionResponse, Email, EmailDefinition, EventBus, FileByUrlResponse, FileResponse, FindOneRequest, FindRelationRequest, FindRelationResponse, FindRequest, FindRequest_SortEntry, GetConfigRequest, GetConfigResponse, GetDatabaseTypeResponse, GetEmailStatusRequest, GetEmailStatusResponse, GetFileDataResponse, GetFileRequest, GetFileUrlRequest, GetFileUrlResponse, GetNotificationTokensRequest, GetNotificationTokensResponse, GetRedisDetailsResponse, GetRoomResponse, GetSchemaRequest, GetSchemasRequest, GetSchemasResponse, GetTeamRequest, GrpcError, HealthCheckRequest, HealthCheckResponse, HealthCheckResponse_ServingStatus, HealthCheckStatus, HealthDefinition, InvitationDeleteRequest, InvitationDeleteResponse, InviteUserToTeamRequest, InviteUserToTeamResponse, KNOWN_LOCKS, MetricType, MigrateRequest, ModifyTeamMembersRequest, ModuleByNameRequest, ModuleByNameResponse, ModuleExistsRequest, ModuleExistsResponse, ModuleHealthRequest, ModuleListResponse, ModuleListResponse_ModuleResponse, MongoIndexType, PatchAppRouteMiddlewaresRequest, PatchRouteMiddlewaresRequest, PermissionCheck, PermissionRequest, PlatformTypesEnum, PostgresIndexType, ProxyRouteActions, PushNotifications, PushNotificationsDefinition, QueryRequest, QueryResponse, RawQueryRequest, RawQueryRequest_RawQuery, RawQueryRequest_RawQuery_MongoQuery, RawQueryRequest_RawQuery_SQLQuery, RedisManager, RegisterAdminRouteRequest, RegisterAdminRouteRequest_ConduitRouteOptions, RegisterAdminRouteRequest_ConduitRouteReturnDefinition, RegisterAdminRouteRequest_PathDefinition, RegisterAdminRouteRequest_ProxyRouteOptions, RegisterConduitRouteRequest, RegisterConduitRouteRequest_ConduitRouteOptions, RegisterConduitRouteRequest_ConduitRouteReturnDefinition, RegisterConduitRouteRequest_ErrorDefinition, RegisterConduitRouteRequest_PathDefinition, RegisterConduitRouteRequest_ProxyRouteOptions, RegisterModuleRequest, RegisterModuleResponse, RegisterModulesConfigRequest, RegisterTemplateRequest, RegisterTemplateResponse, Relation, Request, ResendEmailRequest, ResendEmailResponse, Resource, ResourceAccessListRequest, ResourceAccessListResponse, ResourceModificationAcknowledgement, ResourceModificationAcknowledgement_Status, Resource_Permission, Resource_Relation, Response, Room, Router, RouterDefinition, SMS, SQLDataType, Schema, SchemaExtension, SendEmailRequest, SendEmailRequest_SendEmailParams, SendEmailResponse, SendManyNotificationsRequest, SendMessageRequest, SendNotificationRequest, SendNotificationResponse, SendNotificationToManyDevicesRequest, SendSmsRequest, SendSmsResponse, SendVerificationCodeRequest, SendVerificationCodeResponse, SetConfigRequest, SetConfigResponse, SetNotificationTokenRequest, SetNotificationTokenResponse, SmsDefinition, SocketData, SocketRequest, SocketResponse, StateManager, Storage, StorageDefinition, TYPE, Team, TeamDeleteRequest, TeamDeleteResponse, UpdateConfigRequest, UpdateConfigResponse, UpdateFileByUrlRequest, UpdateFileRequest, UpdateManyRequest, UpdateRequest, UpdateTeamRequest, UpdateTemplateRequest, UserChangePass, UserCreateByUsernameRequest, UserCreateRequest, UserCreateResponse, UserDeleteRequest, UserDeleteResponse, UserLoginRequest, UserLoginResponse, UserModifyStatusRequest, UserModifyStatusResponse, ValidateAccessTokenRequest, ValidateAccessTokenResponse, ValidateAccessTokenResponse_Status, VerifyRequest, VerifyResponse, checkModuleHealth, getJsonEnv, healthCheckResponse_ServingStatusFromJSON, healthCheckResponse_ServingStatusToJSON, resourceModificationAcknowledgement_StatusFromJSON, resourceModificationAcknowledgement_StatusToJSON, sleep, validateAccessTokenResponse_StatusFromJSON, validateAccessTokenResponse_StatusToJSON };
15195
+ export { Admin, AdminDefinition, AdminRouterDefinition, AllowedResourcesRequest, AllowedResourcesResponse, AnonymousUserCreateRequest, Attachment, Authentication, AuthenticationDefinition, Authorization, AuthorizationDefinition, Chat, ChatDefinition, ClientRouterDefinition, ColumnExistenceRequest, ColumnExistenceResponse, ConduitAuthorizedResource, ConduitError, ConduitGrpcSdk, ConduitModelOptionsPermModifyType, ConduitModule, ConduitModuleDefinition, ConduitRouteActions, ConduitRouteReturnDefinition, ConduitSchema, Config, ConfigDefinition, Cookie, CookieOptions, Core, CoreDefinition, CreateFileByUrlRequest, CreateFileRequest, CreateRelationsRequest, CreateRoomRequest, CreateSchemaRequest, CreateTeamRequest, CreateViewRequest, CreateViewRequest_RawQuery, DatabaseProvider, DatabaseProviderDefinition, Decision, DeleteAllRelationsRequest, DeleteFileResponse, DeleteResourceRequest, DeleteRoomRequest, DeleteViewRequest, DropCollectionRequest, DropCollectionResponse, Email, EmailDefinition, EventBus, FileByUrlResponse, FileResponse, FindOneRequest, FindRelationRequest, FindRelationResponse, FindRequest, FindRequest_SortEntry, GetConfigRequest, GetConfigResponse, GetDatabaseTypeResponse, GetEmailStatusRequest, GetEmailStatusResponse, GetFileDataResponse, GetFileRequest, GetFileUrlRequest, GetFileUrlResponse, GetNotificationTokensRequest, GetNotificationTokensResponse, GetRedisDetailsResponse, GetRoomResponse, GetSchemaRequest, GetSchemasRequest, GetSchemasResponse, GetTeamRequest, GrpcError, HealthCheckRequest, HealthCheckResponse, HealthCheckResponse_ServingStatus, HealthCheckStatus, HealthDefinition, InvitationDeleteRequest, InvitationDeleteResponse, InviteUserToTeamRequest, InviteUserToTeamResponse, KNOWN_LOCKS, MetricType, MigrateRequest, ModifyTeamMembersRequest, ModuleByNameRequest, ModuleByNameResponse, ModuleExistsRequest, ModuleExistsResponse, ModuleHealthRequest, ModuleListResponse, ModuleListResponse_ModuleResponse, MongoIndexType, PatchAppRouteMiddlewaresRequest, PatchRouteMiddlewaresRequest, PermissionCheck, PermissionRequest, PlatformTypesEnum, PostgresIndexType, ProxyRouteActions, PushNotifications, PushNotificationsDefinition, QueryRequest, QueryResponse, RawQueryRequest, RawQueryRequest_RawQuery, RawQueryRequest_RawQuery_MongoQuery, RawQueryRequest_RawQuery_SQLQuery, RedisManager, RegisterAdminRouteRequest, RegisterAdminRouteRequest_ConduitRouteOptions, RegisterAdminRouteRequest_ConduitRouteReturnDefinition, RegisterAdminRouteRequest_PathDefinition, RegisterAdminRouteRequest_ProxyRouteOptions, RegisterConduitRouteRequest, RegisterConduitRouteRequest_ConduitRouteOptions, RegisterConduitRouteRequest_ConduitRouteReturnDefinition, RegisterConduitRouteRequest_ErrorDefinition, RegisterConduitRouteRequest_PathDefinition, RegisterConduitRouteRequest_ProxyRouteOptions, RegisterModuleRequest, RegisterModuleResponse, RegisterModulesConfigRequest, RegisterTemplateRequest, RegisterTemplateResponse, Relation, Request, ResendEmailRequest, ResendEmailResponse, Resource, ResourceAccessListRequest, ResourceAccessListResponse, ResourceModificationAcknowledgement, ResourceModificationAcknowledgement_Status, Resource_Permission, Resource_Relation, Response, Room, Router, RouterDefinition, SMS, SQLDataType, Schema, SchemaExtension, SendEmailRequest, SendEmailRequest_SendEmailParams, SendEmailResponse, SendManyNotificationsRequest, SendMessageRequest, SendNotificationRequest, SendNotificationResponse, SendNotificationToManyDevicesRequest, SendSmsRequest, SendSmsResponse, SendVerificationCodeRequest, SendVerificationCodeResponse, SetConfigRequest, SetConfigResponse, SetNotificationTokenRequest, SetNotificationTokenResponse, SmsDefinition, SocketData, SocketRequest, SocketResponse, StateManager, Storage, StorageDefinition, TYPE, Team, TeamDeleteRequest, TeamDeleteResponse, UpdateConfigRequest, UpdateConfigResponse, UpdateFileByUrlRequest, UpdateFileRequest, UpdateManyRequest, UpdateRequest, UpdateTeamRequest, UpdateTemplateRequest, UserChangePass, UserCreateByUsernameRequest, UserCreateRequest, UserCreateResponse, UserDeleteRequest, UserDeleteResponse, UserLoginRequest, UserLoginResponse, UserModifyStatusRequest, UserModifyStatusResponse, ValidateAccessTokenRequest, ValidateAccessTokenResponse, ValidateAccessTokenResponse_Status, VerifyRequest, VerifyResponse, checkModuleHealth, getJsonEnv, healthCheckResponse_ServingStatusFromJSON, healthCheckResponse_ServingStatusToJSON, resourceModificationAcknowledgement_StatusFromJSON, resourceModificationAcknowledgement_StatusToJSON, sleep, validateAccessTokenResponse_StatusFromJSON, validateAccessTokenResponse_StatusToJSON };
15032
15196
  //# sourceMappingURL=index.esm.js.map