@conduitplatform/grpc-sdk 0.16.8 → 0.16.9
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/classes/ConduitAuthorizedResource.d.ts +2 -1
- package/dist/classes/ConduitModule.d.ts +0 -1
- package/dist/index.cjs +591 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +587 -137
- package/dist/index.esm.js.map +1 -1
- package/dist/interceptors/grpcSignedToken.d.ts +1 -1
- package/dist/interceptors/moduleName.d.ts +1 -1
- package/dist/modules/authentication/index.d.ts +2 -1
- package/dist/modules/config/index.d.ts +0 -1
- package/dist/modules/database/index.d.ts +14 -0
- package/dist/modules/database/types.d.ts +17 -0
- package/dist/modules/email/index.d.ts +2 -0
- package/dist/modules/pushNotifications/index.d.ts +7 -4
- package/dist/modules/pushNotifications/types.d.ts +5 -0
- package/dist/modules/storage/index.d.ts +15 -5
- package/dist/modules/storage/types.d.ts +24 -0
- package/dist/protoUtils/authentication.d.ts +38 -4
- package/dist/protoUtils/authorization.d.ts +14 -14
- package/dist/protoUtils/chat.d.ts +2 -2
- package/dist/protoUtils/core.d.ts +14 -14
- package/dist/protoUtils/database.d.ts +8 -8
- package/dist/protoUtils/email.d.ts +88 -0
- package/dist/protoUtils/router.d.ts +6 -6
- package/dist/protoUtils/storage.d.ts +6 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/options.d.ts +7 -0
- package/dist/utilities/normalizeOptions.d.ts +3 -0
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ var niceGrpc = require('nice-grpc');
|
|
|
4
4
|
var niceGrpcClientMiddlewareRetry = require('nice-grpc-client-middleware-retry');
|
|
5
5
|
var _m0 = require('protobufjs/minimal.js');
|
|
6
6
|
var events = require('events');
|
|
7
|
+
var lodash = require('lodash');
|
|
7
8
|
var crypto = require('crypto');
|
|
8
9
|
var fs = require('fs-extra');
|
|
9
10
|
var ioredis = require('ioredis');
|
|
@@ -206,7 +207,7 @@ const UserLoginRequest = {
|
|
|
206
207
|
},
|
|
207
208
|
};
|
|
208
209
|
function createBaseUserCreateRequest() {
|
|
209
|
-
return { email: "", password: undefined, verify: false };
|
|
210
|
+
return { email: "", password: undefined, verify: false, anonymousId: undefined };
|
|
210
211
|
}
|
|
211
212
|
const UserCreateRequest = {
|
|
212
213
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -219,6 +220,9 @@ const UserCreateRequest = {
|
|
|
219
220
|
if (message.verify === true) {
|
|
220
221
|
writer.uint32(24).bool(message.verify);
|
|
221
222
|
}
|
|
223
|
+
if (message.anonymousId !== undefined) {
|
|
224
|
+
writer.uint32(34).string(message.anonymousId);
|
|
225
|
+
}
|
|
222
226
|
return writer;
|
|
223
227
|
},
|
|
224
228
|
decode(input, length) {
|
|
@@ -246,6 +250,12 @@ const UserCreateRequest = {
|
|
|
246
250
|
}
|
|
247
251
|
message.verify = reader.bool();
|
|
248
252
|
continue;
|
|
253
|
+
case 4:
|
|
254
|
+
if (tag !== 34) {
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
message.anonymousId = reader.string();
|
|
258
|
+
continue;
|
|
249
259
|
}
|
|
250
260
|
if ((tag & 7) === 4 || tag === 0) {
|
|
251
261
|
break;
|
|
@@ -259,6 +269,7 @@ const UserCreateRequest = {
|
|
|
259
269
|
email: isSet$b(object.email) ? globalThis.String(object.email) : "",
|
|
260
270
|
password: isSet$b(object.password) ? globalThis.String(object.password) : undefined,
|
|
261
271
|
verify: isSet$b(object.verify) ? globalThis.Boolean(object.verify) : false,
|
|
272
|
+
anonymousId: isSet$b(object.anonymousId) ? globalThis.String(object.anonymousId) : undefined,
|
|
262
273
|
};
|
|
263
274
|
},
|
|
264
275
|
toJSON(message) {
|
|
@@ -272,6 +283,9 @@ const UserCreateRequest = {
|
|
|
272
283
|
if (message.verify === true) {
|
|
273
284
|
obj.verify = message.verify;
|
|
274
285
|
}
|
|
286
|
+
if (message.anonymousId !== undefined) {
|
|
287
|
+
obj.anonymousId = message.anonymousId;
|
|
288
|
+
}
|
|
275
289
|
return obj;
|
|
276
290
|
},
|
|
277
291
|
create(base) {
|
|
@@ -282,6 +296,7 @@ const UserCreateRequest = {
|
|
|
282
296
|
message.email = object.email ?? "";
|
|
283
297
|
message.password = object.password ?? undefined;
|
|
284
298
|
message.verify = object.verify ?? false;
|
|
299
|
+
message.anonymousId = object.anonymousId ?? undefined;
|
|
285
300
|
return message;
|
|
286
301
|
},
|
|
287
302
|
};
|
|
@@ -1091,6 +1106,56 @@ const ValidateAccessTokenResponse = {
|
|
|
1091
1106
|
return message;
|
|
1092
1107
|
},
|
|
1093
1108
|
};
|
|
1109
|
+
function createBaseAnonymousUserCreateRequest() {
|
|
1110
|
+
return { clientId: "" };
|
|
1111
|
+
}
|
|
1112
|
+
const AnonymousUserCreateRequest = {
|
|
1113
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1114
|
+
if (message.clientId !== "") {
|
|
1115
|
+
writer.uint32(10).string(message.clientId);
|
|
1116
|
+
}
|
|
1117
|
+
return writer;
|
|
1118
|
+
},
|
|
1119
|
+
decode(input, length) {
|
|
1120
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1121
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1122
|
+
const message = createBaseAnonymousUserCreateRequest();
|
|
1123
|
+
while (reader.pos < end) {
|
|
1124
|
+
const tag = reader.uint32();
|
|
1125
|
+
switch (tag >>> 3) {
|
|
1126
|
+
case 1:
|
|
1127
|
+
if (tag !== 10) {
|
|
1128
|
+
break;
|
|
1129
|
+
}
|
|
1130
|
+
message.clientId = reader.string();
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1134
|
+
break;
|
|
1135
|
+
}
|
|
1136
|
+
reader.skipType(tag & 7);
|
|
1137
|
+
}
|
|
1138
|
+
return message;
|
|
1139
|
+
},
|
|
1140
|
+
fromJSON(object) {
|
|
1141
|
+
return { clientId: isSet$b(object.clientId) ? globalThis.String(object.clientId) : "" };
|
|
1142
|
+
},
|
|
1143
|
+
toJSON(message) {
|
|
1144
|
+
const obj = {};
|
|
1145
|
+
if (message.clientId !== "") {
|
|
1146
|
+
obj.clientId = message.clientId;
|
|
1147
|
+
}
|
|
1148
|
+
return obj;
|
|
1149
|
+
},
|
|
1150
|
+
create(base) {
|
|
1151
|
+
return AnonymousUserCreateRequest.fromPartial(base ?? {});
|
|
1152
|
+
},
|
|
1153
|
+
fromPartial(object) {
|
|
1154
|
+
const message = createBaseAnonymousUserCreateRequest();
|
|
1155
|
+
message.clientId = object.clientId ?? "";
|
|
1156
|
+
return message;
|
|
1157
|
+
},
|
|
1158
|
+
};
|
|
1094
1159
|
const AuthenticationDefinition = {
|
|
1095
1160
|
name: "Authentication",
|
|
1096
1161
|
fullName: "authentication.Authentication",
|
|
@@ -1111,6 +1176,14 @@ const AuthenticationDefinition = {
|
|
|
1111
1176
|
responseStream: false,
|
|
1112
1177
|
options: {},
|
|
1113
1178
|
},
|
|
1179
|
+
anonymousUserCreate: {
|
|
1180
|
+
name: "AnonymousUserCreate",
|
|
1181
|
+
requestType: AnonymousUserCreateRequest,
|
|
1182
|
+
requestStream: false,
|
|
1183
|
+
responseType: UserLoginResponse,
|
|
1184
|
+
responseStream: false,
|
|
1185
|
+
options: {},
|
|
1186
|
+
},
|
|
1114
1187
|
changePass: {
|
|
1115
1188
|
name: "ChangePass",
|
|
1116
1189
|
requestType: UserChangePass,
|
|
@@ -7617,6 +7690,206 @@ const SendEmailResponse = {
|
|
|
7617
7690
|
return message;
|
|
7618
7691
|
},
|
|
7619
7692
|
};
|
|
7693
|
+
function createBaseResendEmailRequest() {
|
|
7694
|
+
return { emailRecordId: "" };
|
|
7695
|
+
}
|
|
7696
|
+
const ResendEmailRequest = {
|
|
7697
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
7698
|
+
if (message.emailRecordId !== "") {
|
|
7699
|
+
writer.uint32(10).string(message.emailRecordId);
|
|
7700
|
+
}
|
|
7701
|
+
return writer;
|
|
7702
|
+
},
|
|
7703
|
+
decode(input, length) {
|
|
7704
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
7705
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
7706
|
+
const message = createBaseResendEmailRequest();
|
|
7707
|
+
while (reader.pos < end) {
|
|
7708
|
+
const tag = reader.uint32();
|
|
7709
|
+
switch (tag >>> 3) {
|
|
7710
|
+
case 1:
|
|
7711
|
+
if (tag !== 10) {
|
|
7712
|
+
break;
|
|
7713
|
+
}
|
|
7714
|
+
message.emailRecordId = reader.string();
|
|
7715
|
+
continue;
|
|
7716
|
+
}
|
|
7717
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
7718
|
+
break;
|
|
7719
|
+
}
|
|
7720
|
+
reader.skipType(tag & 7);
|
|
7721
|
+
}
|
|
7722
|
+
return message;
|
|
7723
|
+
},
|
|
7724
|
+
fromJSON(object) {
|
|
7725
|
+
return { emailRecordId: isSet$6(object.emailRecordId) ? globalThis.String(object.emailRecordId) : "" };
|
|
7726
|
+
},
|
|
7727
|
+
toJSON(message) {
|
|
7728
|
+
const obj = {};
|
|
7729
|
+
if (message.emailRecordId !== "") {
|
|
7730
|
+
obj.emailRecordId = message.emailRecordId;
|
|
7731
|
+
}
|
|
7732
|
+
return obj;
|
|
7733
|
+
},
|
|
7734
|
+
create(base) {
|
|
7735
|
+
return ResendEmailRequest.fromPartial(base ?? {});
|
|
7736
|
+
},
|
|
7737
|
+
fromPartial(object) {
|
|
7738
|
+
const message = createBaseResendEmailRequest();
|
|
7739
|
+
message.emailRecordId = object.emailRecordId ?? "";
|
|
7740
|
+
return message;
|
|
7741
|
+
},
|
|
7742
|
+
};
|
|
7743
|
+
function createBaseResendEmailResponse() {
|
|
7744
|
+
return { sentMessageInfo: "" };
|
|
7745
|
+
}
|
|
7746
|
+
const ResendEmailResponse = {
|
|
7747
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
7748
|
+
if (message.sentMessageInfo !== "") {
|
|
7749
|
+
writer.uint32(10).string(message.sentMessageInfo);
|
|
7750
|
+
}
|
|
7751
|
+
return writer;
|
|
7752
|
+
},
|
|
7753
|
+
decode(input, length) {
|
|
7754
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
7755
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
7756
|
+
const message = createBaseResendEmailResponse();
|
|
7757
|
+
while (reader.pos < end) {
|
|
7758
|
+
const tag = reader.uint32();
|
|
7759
|
+
switch (tag >>> 3) {
|
|
7760
|
+
case 1:
|
|
7761
|
+
if (tag !== 10) {
|
|
7762
|
+
break;
|
|
7763
|
+
}
|
|
7764
|
+
message.sentMessageInfo = reader.string();
|
|
7765
|
+
continue;
|
|
7766
|
+
}
|
|
7767
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
7768
|
+
break;
|
|
7769
|
+
}
|
|
7770
|
+
reader.skipType(tag & 7);
|
|
7771
|
+
}
|
|
7772
|
+
return message;
|
|
7773
|
+
},
|
|
7774
|
+
fromJSON(object) {
|
|
7775
|
+
return { sentMessageInfo: isSet$6(object.sentMessageInfo) ? globalThis.String(object.sentMessageInfo) : "" };
|
|
7776
|
+
},
|
|
7777
|
+
toJSON(message) {
|
|
7778
|
+
const obj = {};
|
|
7779
|
+
if (message.sentMessageInfo !== "") {
|
|
7780
|
+
obj.sentMessageInfo = message.sentMessageInfo;
|
|
7781
|
+
}
|
|
7782
|
+
return obj;
|
|
7783
|
+
},
|
|
7784
|
+
create(base) {
|
|
7785
|
+
return ResendEmailResponse.fromPartial(base ?? {});
|
|
7786
|
+
},
|
|
7787
|
+
fromPartial(object) {
|
|
7788
|
+
const message = createBaseResendEmailResponse();
|
|
7789
|
+
message.sentMessageInfo = object.sentMessageInfo ?? "";
|
|
7790
|
+
return message;
|
|
7791
|
+
},
|
|
7792
|
+
};
|
|
7793
|
+
function createBaseGetEmailStatusRequest() {
|
|
7794
|
+
return { messageId: "" };
|
|
7795
|
+
}
|
|
7796
|
+
const GetEmailStatusRequest = {
|
|
7797
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
7798
|
+
if (message.messageId !== "") {
|
|
7799
|
+
writer.uint32(10).string(message.messageId);
|
|
7800
|
+
}
|
|
7801
|
+
return writer;
|
|
7802
|
+
},
|
|
7803
|
+
decode(input, length) {
|
|
7804
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
7805
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
7806
|
+
const message = createBaseGetEmailStatusRequest();
|
|
7807
|
+
while (reader.pos < end) {
|
|
7808
|
+
const tag = reader.uint32();
|
|
7809
|
+
switch (tag >>> 3) {
|
|
7810
|
+
case 1:
|
|
7811
|
+
if (tag !== 10) {
|
|
7812
|
+
break;
|
|
7813
|
+
}
|
|
7814
|
+
message.messageId = reader.string();
|
|
7815
|
+
continue;
|
|
7816
|
+
}
|
|
7817
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
7818
|
+
break;
|
|
7819
|
+
}
|
|
7820
|
+
reader.skipType(tag & 7);
|
|
7821
|
+
}
|
|
7822
|
+
return message;
|
|
7823
|
+
},
|
|
7824
|
+
fromJSON(object) {
|
|
7825
|
+
return { messageId: isSet$6(object.messageId) ? globalThis.String(object.messageId) : "" };
|
|
7826
|
+
},
|
|
7827
|
+
toJSON(message) {
|
|
7828
|
+
const obj = {};
|
|
7829
|
+
if (message.messageId !== "") {
|
|
7830
|
+
obj.messageId = message.messageId;
|
|
7831
|
+
}
|
|
7832
|
+
return obj;
|
|
7833
|
+
},
|
|
7834
|
+
create(base) {
|
|
7835
|
+
return GetEmailStatusRequest.fromPartial(base ?? {});
|
|
7836
|
+
},
|
|
7837
|
+
fromPartial(object) {
|
|
7838
|
+
const message = createBaseGetEmailStatusRequest();
|
|
7839
|
+
message.messageId = object.messageId ?? "";
|
|
7840
|
+
return message;
|
|
7841
|
+
},
|
|
7842
|
+
};
|
|
7843
|
+
function createBaseGetEmailStatusResponse() {
|
|
7844
|
+
return { statusInfo: "" };
|
|
7845
|
+
}
|
|
7846
|
+
const GetEmailStatusResponse = {
|
|
7847
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
7848
|
+
if (message.statusInfo !== "") {
|
|
7849
|
+
writer.uint32(10).string(message.statusInfo);
|
|
7850
|
+
}
|
|
7851
|
+
return writer;
|
|
7852
|
+
},
|
|
7853
|
+
decode(input, length) {
|
|
7854
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
7855
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
7856
|
+
const message = createBaseGetEmailStatusResponse();
|
|
7857
|
+
while (reader.pos < end) {
|
|
7858
|
+
const tag = reader.uint32();
|
|
7859
|
+
switch (tag >>> 3) {
|
|
7860
|
+
case 1:
|
|
7861
|
+
if (tag !== 10) {
|
|
7862
|
+
break;
|
|
7863
|
+
}
|
|
7864
|
+
message.statusInfo = reader.string();
|
|
7865
|
+
continue;
|
|
7866
|
+
}
|
|
7867
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
7868
|
+
break;
|
|
7869
|
+
}
|
|
7870
|
+
reader.skipType(tag & 7);
|
|
7871
|
+
}
|
|
7872
|
+
return message;
|
|
7873
|
+
},
|
|
7874
|
+
fromJSON(object) {
|
|
7875
|
+
return { statusInfo: isSet$6(object.statusInfo) ? globalThis.String(object.statusInfo) : "" };
|
|
7876
|
+
},
|
|
7877
|
+
toJSON(message) {
|
|
7878
|
+
const obj = {};
|
|
7879
|
+
if (message.statusInfo !== "") {
|
|
7880
|
+
obj.statusInfo = message.statusInfo;
|
|
7881
|
+
}
|
|
7882
|
+
return obj;
|
|
7883
|
+
},
|
|
7884
|
+
create(base) {
|
|
7885
|
+
return GetEmailStatusResponse.fromPartial(base ?? {});
|
|
7886
|
+
},
|
|
7887
|
+
fromPartial(object) {
|
|
7888
|
+
const message = createBaseGetEmailStatusResponse();
|
|
7889
|
+
message.statusInfo = object.statusInfo ?? "";
|
|
7890
|
+
return message;
|
|
7891
|
+
},
|
|
7892
|
+
};
|
|
7620
7893
|
const EmailDefinition = {
|
|
7621
7894
|
name: "Email",
|
|
7622
7895
|
fullName: "email.Email",
|
|
@@ -7637,6 +7910,22 @@ const EmailDefinition = {
|
|
|
7637
7910
|
responseStream: false,
|
|
7638
7911
|
options: {},
|
|
7639
7912
|
},
|
|
7913
|
+
resendEmail: {
|
|
7914
|
+
name: "ResendEmail",
|
|
7915
|
+
requestType: ResendEmailRequest,
|
|
7916
|
+
requestStream: false,
|
|
7917
|
+
responseType: ResendEmailResponse,
|
|
7918
|
+
responseStream: false,
|
|
7919
|
+
options: {},
|
|
7920
|
+
},
|
|
7921
|
+
getEmailStatus: {
|
|
7922
|
+
name: "GetEmailStatus",
|
|
7923
|
+
requestType: GetEmailStatusRequest,
|
|
7924
|
+
requestStream: false,
|
|
7925
|
+
responseType: GetEmailStatusResponse,
|
|
7926
|
+
responseStream: false,
|
|
7927
|
+
options: {},
|
|
7928
|
+
},
|
|
7640
7929
|
},
|
|
7641
7930
|
};
|
|
7642
7931
|
function isSet$6(value) {
|
|
@@ -10843,7 +11132,7 @@ const GetFileUrlResponse = {
|
|
|
10843
11132
|
};
|
|
10844
11133
|
function createBaseCreateFileRequest() {
|
|
10845
11134
|
return {
|
|
10846
|
-
name:
|
|
11135
|
+
name: undefined,
|
|
10847
11136
|
data: "",
|
|
10848
11137
|
isPublic: false,
|
|
10849
11138
|
folder: undefined,
|
|
@@ -10851,11 +11140,12 @@ function createBaseCreateFileRequest() {
|
|
|
10851
11140
|
mimeType: undefined,
|
|
10852
11141
|
userId: undefined,
|
|
10853
11142
|
scope: undefined,
|
|
11143
|
+
alias: undefined,
|
|
10854
11144
|
};
|
|
10855
11145
|
}
|
|
10856
11146
|
const CreateFileRequest = {
|
|
10857
11147
|
encode(message, writer = _m0.Writer.create()) {
|
|
10858
|
-
if (message.name !==
|
|
11148
|
+
if (message.name !== undefined) {
|
|
10859
11149
|
writer.uint32(10).string(message.name);
|
|
10860
11150
|
}
|
|
10861
11151
|
if (message.data !== "") {
|
|
@@ -10879,6 +11169,9 @@ const CreateFileRequest = {
|
|
|
10879
11169
|
if (message.scope !== undefined) {
|
|
10880
11170
|
writer.uint32(66).string(message.scope);
|
|
10881
11171
|
}
|
|
11172
|
+
if (message.alias !== undefined) {
|
|
11173
|
+
writer.uint32(74).string(message.alias);
|
|
11174
|
+
}
|
|
10882
11175
|
return writer;
|
|
10883
11176
|
},
|
|
10884
11177
|
decode(input, length) {
|
|
@@ -10936,6 +11229,12 @@ const CreateFileRequest = {
|
|
|
10936
11229
|
}
|
|
10937
11230
|
message.scope = reader.string();
|
|
10938
11231
|
continue;
|
|
11232
|
+
case 9:
|
|
11233
|
+
if (tag !== 74) {
|
|
11234
|
+
break;
|
|
11235
|
+
}
|
|
11236
|
+
message.alias = reader.string();
|
|
11237
|
+
continue;
|
|
10939
11238
|
}
|
|
10940
11239
|
if ((tag & 7) === 4 || tag === 0) {
|
|
10941
11240
|
break;
|
|
@@ -10946,7 +11245,7 @@ const CreateFileRequest = {
|
|
|
10946
11245
|
},
|
|
10947
11246
|
fromJSON(object) {
|
|
10948
11247
|
return {
|
|
10949
|
-
name: isSet(object.name) ? globalThis.String(object.name) :
|
|
11248
|
+
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
|
|
10950
11249
|
data: isSet(object.data) ? globalThis.String(object.data) : "",
|
|
10951
11250
|
isPublic: isSet(object.isPublic) ? globalThis.Boolean(object.isPublic) : false,
|
|
10952
11251
|
folder: isSet(object.folder) ? globalThis.String(object.folder) : undefined,
|
|
@@ -10954,11 +11253,12 @@ const CreateFileRequest = {
|
|
|
10954
11253
|
mimeType: isSet(object.mimeType) ? globalThis.String(object.mimeType) : undefined,
|
|
10955
11254
|
userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
|
|
10956
11255
|
scope: isSet(object.scope) ? globalThis.String(object.scope) : undefined,
|
|
11256
|
+
alias: isSet(object.alias) ? globalThis.String(object.alias) : undefined,
|
|
10957
11257
|
};
|
|
10958
11258
|
},
|
|
10959
11259
|
toJSON(message) {
|
|
10960
11260
|
const obj = {};
|
|
10961
|
-
if (message.name !==
|
|
11261
|
+
if (message.name !== undefined) {
|
|
10962
11262
|
obj.name = message.name;
|
|
10963
11263
|
}
|
|
10964
11264
|
if (message.data !== "") {
|
|
@@ -10982,6 +11282,9 @@ const CreateFileRequest = {
|
|
|
10982
11282
|
if (message.scope !== undefined) {
|
|
10983
11283
|
obj.scope = message.scope;
|
|
10984
11284
|
}
|
|
11285
|
+
if (message.alias !== undefined) {
|
|
11286
|
+
obj.alias = message.alias;
|
|
11287
|
+
}
|
|
10985
11288
|
return obj;
|
|
10986
11289
|
},
|
|
10987
11290
|
create(base) {
|
|
@@ -10989,7 +11292,7 @@ const CreateFileRequest = {
|
|
|
10989
11292
|
},
|
|
10990
11293
|
fromPartial(object) {
|
|
10991
11294
|
const message = createBaseCreateFileRequest();
|
|
10992
|
-
message.name = object.name ??
|
|
11295
|
+
message.name = object.name ?? undefined;
|
|
10993
11296
|
message.data = object.data ?? "";
|
|
10994
11297
|
message.isPublic = object.isPublic ?? false;
|
|
10995
11298
|
message.folder = object.folder ?? undefined;
|
|
@@ -10997,6 +11300,7 @@ const CreateFileRequest = {
|
|
|
10997
11300
|
message.mimeType = object.mimeType ?? undefined;
|
|
10998
11301
|
message.userId = object.userId ?? undefined;
|
|
10999
11302
|
message.scope = object.scope ?? undefined;
|
|
11303
|
+
message.alias = object.alias ?? undefined;
|
|
11000
11304
|
return message;
|
|
11001
11305
|
},
|
|
11002
11306
|
};
|
|
@@ -11010,6 +11314,7 @@ function createBaseUpdateFileRequest() {
|
|
|
11010
11314
|
mimeType: undefined,
|
|
11011
11315
|
userId: undefined,
|
|
11012
11316
|
scope: undefined,
|
|
11317
|
+
alias: undefined,
|
|
11013
11318
|
};
|
|
11014
11319
|
}
|
|
11015
11320
|
const UpdateFileRequest = {
|
|
@@ -11038,6 +11343,9 @@ const UpdateFileRequest = {
|
|
|
11038
11343
|
if (message.scope !== undefined) {
|
|
11039
11344
|
writer.uint32(66).string(message.scope);
|
|
11040
11345
|
}
|
|
11346
|
+
if (message.alias !== undefined) {
|
|
11347
|
+
writer.uint32(74).string(message.alias);
|
|
11348
|
+
}
|
|
11041
11349
|
return writer;
|
|
11042
11350
|
},
|
|
11043
11351
|
decode(input, length) {
|
|
@@ -11095,6 +11403,12 @@ const UpdateFileRequest = {
|
|
|
11095
11403
|
}
|
|
11096
11404
|
message.scope = reader.string();
|
|
11097
11405
|
continue;
|
|
11406
|
+
case 9:
|
|
11407
|
+
if (tag !== 74) {
|
|
11408
|
+
break;
|
|
11409
|
+
}
|
|
11410
|
+
message.alias = reader.string();
|
|
11411
|
+
continue;
|
|
11098
11412
|
}
|
|
11099
11413
|
if ((tag & 7) === 4 || tag === 0) {
|
|
11100
11414
|
break;
|
|
@@ -11113,6 +11427,7 @@ const UpdateFileRequest = {
|
|
|
11113
11427
|
mimeType: isSet(object.mimeType) ? globalThis.String(object.mimeType) : undefined,
|
|
11114
11428
|
userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
|
|
11115
11429
|
scope: isSet(object.scope) ? globalThis.String(object.scope) : undefined,
|
|
11430
|
+
alias: isSet(object.alias) ? globalThis.String(object.alias) : undefined,
|
|
11116
11431
|
};
|
|
11117
11432
|
},
|
|
11118
11433
|
toJSON(message) {
|
|
@@ -11141,6 +11456,9 @@ const UpdateFileRequest = {
|
|
|
11141
11456
|
if (message.scope !== undefined) {
|
|
11142
11457
|
obj.scope = message.scope;
|
|
11143
11458
|
}
|
|
11459
|
+
if (message.alias !== undefined) {
|
|
11460
|
+
obj.alias = message.alias;
|
|
11461
|
+
}
|
|
11144
11462
|
return obj;
|
|
11145
11463
|
},
|
|
11146
11464
|
create(base) {
|
|
@@ -11156,6 +11474,7 @@ const UpdateFileRequest = {
|
|
|
11156
11474
|
message.mimeType = object.mimeType ?? undefined;
|
|
11157
11475
|
message.userId = object.userId ?? undefined;
|
|
11158
11476
|
message.scope = object.scope ?? undefined;
|
|
11477
|
+
message.alias = object.alias ?? undefined;
|
|
11159
11478
|
return message;
|
|
11160
11479
|
},
|
|
11161
11480
|
};
|
|
@@ -11341,7 +11660,7 @@ const DeleteFileResponse = {
|
|
|
11341
11660
|
};
|
|
11342
11661
|
function createBaseCreateFileByUrlRequest() {
|
|
11343
11662
|
return {
|
|
11344
|
-
name:
|
|
11663
|
+
name: undefined,
|
|
11345
11664
|
isPublic: false,
|
|
11346
11665
|
folder: undefined,
|
|
11347
11666
|
container: undefined,
|
|
@@ -11349,11 +11668,12 @@ function createBaseCreateFileByUrlRequest() {
|
|
|
11349
11668
|
size: undefined,
|
|
11350
11669
|
userId: undefined,
|
|
11351
11670
|
scope: undefined,
|
|
11671
|
+
alias: undefined,
|
|
11352
11672
|
};
|
|
11353
11673
|
}
|
|
11354
11674
|
const CreateFileByUrlRequest = {
|
|
11355
11675
|
encode(message, writer = _m0.Writer.create()) {
|
|
11356
|
-
if (message.name !==
|
|
11676
|
+
if (message.name !== undefined) {
|
|
11357
11677
|
writer.uint32(10).string(message.name);
|
|
11358
11678
|
}
|
|
11359
11679
|
if (message.isPublic === true) {
|
|
@@ -11377,6 +11697,9 @@ const CreateFileByUrlRequest = {
|
|
|
11377
11697
|
if (message.scope !== undefined) {
|
|
11378
11698
|
writer.uint32(66).string(message.scope);
|
|
11379
11699
|
}
|
|
11700
|
+
if (message.alias !== undefined) {
|
|
11701
|
+
writer.uint32(74).string(message.alias);
|
|
11702
|
+
}
|
|
11380
11703
|
return writer;
|
|
11381
11704
|
},
|
|
11382
11705
|
decode(input, length) {
|
|
@@ -11434,6 +11757,12 @@ const CreateFileByUrlRequest = {
|
|
|
11434
11757
|
}
|
|
11435
11758
|
message.scope = reader.string();
|
|
11436
11759
|
continue;
|
|
11760
|
+
case 9:
|
|
11761
|
+
if (tag !== 74) {
|
|
11762
|
+
break;
|
|
11763
|
+
}
|
|
11764
|
+
message.alias = reader.string();
|
|
11765
|
+
continue;
|
|
11437
11766
|
}
|
|
11438
11767
|
if ((tag & 7) === 4 || tag === 0) {
|
|
11439
11768
|
break;
|
|
@@ -11444,7 +11773,7 @@ const CreateFileByUrlRequest = {
|
|
|
11444
11773
|
},
|
|
11445
11774
|
fromJSON(object) {
|
|
11446
11775
|
return {
|
|
11447
|
-
name: isSet(object.name) ? globalThis.String(object.name) :
|
|
11776
|
+
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
|
|
11448
11777
|
isPublic: isSet(object.isPublic) ? globalThis.Boolean(object.isPublic) : false,
|
|
11449
11778
|
folder: isSet(object.folder) ? globalThis.String(object.folder) : undefined,
|
|
11450
11779
|
container: isSet(object.container) ? globalThis.String(object.container) : undefined,
|
|
@@ -11452,11 +11781,12 @@ const CreateFileByUrlRequest = {
|
|
|
11452
11781
|
size: isSet(object.size) ? globalThis.Number(object.size) : undefined,
|
|
11453
11782
|
userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
|
|
11454
11783
|
scope: isSet(object.scope) ? globalThis.String(object.scope) : undefined,
|
|
11784
|
+
alias: isSet(object.alias) ? globalThis.String(object.alias) : undefined,
|
|
11455
11785
|
};
|
|
11456
11786
|
},
|
|
11457
11787
|
toJSON(message) {
|
|
11458
11788
|
const obj = {};
|
|
11459
|
-
if (message.name !==
|
|
11789
|
+
if (message.name !== undefined) {
|
|
11460
11790
|
obj.name = message.name;
|
|
11461
11791
|
}
|
|
11462
11792
|
if (message.isPublic === true) {
|
|
@@ -11480,6 +11810,9 @@ const CreateFileByUrlRequest = {
|
|
|
11480
11810
|
if (message.scope !== undefined) {
|
|
11481
11811
|
obj.scope = message.scope;
|
|
11482
11812
|
}
|
|
11813
|
+
if (message.alias !== undefined) {
|
|
11814
|
+
obj.alias = message.alias;
|
|
11815
|
+
}
|
|
11483
11816
|
return obj;
|
|
11484
11817
|
},
|
|
11485
11818
|
create(base) {
|
|
@@ -11487,7 +11820,7 @@ const CreateFileByUrlRequest = {
|
|
|
11487
11820
|
},
|
|
11488
11821
|
fromPartial(object) {
|
|
11489
11822
|
const message = createBaseCreateFileByUrlRequest();
|
|
11490
|
-
message.name = object.name ??
|
|
11823
|
+
message.name = object.name ?? undefined;
|
|
11491
11824
|
message.isPublic = object.isPublic ?? false;
|
|
11492
11825
|
message.folder = object.folder ?? undefined;
|
|
11493
11826
|
message.container = object.container ?? undefined;
|
|
@@ -11495,6 +11828,7 @@ const CreateFileByUrlRequest = {
|
|
|
11495
11828
|
message.size = object.size ?? undefined;
|
|
11496
11829
|
message.userId = object.userId ?? undefined;
|
|
11497
11830
|
message.scope = object.scope ?? undefined;
|
|
11831
|
+
message.alias = object.alias ?? undefined;
|
|
11498
11832
|
return message;
|
|
11499
11833
|
},
|
|
11500
11834
|
};
|
|
@@ -11602,6 +11936,7 @@ function createBaseUpdateFileByUrlRequest() {
|
|
|
11602
11936
|
size: undefined,
|
|
11603
11937
|
userId: undefined,
|
|
11604
11938
|
scope: undefined,
|
|
11939
|
+
alias: undefined,
|
|
11605
11940
|
};
|
|
11606
11941
|
}
|
|
11607
11942
|
const UpdateFileByUrlRequest = {
|
|
@@ -11630,6 +11965,9 @@ const UpdateFileByUrlRequest = {
|
|
|
11630
11965
|
if (message.scope !== undefined) {
|
|
11631
11966
|
writer.uint32(66).string(message.scope);
|
|
11632
11967
|
}
|
|
11968
|
+
if (message.alias !== undefined) {
|
|
11969
|
+
writer.uint32(74).string(message.alias);
|
|
11970
|
+
}
|
|
11633
11971
|
return writer;
|
|
11634
11972
|
},
|
|
11635
11973
|
decode(input, length) {
|
|
@@ -11687,6 +12025,12 @@ const UpdateFileByUrlRequest = {
|
|
|
11687
12025
|
}
|
|
11688
12026
|
message.scope = reader.string();
|
|
11689
12027
|
continue;
|
|
12028
|
+
case 9:
|
|
12029
|
+
if (tag !== 74) {
|
|
12030
|
+
break;
|
|
12031
|
+
}
|
|
12032
|
+
message.alias = reader.string();
|
|
12033
|
+
continue;
|
|
11690
12034
|
}
|
|
11691
12035
|
if ((tag & 7) === 4 || tag === 0) {
|
|
11692
12036
|
break;
|
|
@@ -11705,6 +12049,7 @@ const UpdateFileByUrlRequest = {
|
|
|
11705
12049
|
size: isSet(object.size) ? globalThis.Number(object.size) : undefined,
|
|
11706
12050
|
userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
|
|
11707
12051
|
scope: isSet(object.scope) ? globalThis.String(object.scope) : undefined,
|
|
12052
|
+
alias: isSet(object.alias) ? globalThis.String(object.alias) : undefined,
|
|
11708
12053
|
};
|
|
11709
12054
|
},
|
|
11710
12055
|
toJSON(message) {
|
|
@@ -11733,6 +12078,9 @@ const UpdateFileByUrlRequest = {
|
|
|
11733
12078
|
if (message.scope !== undefined) {
|
|
11734
12079
|
obj.scope = message.scope;
|
|
11735
12080
|
}
|
|
12081
|
+
if (message.alias !== undefined) {
|
|
12082
|
+
obj.alias = message.alias;
|
|
12083
|
+
}
|
|
11736
12084
|
return obj;
|
|
11737
12085
|
},
|
|
11738
12086
|
create(base) {
|
|
@@ -11748,6 +12096,7 @@ const UpdateFileByUrlRequest = {
|
|
|
11748
12096
|
message.size = object.size ?? undefined;
|
|
11749
12097
|
message.userId = object.userId ?? undefined;
|
|
11750
12098
|
message.scope = object.scope ?? undefined;
|
|
12099
|
+
message.alias = object.alias ?? undefined;
|
|
11751
12100
|
return message;
|
|
11752
12101
|
},
|
|
11753
12102
|
};
|
|
@@ -11985,7 +12334,8 @@ class ConduitAuthorizedResource {
|
|
|
11985
12334
|
name;
|
|
11986
12335
|
relations = [];
|
|
11987
12336
|
permissions = [];
|
|
11988
|
-
|
|
12337
|
+
version;
|
|
12338
|
+
constructor(name, relations, permissions, version) {
|
|
11989
12339
|
this.name = name;
|
|
11990
12340
|
this.relations = Object.keys(relations).map(relation => {
|
|
11991
12341
|
return {
|
|
@@ -12003,9 +12353,25 @@ class ConduitAuthorizedResource {
|
|
|
12003
12353
|
: [permissions[permission]],
|
|
12004
12354
|
};
|
|
12005
12355
|
});
|
|
12356
|
+
this.version = version;
|
|
12006
12357
|
}
|
|
12007
12358
|
}
|
|
12008
12359
|
|
|
12360
|
+
function normalizeAuthzOptions(userIdOrOptions, scope) {
|
|
12361
|
+
if (typeof userIdOrOptions === 'string' || lodash.isNil(userIdOrOptions)) {
|
|
12362
|
+
return { userId: userIdOrOptions, scope };
|
|
12363
|
+
}
|
|
12364
|
+
return userIdOrOptions;
|
|
12365
|
+
}
|
|
12366
|
+
function normalizePopulateAuthzOptions(populateOrOptions, userId, scope) {
|
|
12367
|
+
if (typeof populateOrOptions === 'string' ||
|
|
12368
|
+
Array.isArray(populateOrOptions) ||
|
|
12369
|
+
lodash.isNil(populateOrOptions)) {
|
|
12370
|
+
return { populate: populateOrOptions, userId, scope };
|
|
12371
|
+
}
|
|
12372
|
+
return populateOrOptions;
|
|
12373
|
+
}
|
|
12374
|
+
|
|
12009
12375
|
class Storage extends ConduitModule {
|
|
12010
12376
|
moduleName;
|
|
12011
12377
|
constructor(moduleName, url, grpcToken) {
|
|
@@ -12013,65 +12379,108 @@ class Storage extends ConduitModule {
|
|
|
12013
12379
|
this.moduleName = moduleName;
|
|
12014
12380
|
this.initializeClient(StorageDefinition);
|
|
12015
12381
|
}
|
|
12016
|
-
getFile(id,
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12382
|
+
getFile(id, userIdOrOptions, scope) {
|
|
12383
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12384
|
+
return this.client.getFile({ id, ...options });
|
|
12385
|
+
}
|
|
12386
|
+
getFileUrl(id, userIdOrOptions, scope) {
|
|
12387
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12388
|
+
return this.client.getFileUrl({ id, ...options });
|
|
12389
|
+
}
|
|
12390
|
+
getFileData(id, userIdOrOptions, scope) {
|
|
12391
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12392
|
+
return this.client.getFileData({ id, ...options });
|
|
12393
|
+
}
|
|
12394
|
+
createFile(name, data, folderOrOptions, container, mimeType, isPublic, userId, scope, alias) {
|
|
12395
|
+
let options;
|
|
12396
|
+
if (typeof folderOrOptions === 'string' || lodash.isNil(folderOrOptions)) {
|
|
12397
|
+
options = {
|
|
12398
|
+
folder: folderOrOptions,
|
|
12399
|
+
container,
|
|
12400
|
+
mimeType,
|
|
12401
|
+
isPublic,
|
|
12402
|
+
userId,
|
|
12403
|
+
scope,
|
|
12404
|
+
alias,
|
|
12405
|
+
};
|
|
12406
|
+
}
|
|
12407
|
+
else {
|
|
12408
|
+
options = folderOrOptions;
|
|
12409
|
+
}
|
|
12026
12410
|
return this.client.createFile({
|
|
12027
12411
|
name,
|
|
12028
|
-
mimeType,
|
|
12029
12412
|
data,
|
|
12030
|
-
|
|
12031
|
-
isPublic,
|
|
12032
|
-
container,
|
|
12033
|
-
userId,
|
|
12034
|
-
scope,
|
|
12413
|
+
...options,
|
|
12414
|
+
isPublic: options.isPublic ?? false,
|
|
12035
12415
|
});
|
|
12036
12416
|
}
|
|
12037
|
-
updateFile(id, data,
|
|
12417
|
+
updateFile(id, data, nameOrOptions, folder, container, mimeType, userId, scope, alias) {
|
|
12418
|
+
let options;
|
|
12419
|
+
if (typeof nameOrOptions === 'string' || lodash.isNil(nameOrOptions)) {
|
|
12420
|
+
options = {
|
|
12421
|
+
name: nameOrOptions,
|
|
12422
|
+
folder,
|
|
12423
|
+
container,
|
|
12424
|
+
mimeType,
|
|
12425
|
+
userId,
|
|
12426
|
+
scope,
|
|
12427
|
+
alias,
|
|
12428
|
+
};
|
|
12429
|
+
}
|
|
12430
|
+
else {
|
|
12431
|
+
options = nameOrOptions;
|
|
12432
|
+
}
|
|
12038
12433
|
return this.client.updateFile({
|
|
12039
|
-
name,
|
|
12040
|
-
mimeType,
|
|
12041
|
-
data,
|
|
12042
|
-
folder,
|
|
12043
12434
|
id,
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
scope,
|
|
12435
|
+
data,
|
|
12436
|
+
...options,
|
|
12047
12437
|
});
|
|
12048
12438
|
}
|
|
12049
|
-
deleteFile(id,
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12439
|
+
deleteFile(id, userIdOrOptions, scope) {
|
|
12440
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12441
|
+
return this.client.deleteFile({ id, ...options });
|
|
12442
|
+
}
|
|
12443
|
+
createFileByUrl(name, folderOrOptions, container, mimeType, size, isPublic, userId, scope, alias) {
|
|
12444
|
+
let options;
|
|
12445
|
+
if (typeof folderOrOptions === 'string' || lodash.isNil(folderOrOptions)) {
|
|
12446
|
+
options = {
|
|
12447
|
+
folder: folderOrOptions,
|
|
12448
|
+
container,
|
|
12449
|
+
mimeType,
|
|
12450
|
+
size,
|
|
12451
|
+
isPublic,
|
|
12452
|
+
userId,
|
|
12453
|
+
scope,
|
|
12454
|
+
alias,
|
|
12455
|
+
};
|
|
12456
|
+
}
|
|
12457
|
+
else {
|
|
12458
|
+
options = folderOrOptions;
|
|
12459
|
+
}
|
|
12053
12460
|
return this.client.createFileByUrl({
|
|
12054
12461
|
name,
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
container,
|
|
12058
|
-
size,
|
|
12059
|
-
isPublic,
|
|
12060
|
-
userId,
|
|
12061
|
-
scope,
|
|
12462
|
+
...options,
|
|
12463
|
+
isPublic: options.isPublic ?? false,
|
|
12062
12464
|
});
|
|
12063
12465
|
}
|
|
12064
|
-
updateFileByUrl(id,
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12466
|
+
updateFileByUrl(id, nameOrOptions, folder, container, mimeType, size, userId, scope, alias) {
|
|
12467
|
+
let options;
|
|
12468
|
+
if (typeof nameOrOptions === 'string' || lodash.isNil(nameOrOptions)) {
|
|
12469
|
+
options = {
|
|
12470
|
+
name: nameOrOptions,
|
|
12471
|
+
folder,
|
|
12472
|
+
container,
|
|
12473
|
+
mimeType,
|
|
12474
|
+
size,
|
|
12475
|
+
userId,
|
|
12476
|
+
scope,
|
|
12477
|
+
alias,
|
|
12478
|
+
};
|
|
12479
|
+
}
|
|
12480
|
+
else {
|
|
12481
|
+
options = nameOrOptions;
|
|
12482
|
+
}
|
|
12483
|
+
return this.client.updateFileByUrl({ id, ...options });
|
|
12075
12484
|
}
|
|
12076
12485
|
}
|
|
12077
12486
|
|
|
@@ -12134,6 +12543,16 @@ class Email extends ConduitModule {
|
|
|
12134
12543
|
return res.sentMessageInfo;
|
|
12135
12544
|
});
|
|
12136
12545
|
}
|
|
12546
|
+
resendEmail(emailRecordId) {
|
|
12547
|
+
return this.client.resendEmail({ emailRecordId }).then(res => {
|
|
12548
|
+
return res.sentMessageInfo;
|
|
12549
|
+
});
|
|
12550
|
+
}
|
|
12551
|
+
getEmailStatus(messageId) {
|
|
12552
|
+
return this.client.getEmailStatus({ messageId }).then(res => {
|
|
12553
|
+
return JSON.parse(res.statusInfo);
|
|
12554
|
+
});
|
|
12555
|
+
}
|
|
12137
12556
|
}
|
|
12138
12557
|
|
|
12139
12558
|
class DatabaseProvider extends ConduitModule {
|
|
@@ -12203,170 +12622,188 @@ class DatabaseProvider extends ConduitModule {
|
|
|
12203
12622
|
processQuery(query) {
|
|
12204
12623
|
return JSON.stringify(query);
|
|
12205
12624
|
}
|
|
12206
|
-
findOne(schemaName, query,
|
|
12207
|
-
let
|
|
12208
|
-
if (
|
|
12209
|
-
|
|
12625
|
+
findOne(schemaName, query, selectOrOptions, populate, userId, scope) {
|
|
12626
|
+
let options;
|
|
12627
|
+
if (typeof selectOrOptions === 'string' || lodash.isNil(selectOrOptions)) {
|
|
12628
|
+
options = { select: selectOrOptions, populate, userId, scope };
|
|
12629
|
+
}
|
|
12630
|
+
else {
|
|
12631
|
+
options = selectOrOptions;
|
|
12632
|
+
}
|
|
12633
|
+
let populateArray = options.populate;
|
|
12634
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12635
|
+
populateArray = [options.populate];
|
|
12210
12636
|
}
|
|
12211
12637
|
return this.client.findOne({
|
|
12212
12638
|
schemaName,
|
|
12213
12639
|
query: this.processQuery(query),
|
|
12214
|
-
|
|
12640
|
+
...options,
|
|
12641
|
+
select: options.select === null ? undefined : options.select,
|
|
12215
12642
|
populate: populateArray ?? [],
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12643
|
+
}).then(res => JSON.parse(res.result));
|
|
12644
|
+
}
|
|
12645
|
+
findMany(schemaName, query, selectOrOptions, skip, limit, sort, populate, userId, scope) {
|
|
12646
|
+
let options;
|
|
12647
|
+
if (typeof selectOrOptions === 'string' || lodash.isNil(selectOrOptions)) {
|
|
12648
|
+
options = {
|
|
12649
|
+
select: selectOrOptions,
|
|
12650
|
+
skip,
|
|
12651
|
+
limit,
|
|
12652
|
+
sort,
|
|
12653
|
+
populate,
|
|
12654
|
+
userId,
|
|
12655
|
+
scope,
|
|
12656
|
+
};
|
|
12657
|
+
}
|
|
12658
|
+
else {
|
|
12659
|
+
options = selectOrOptions;
|
|
12660
|
+
}
|
|
12661
|
+
if (typeof options.sort === 'string')
|
|
12662
|
+
options.sort = [options.sort];
|
|
12663
|
+
const sortObj = Array.isArray(options.sort)
|
|
12664
|
+
? this.constructSortObj(options.sort)
|
|
12665
|
+
: options.sort;
|
|
12666
|
+
let populateArray = options.populate;
|
|
12667
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12668
|
+
populateArray = [options.populate];
|
|
12229
12669
|
}
|
|
12230
12670
|
return this.client.findMany({
|
|
12231
12671
|
schemaName,
|
|
12232
12672
|
query: this.processQuery(query),
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
limit,
|
|
12673
|
+
...options,
|
|
12674
|
+
select: options.select === null ? undefined : options.select,
|
|
12236
12675
|
sort: sortObj,
|
|
12237
12676
|
populate: populateArray ?? [],
|
|
12238
|
-
userId,
|
|
12239
|
-
scope,
|
|
12240
12677
|
}).then(res => {
|
|
12241
12678
|
return JSON.parse(res.result);
|
|
12242
12679
|
});
|
|
12243
12680
|
}
|
|
12244
|
-
create(schemaName, query,
|
|
12681
|
+
create(schemaName, query, userIdOrOptions, scope) {
|
|
12682
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12245
12683
|
return this.client.create({
|
|
12246
12684
|
schemaName,
|
|
12247
12685
|
query: this.processQuery(query),
|
|
12248
|
-
|
|
12249
|
-
scope,
|
|
12686
|
+
...options,
|
|
12250
12687
|
}).then(res => {
|
|
12251
12688
|
return JSON.parse(res.result);
|
|
12252
12689
|
});
|
|
12253
12690
|
}
|
|
12254
|
-
createMany(schemaName, query,
|
|
12691
|
+
createMany(schemaName, query, userIdOrOptions, scope) {
|
|
12692
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12255
12693
|
return this.client.createMany({
|
|
12256
12694
|
schemaName,
|
|
12257
12695
|
query: this.processQuery(query),
|
|
12258
|
-
|
|
12259
|
-
scope,
|
|
12696
|
+
...options,
|
|
12260
12697
|
}).then(res => {
|
|
12261
12698
|
return JSON.parse(res.result);
|
|
12262
12699
|
});
|
|
12263
12700
|
}
|
|
12264
|
-
findByIdAndUpdate(schemaName, id, document,
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12701
|
+
findByIdAndUpdate(schemaName, id, document, populateOrOptions, userId, scope) {
|
|
12702
|
+
const options = normalizePopulateAuthzOptions(populateOrOptions, userId, scope);
|
|
12703
|
+
let populateArray = options.populate;
|
|
12704
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12705
|
+
populateArray = [options.populate];
|
|
12268
12706
|
}
|
|
12269
12707
|
return this.client.findByIdAndUpdate({
|
|
12270
12708
|
schemaName,
|
|
12271
12709
|
id,
|
|
12272
12710
|
query: this.processQuery(document),
|
|
12711
|
+
...options,
|
|
12273
12712
|
populate: populateArray ?? [],
|
|
12274
|
-
userId,
|
|
12275
|
-
scope,
|
|
12276
12713
|
}).then(res => {
|
|
12277
12714
|
return JSON.parse(res.result);
|
|
12278
12715
|
});
|
|
12279
12716
|
}
|
|
12280
|
-
findByIdAndReplace(schemaName, id, document,
|
|
12281
|
-
|
|
12282
|
-
|
|
12283
|
-
|
|
12717
|
+
findByIdAndReplace(schemaName, id, document, populateOrOptions, userId, scope) {
|
|
12718
|
+
const options = normalizePopulateAuthzOptions(populateOrOptions, userId, scope);
|
|
12719
|
+
let populateArray = options.populate;
|
|
12720
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12721
|
+
populateArray = [options.populate];
|
|
12284
12722
|
}
|
|
12285
12723
|
return this.client.findByIdAndReplace({
|
|
12286
12724
|
schemaName,
|
|
12287
12725
|
id,
|
|
12288
12726
|
query: this.processQuery(document),
|
|
12727
|
+
...options,
|
|
12289
12728
|
populate: populateArray ?? [],
|
|
12290
|
-
userId,
|
|
12291
|
-
scope,
|
|
12292
12729
|
}).then(res => {
|
|
12293
12730
|
return JSON.parse(res.result);
|
|
12294
12731
|
});
|
|
12295
12732
|
}
|
|
12296
|
-
updateMany(schemaName, filterQuery, query,
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12733
|
+
updateMany(schemaName, filterQuery, query, populateOrOptions, userId, scope) {
|
|
12734
|
+
const options = normalizePopulateAuthzOptions(populateOrOptions, userId, scope);
|
|
12735
|
+
let populateArray = options.populate;
|
|
12736
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12737
|
+
populateArray = [options.populate];
|
|
12300
12738
|
}
|
|
12301
12739
|
return this.client.updateMany({
|
|
12302
12740
|
schemaName,
|
|
12303
12741
|
filterQuery: this.processQuery(filterQuery),
|
|
12304
12742
|
query: this.processQuery(query),
|
|
12743
|
+
...options,
|
|
12305
12744
|
populate: populateArray ?? [],
|
|
12306
|
-
userId,
|
|
12307
|
-
scope,
|
|
12308
12745
|
}).then(res => {
|
|
12309
12746
|
return JSON.parse(res.result);
|
|
12310
12747
|
});
|
|
12311
12748
|
}
|
|
12312
|
-
updateOne(schemaName, filterQuery, query,
|
|
12313
|
-
|
|
12314
|
-
|
|
12315
|
-
|
|
12749
|
+
updateOne(schemaName, filterQuery, query, populateOrOptions, userId, scope) {
|
|
12750
|
+
const options = normalizePopulateAuthzOptions(populateOrOptions, userId, scope);
|
|
12751
|
+
let populateArray = options.populate;
|
|
12752
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12753
|
+
populateArray = [options.populate];
|
|
12316
12754
|
}
|
|
12317
12755
|
return this.client.updateOne({
|
|
12318
12756
|
schemaName,
|
|
12319
12757
|
filterQuery: this.processQuery(filterQuery),
|
|
12320
12758
|
query: this.processQuery(query),
|
|
12759
|
+
...options,
|
|
12321
12760
|
populate: populateArray ?? [],
|
|
12322
|
-
userId,
|
|
12323
|
-
scope,
|
|
12324
12761
|
}).then(res => {
|
|
12325
12762
|
return JSON.parse(res.result);
|
|
12326
12763
|
});
|
|
12327
12764
|
}
|
|
12328
|
-
replaceOne(schemaName, filterQuery, query,
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12765
|
+
replaceOne(schemaName, filterQuery, query, populateOrOptions, userId, scope) {
|
|
12766
|
+
const options = normalizePopulateAuthzOptions(populateOrOptions, userId, scope);
|
|
12767
|
+
let populateArray = options.populate;
|
|
12768
|
+
if (options.populate && !Array.isArray(options.populate)) {
|
|
12769
|
+
populateArray = [options.populate];
|
|
12332
12770
|
}
|
|
12333
12771
|
return this.client.replaceOne({
|
|
12334
12772
|
schemaName,
|
|
12335
12773
|
filterQuery: this.processQuery(filterQuery),
|
|
12336
12774
|
query: this.processQuery(query),
|
|
12775
|
+
...options,
|
|
12337
12776
|
populate: populateArray ?? [],
|
|
12338
|
-
userId,
|
|
12339
|
-
scope,
|
|
12340
12777
|
}).then(res => {
|
|
12341
12778
|
return JSON.parse(res.result);
|
|
12342
12779
|
});
|
|
12343
12780
|
}
|
|
12344
|
-
deleteOne(schemaName, query,
|
|
12781
|
+
deleteOne(schemaName, query, userIdOrOptions, scope) {
|
|
12782
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12345
12783
|
return this.client.deleteOne({
|
|
12346
12784
|
schemaName,
|
|
12347
12785
|
query: this.processQuery(query),
|
|
12348
|
-
|
|
12349
|
-
scope,
|
|
12786
|
+
...options,
|
|
12350
12787
|
}).then(res => {
|
|
12351
12788
|
return JSON.parse(res.result);
|
|
12352
12789
|
});
|
|
12353
12790
|
}
|
|
12354
|
-
deleteMany(schemaName, query,
|
|
12791
|
+
deleteMany(schemaName, query, userIdOrOptions, scope) {
|
|
12792
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12355
12793
|
return this.client.deleteMany({
|
|
12356
12794
|
schemaName,
|
|
12357
12795
|
query: this.processQuery(query),
|
|
12358
|
-
|
|
12359
|
-
scope,
|
|
12796
|
+
...options,
|
|
12360
12797
|
}).then(res => {
|
|
12361
12798
|
return JSON.parse(res.result);
|
|
12362
12799
|
});
|
|
12363
12800
|
}
|
|
12364
|
-
countDocuments(schemaName, query,
|
|
12801
|
+
countDocuments(schemaName, query, userIdOrOptions, scope) {
|
|
12802
|
+
const options = normalizeAuthzOptions(userIdOrOptions, scope);
|
|
12365
12803
|
return this.client.countDocuments({
|
|
12366
12804
|
schemaName,
|
|
12367
12805
|
query: this.processQuery(query),
|
|
12368
|
-
|
|
12369
|
-
scope,
|
|
12806
|
+
...options,
|
|
12370
12807
|
}).then(res => {
|
|
12371
12808
|
return JSON.parse(res.result);
|
|
12372
12809
|
});
|
|
@@ -12640,13 +13077,18 @@ class PushNotifications extends ConduitModule {
|
|
|
12640
13077
|
});
|
|
12641
13078
|
});
|
|
12642
13079
|
}
|
|
12643
|
-
sendNotification(sendTo, title,
|
|
13080
|
+
sendNotification(sendTo, title, bodyOrOptions, data, platform) {
|
|
13081
|
+
let options;
|
|
13082
|
+
if (typeof bodyOrOptions === 'string' || lodash.isNil(bodyOrOptions)) {
|
|
13083
|
+
options = { body: bodyOrOptions, data, platform };
|
|
13084
|
+
}
|
|
13085
|
+
else {
|
|
13086
|
+
options = bodyOrOptions;
|
|
13087
|
+
}
|
|
12644
13088
|
return this.client.sendNotification({
|
|
12645
13089
|
sendTo,
|
|
12646
13090
|
title,
|
|
12647
|
-
|
|
12648
|
-
data,
|
|
12649
|
-
platform,
|
|
13091
|
+
...options,
|
|
12650
13092
|
});
|
|
12651
13093
|
}
|
|
12652
13094
|
sendManyNotifications(notifications) {
|
|
@@ -12654,13 +13096,18 @@ class PushNotifications extends ConduitModule {
|
|
|
12654
13096
|
notifications,
|
|
12655
13097
|
});
|
|
12656
13098
|
}
|
|
12657
|
-
sendNotificationToManyDevices(sendTo, title,
|
|
13099
|
+
sendNotificationToManyDevices(sendTo, title, bodyOrOptions, data, platform) {
|
|
13100
|
+
let options;
|
|
13101
|
+
if (typeof bodyOrOptions === 'string' || lodash.isNil(bodyOrOptions)) {
|
|
13102
|
+
options = { body: bodyOrOptions, data, platform };
|
|
13103
|
+
}
|
|
13104
|
+
else {
|
|
13105
|
+
options = bodyOrOptions;
|
|
13106
|
+
}
|
|
12658
13107
|
return this.client.sendNotificationToManyDevices({
|
|
12659
13108
|
sendTo,
|
|
12660
13109
|
title,
|
|
12661
|
-
|
|
12662
|
-
data,
|
|
12663
|
-
platform,
|
|
13110
|
+
...options,
|
|
12664
13111
|
});
|
|
12665
13112
|
}
|
|
12666
13113
|
}
|
|
@@ -12762,8 +13209,11 @@ class Authentication extends ConduitModule {
|
|
|
12762
13209
|
userDelete(userId) {
|
|
12763
13210
|
return this.client.userDelete({ userId });
|
|
12764
13211
|
}
|
|
12765
|
-
userCreate(email, verify = false, password) {
|
|
12766
|
-
return this.client.userCreate({ email, verify, password });
|
|
13212
|
+
userCreate(email, verify = false, password, anonymousId) {
|
|
13213
|
+
return this.client.userCreate({ email, verify, password, anonymousId });
|
|
13214
|
+
}
|
|
13215
|
+
anonymousUserCreate(clientId) {
|
|
13216
|
+
return this.client.anonymousUserCreate({ clientId });
|
|
12767
13217
|
}
|
|
12768
13218
|
changePass(email, password) {
|
|
12769
13219
|
return this.client.changePass({ email, password });
|
|
@@ -13596,6 +14046,7 @@ exports.AdminDefinition = AdminDefinition;
|
|
|
13596
14046
|
exports.AdminRouterDefinition = AdminRouterDefinition;
|
|
13597
14047
|
exports.AllowedResourcesRequest = AllowedResourcesRequest;
|
|
13598
14048
|
exports.AllowedResourcesResponse = AllowedResourcesResponse;
|
|
14049
|
+
exports.AnonymousUserCreateRequest = AnonymousUserCreateRequest;
|
|
13599
14050
|
exports.Authentication = Authentication;
|
|
13600
14051
|
exports.AuthenticationDefinition = AuthenticationDefinition;
|
|
13601
14052
|
exports.Authorization = Authorization;
|
|
@@ -13650,6 +14101,8 @@ exports.FindRequest_SortEntry = FindRequest_SortEntry;
|
|
|
13650
14101
|
exports.GetConfigRequest = GetConfigRequest;
|
|
13651
14102
|
exports.GetConfigResponse = GetConfigResponse;
|
|
13652
14103
|
exports.GetDatabaseTypeResponse = GetDatabaseTypeResponse;
|
|
14104
|
+
exports.GetEmailStatusRequest = GetEmailStatusRequest;
|
|
14105
|
+
exports.GetEmailStatusResponse = GetEmailStatusResponse;
|
|
13653
14106
|
exports.GetFileDataResponse = GetFileDataResponse;
|
|
13654
14107
|
exports.GetFileRequest = GetFileRequest;
|
|
13655
14108
|
exports.GetFileUrlRequest = GetFileUrlRequest;
|
|
@@ -13705,6 +14158,8 @@ exports.RegisterTemplateRequest = RegisterTemplateRequest;
|
|
|
13705
14158
|
exports.RegisterTemplateResponse = RegisterTemplateResponse;
|
|
13706
14159
|
exports.Relation = Relation;
|
|
13707
14160
|
exports.Request = Request;
|
|
14161
|
+
exports.ResendEmailRequest = ResendEmailRequest;
|
|
14162
|
+
exports.ResendEmailResponse = ResendEmailResponse;
|
|
13708
14163
|
exports.Resource = Resource;
|
|
13709
14164
|
exports.ResourceAccessListRequest = ResourceAccessListRequest;
|
|
13710
14165
|
exports.ResourceAccessListResponse = ResourceAccessListResponse;
|