@coasys/ad4m 0.11.2-dev-multi-user → 0.11.2-dev-multi-user-email-2

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/lib/index.js CHANGED
@@ -4067,29 +4067,6 @@ AuthInfoInput = __decorate$b([
4067
4067
  InputType(),
4068
4068
  __metadata$b("design:paramtypes", [String, String, String, String, String, Array])
4069
4069
  ], AuthInfoInput);
4070
- let User = class User {
4071
- constructor(username, did, password) {
4072
- this.username = username;
4073
- this.did = did;
4074
- this.password = password;
4075
- }
4076
- };
4077
- __decorate$b([
4078
- Field(),
4079
- __metadata$b("design:type", String)
4080
- ], User.prototype, "username", void 0);
4081
- __decorate$b([
4082
- Field(),
4083
- __metadata$b("design:type", String)
4084
- ], User.prototype, "did", void 0);
4085
- __decorate$b([
4086
- Field(),
4087
- __metadata$b("design:type", String)
4088
- ], User.prototype, "password", void 0);
4089
- User = __decorate$b([
4090
- ObjectType(),
4091
- __metadata$b("design:paramtypes", [String, String, String])
4092
- ], User);
4093
4070
  let UserCreationResult = class UserCreationResult {
4094
4071
  constructor(did, success, error) {
4095
4072
  this.did = did;
@@ -6905,16 +6882,16 @@ class AgentClient {
6905
6882
  return agentSignMessage;
6906
6883
  }
6907
6884
  // Multi-user methods
6908
- async createUser(email, password) {
6885
+ async createUser(email, password, appInfo) {
6909
6886
  const { runtimeCreateUser } = unwrapApolloResult(await __classPrivateFieldGet$8(this, _AgentClient_apolloClient, "f").mutate({
6910
- mutation: gql `mutation runtimeCreateUser($email: String!, $password: String!) {
6911
- runtimeCreateUser(email: $email, password: $password) {
6887
+ mutation: gql `mutation runtimeCreateUser($email: String!, $password: String!, $appInfo: AuthInfoInput) {
6888
+ runtimeCreateUser(email: $email, password: $password, appInfo: $appInfo) {
6912
6889
  did
6913
6890
  success
6914
6891
  error
6915
6892
  }
6916
6893
  }`,
6917
- variables: { email, password },
6894
+ variables: { email, password, appInfo },
6918
6895
  }));
6919
6896
  return runtimeCreateUser;
6920
6897
  }
@@ -6927,6 +6904,29 @@ class AgentClient {
6927
6904
  }));
6928
6905
  return runtimeLoginUser;
6929
6906
  }
6907
+ async requestLoginVerification(email, appInfo) {
6908
+ const { runtimeRequestLoginVerification } = unwrapApolloResult(await __classPrivateFieldGet$8(this, _AgentClient_apolloClient, "f").mutate({
6909
+ mutation: gql `mutation runtimeRequestLoginVerification($email: String!, $appInfo: AuthInfoInput) {
6910
+ runtimeRequestLoginVerification(email: $email, appInfo: $appInfo) {
6911
+ success
6912
+ message
6913
+ requiresPassword
6914
+ isExistingUser
6915
+ }
6916
+ }`,
6917
+ variables: { email, appInfo },
6918
+ }));
6919
+ return runtimeRequestLoginVerification;
6920
+ }
6921
+ async verifyEmailCode(email, code, verificationType) {
6922
+ const { runtimeVerifyEmailCode } = unwrapApolloResult(await __classPrivateFieldGet$8(this, _AgentClient_apolloClient, "f").mutate({
6923
+ mutation: gql `mutation runtimeVerifyEmailCode($email: String!, $code: String!, $verificationType: String!) {
6924
+ runtimeVerifyEmailCode(email: $email, code: $code, verificationType: $verificationType)
6925
+ }`,
6926
+ variables: { email, code, verificationType },
6927
+ }));
6928
+ return runtimeVerifyEmailCode;
6929
+ }
6930
6930
  }
6931
6931
  _AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap();
6932
6932
 
@@ -7705,6 +7705,48 @@ class RuntimeClient {
7705
7705
  }));
7706
7706
  return runtimeListUsers;
7707
7707
  }
7708
+ async emailTestModeEnable() {
7709
+ const { runtimeEmailTestModeEnable } = unwrapApolloResult(await __classPrivateFieldGet$5(this, _RuntimeClient_apolloClient, "f").mutate({
7710
+ mutation: gql `mutation runtimeEmailTestModeEnable {
7711
+ runtimeEmailTestModeEnable
7712
+ }`
7713
+ }));
7714
+ return runtimeEmailTestModeEnable;
7715
+ }
7716
+ async emailTestModeDisable() {
7717
+ const { runtimeEmailTestModeDisable } = unwrapApolloResult(await __classPrivateFieldGet$5(this, _RuntimeClient_apolloClient, "f").mutate({
7718
+ mutation: gql `mutation runtimeEmailTestModeDisable {
7719
+ runtimeEmailTestModeDisable
7720
+ }`
7721
+ }));
7722
+ return runtimeEmailTestModeDisable;
7723
+ }
7724
+ async emailTestGetCode(email) {
7725
+ const { runtimeEmailTestGetCode } = unwrapApolloResult(await __classPrivateFieldGet$5(this, _RuntimeClient_apolloClient, "f").mutate({
7726
+ mutation: gql `mutation runtimeEmailTestGetCode($email: String!) {
7727
+ runtimeEmailTestGetCode(email: $email)
7728
+ }`,
7729
+ variables: { email }
7730
+ }));
7731
+ return runtimeEmailTestGetCode;
7732
+ }
7733
+ async emailTestClearCodes() {
7734
+ const { runtimeEmailTestClearCodes } = unwrapApolloResult(await __classPrivateFieldGet$5(this, _RuntimeClient_apolloClient, "f").mutate({
7735
+ mutation: gql `mutation runtimeEmailTestClearCodes {
7736
+ runtimeEmailTestClearCodes
7737
+ }`
7738
+ }));
7739
+ return runtimeEmailTestClearCodes;
7740
+ }
7741
+ async emailTestSetExpiry(email, verificationType, expiresAt) {
7742
+ const { runtimeEmailTestSetExpiry } = unwrapApolloResult(await __classPrivateFieldGet$5(this, _RuntimeClient_apolloClient, "f").mutate({
7743
+ mutation: gql `mutation runtimeEmailTestSetExpiry($email: String!, $verificationType: String!, $expiresAt: Int!) {
7744
+ runtimeEmailTestSetExpiry(email: $email, verificationType: $verificationType, expiresAt: $expiresAt)
7745
+ }`,
7746
+ variables: { email, verificationType, expiresAt }
7747
+ }));
7748
+ return runtimeEmailTestSetExpiry;
7749
+ }
7708
7750
  addNotificationTriggeredCallback(cb) {
7709
7751
  __classPrivateFieldGet$5(this, _RuntimeClient_notificationTriggeredCallbacks, "f").push(cb);
7710
7752
  }
@@ -16976,6 +17018,12 @@ type Mutation {
16976
17018
  perspectiveUpdateLink(batchId: String, newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
16977
17019
  runtimeAddFriends(dids: [String!]!): [String!]!
16978
17020
  runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
17021
+ runtimeCreateUser(appInfo: AuthInfoInput, email: String!, password: String!): UserCreationResult!
17022
+ runtimeEmailTestClearCodes: Boolean!
17023
+ runtimeEmailTestGetCode(email: String!): String
17024
+ runtimeEmailTestModeDisable: Boolean!
17025
+ runtimeEmailTestModeEnable: Boolean!
17026
+ runtimeEmailTestSetExpiry(email: String!, expiresAt: Float!, verificationType: String!): Boolean!
16979
17027
  runtimeExportDb(filePath: String!): Boolean!
16980
17028
  runtimeExportPerspective(filePath: String!, perspectiveUuid: String!): Boolean!
16981
17029
  runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
@@ -16983,16 +17031,20 @@ type Mutation {
16983
17031
  runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
16984
17032
  runtimeImportDb(filePath: String!): Boolean!
16985
17033
  runtimeImportPerspective(filePath: String!): Boolean!
17034
+ runtimeLoginUser(email: String!, password: String!): String!
16986
17035
  runtimeOpenLink(url: String!): Boolean!
16987
17036
  runtimeQuit: Boolean!
16988
17037
  runtimeRemoveFriends(dids: [String!]!): [String!]!
16989
17038
  runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
16990
17039
  runtimeRemoveNotification(id: String!): Boolean!
16991
17040
  runtimeRequestInstallNotification(notification: NotificationInput!): String!
17041
+ runtimeRequestLoginVerification(appInfo: AuthInfoInput, email: String!): VerificationRequestResult!
16992
17042
  runtimeRestartHolochain: Boolean!
16993
17043
  runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
16994
17044
  runtimeSetStatus(status: PerspectiveInput!): Boolean!
17045
+ runtimeTestEmail(to: String!): Boolean!
16995
17046
  runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
17047
+ runtimeVerifyEmailCode(code: String!, email: String!, verificationType: String!): String!
16996
17048
  }
16997
17049
 
16998
17050
  type Neighbourhood {
@@ -17170,6 +17222,12 @@ type TriggeredNotification {
17170
17222
  triggerMatch: String!
17171
17223
  }
17172
17224
 
17225
+ type UserCreationResult {
17226
+ did: String!
17227
+ error: String
17228
+ success: Boolean!
17229
+ }
17230
+
17173
17231
  type UserStatistics {
17174
17232
  did: String!
17175
17233
  email: String!
@@ -17177,6 +17235,13 @@ type UserStatistics {
17177
17235
  perspectiveCount: Int!
17178
17236
  }
17179
17237
 
17238
+ type VerificationRequestResult {
17239
+ isExistingUser: Boolean!
17240
+ message: String!
17241
+ requiresPassword: Boolean!
17242
+ success: Boolean!
17243
+ }
17244
+
17180
17245
  input VoiceActivityParamsInput {
17181
17246
  endThreshold: Float
17182
17247
  endWindow: Float
@@ -17486,6 +17551,27 @@ __decorate([
17486
17551
  UserStatistics = __decorate([
17487
17552
  ObjectType()
17488
17553
  ], UserStatistics);
17554
+ let VerificationRequestResult = class VerificationRequestResult {
17555
+ };
17556
+ __decorate([
17557
+ Field(),
17558
+ __metadata("design:type", Boolean)
17559
+ ], VerificationRequestResult.prototype, "success", void 0);
17560
+ __decorate([
17561
+ Field(),
17562
+ __metadata("design:type", String)
17563
+ ], VerificationRequestResult.prototype, "message", void 0);
17564
+ __decorate([
17565
+ Field(),
17566
+ __metadata("design:type", Boolean)
17567
+ ], VerificationRequestResult.prototype, "requiresPassword", void 0);
17568
+ __decorate([
17569
+ Field(),
17570
+ __metadata("design:type", Boolean)
17571
+ ], VerificationRequestResult.prototype, "isExistingUser", void 0);
17572
+ VerificationRequestResult = __decorate([
17573
+ ObjectType()
17574
+ ], VerificationRequestResult);
17489
17575
  /**
17490
17576
  * Resolver classes are used here to define the GraphQL schema
17491
17577
  * (through the type-graphql annotations)
@@ -17649,6 +17735,51 @@ let RuntimeResolver = class RuntimeResolver {
17649
17735
  perspectiveCount: 5
17650
17736
  }];
17651
17737
  }
17738
+ runtimeRequestLoginVerification(email, appInfo) {
17739
+ // For testing: simulate existing user
17740
+ return {
17741
+ success: true,
17742
+ message: "Verification email sent",
17743
+ requiresPassword: false,
17744
+ isExistingUser: true
17745
+ };
17746
+ }
17747
+ runtimeVerifyEmailCode(email, code, verificationType) {
17748
+ // For testing: return a test JWT token
17749
+ return "test-jwt-token-from-email-verification";
17750
+ }
17751
+ runtimeTestEmail(to) {
17752
+ // For testing: simulate successful email send
17753
+ return true;
17754
+ }
17755
+ runtimeCreateUser(email, password, appInfo) {
17756
+ // For testing: simulate successful user creation (email verification flow)
17757
+ return new UserCreationResult("did:key:test123", true);
17758
+ }
17759
+ runtimeLoginUser(email, password) {
17760
+ // For testing: return a test JWT token
17761
+ return "test-jwt-token-from-password-login";
17762
+ }
17763
+ runtimeEmailTestModeEnable() {
17764
+ // For testing: enable test mode
17765
+ return true;
17766
+ }
17767
+ runtimeEmailTestModeDisable() {
17768
+ // For testing: disable test mode
17769
+ return true;
17770
+ }
17771
+ runtimeEmailTestGetCode(email) {
17772
+ // For testing: return a mock code
17773
+ return "123456";
17774
+ }
17775
+ runtimeEmailTestClearCodes() {
17776
+ // For testing: clear codes
17777
+ return true;
17778
+ }
17779
+ runtimeEmailTestSetExpiry(email, verificationType, expiresAt) {
17780
+ // For testing: simulate setting expiry (no-op in mock)
17781
+ return true;
17782
+ }
17652
17783
  };
17653
17784
  __decorate([
17654
17785
  Mutation(),
@@ -17901,6 +18032,81 @@ __decorate([
17901
18032
  __metadata("design:paramtypes", []),
17902
18033
  __metadata("design:returntype", Array)
17903
18034
  ], RuntimeResolver.prototype, "runtimeListUsers", null);
18035
+ __decorate([
18036
+ Mutation(),
18037
+ __param(0, Arg()),
18038
+ __param(1, Arg()),
18039
+ __metadata("design:type", Function),
18040
+ __metadata("design:paramtypes", [String, AuthInfoInput]),
18041
+ __metadata("design:returntype", VerificationRequestResult)
18042
+ ], RuntimeResolver.prototype, "runtimeRequestLoginVerification", null);
18043
+ __decorate([
18044
+ Mutation(),
18045
+ __param(0, Arg()),
18046
+ __param(1, Arg()),
18047
+ __param(2, Arg()),
18048
+ __metadata("design:type", Function),
18049
+ __metadata("design:paramtypes", [String, String, String]),
18050
+ __metadata("design:returntype", String)
18051
+ ], RuntimeResolver.prototype, "runtimeVerifyEmailCode", null);
18052
+ __decorate([
18053
+ Mutation(),
18054
+ __param(0, Arg()),
18055
+ __metadata("design:type", Function),
18056
+ __metadata("design:paramtypes", [String]),
18057
+ __metadata("design:returntype", Boolean)
18058
+ ], RuntimeResolver.prototype, "runtimeTestEmail", null);
18059
+ __decorate([
18060
+ Mutation(),
18061
+ __param(0, Arg()),
18062
+ __param(1, Arg()),
18063
+ __param(2, Arg()),
18064
+ __metadata("design:type", Function),
18065
+ __metadata("design:paramtypes", [String, String, AuthInfoInput]),
18066
+ __metadata("design:returntype", UserCreationResult)
18067
+ ], RuntimeResolver.prototype, "runtimeCreateUser", null);
18068
+ __decorate([
18069
+ Mutation(),
18070
+ __param(0, Arg()),
18071
+ __param(1, Arg()),
18072
+ __metadata("design:type", Function),
18073
+ __metadata("design:paramtypes", [String, String]),
18074
+ __metadata("design:returntype", String)
18075
+ ], RuntimeResolver.prototype, "runtimeLoginUser", null);
18076
+ __decorate([
18077
+ Mutation(),
18078
+ __metadata("design:type", Function),
18079
+ __metadata("design:paramtypes", []),
18080
+ __metadata("design:returntype", Boolean)
18081
+ ], RuntimeResolver.prototype, "runtimeEmailTestModeEnable", null);
18082
+ __decorate([
18083
+ Mutation(),
18084
+ __metadata("design:type", Function),
18085
+ __metadata("design:paramtypes", []),
18086
+ __metadata("design:returntype", Boolean)
18087
+ ], RuntimeResolver.prototype, "runtimeEmailTestModeDisable", null);
18088
+ __decorate([
18089
+ Mutation(),
18090
+ __param(0, Arg()),
18091
+ __metadata("design:type", Function),
18092
+ __metadata("design:paramtypes", [String]),
18093
+ __metadata("design:returntype", String)
18094
+ ], RuntimeResolver.prototype, "runtimeEmailTestGetCode", null);
18095
+ __decorate([
18096
+ Mutation(),
18097
+ __metadata("design:type", Function),
18098
+ __metadata("design:paramtypes", []),
18099
+ __metadata("design:returntype", Boolean)
18100
+ ], RuntimeResolver.prototype, "runtimeEmailTestClearCodes", null);
18101
+ __decorate([
18102
+ Mutation(),
18103
+ __param(0, Arg()),
18104
+ __param(1, Arg()),
18105
+ __param(2, Arg()),
18106
+ __metadata("design:type", Function),
18107
+ __metadata("design:paramtypes", [String, String, Number]),
18108
+ __metadata("design:returntype", Boolean)
18109
+ ], RuntimeResolver.prototype, "runtimeEmailTestSetExpiry", null);
17904
18110
  RuntimeResolver = __decorate([
17905
18111
  Resolver()
17906
18112
  ], RuntimeResolver);
@@ -20486,4 +20692,4 @@ class ModelQueryBuilder {
20486
20692
  }
20487
20693
  }
20488
20694
 
20489
- export { AIClient, AIModelLoadingStatus, AIPromptExamples, AIPromptExamplesInput, AITask, AITaskInput, Ad4mClient, Ad4mModel, Agent, AgentClient, AgentExpression, AgentSignature, AgentStatus, Apps, AuthInfo, AuthInfoInput, Capability, CapabilityInput, Collection, Dna, EntanglementProof, EntanglementProofInput, ExceptionInfo, ExceptionType, Expression, ExpressionGeneric, ExpressionGenericInput, ExpressionProof, ExpressionProofInput, ExpressionRef, ExpressionRendered, Flag, Icon, ImportResult, ImportStats, InstanceQuery, InteractionCall, InteractionMeta, InteractionParameter, LanguageExpression, LanguageHandle, LanguageLanguageInput, LanguageMeta, LanguageMetaInput, LanguageMetaInternal, LanguageRef, Link, LinkExpression, LinkExpressionInput, LinkExpressionMutations, LinkExpressionUpdated, LinkInput, LinkMutations, LinkQuery, Literal, ModelOptions, ModelQueryBuilder, Neighbourhood, NeighbourhoodExpression, NeighbourhoodProxy, Notification, NotificationInput, OnlineAgent, Optional, Perspective, PerspectiveAction, PerspectiveDiff, PerspectiveDiffExpression, PerspectiveExpression, PerspectiveHandle, PerspectiveInput, PerspectiveProxy, PerspectiveState, PerspectiveUnsignedInput, Property, QuerySubscriptionProxy, ReadOnly, Resource, ResourceInput, RuntimeInfo, SMART_LITERAL_CONTENT_PREDICATE, SentMessage, SmartLiteral, Subject, TriggeredNotification, User, UserCreationResult, UserStatistics, addLink, capSentence, exprRef2String, formatList, hasLink, isExpression, isLink, linkEqual, makeRandomPrologAtom, parseExprUrl, typeDefsString };
20695
+ export { AIClient, AIModelLoadingStatus, AIPromptExamples, AIPromptExamplesInput, AITask, AITaskInput, Ad4mClient, Ad4mModel, Agent, AgentClient, AgentExpression, AgentSignature, AgentStatus, Apps, AuthInfo, AuthInfoInput, Capability, CapabilityInput, Collection, Dna, EntanglementProof, EntanglementProofInput, ExceptionInfo, ExceptionType, Expression, ExpressionGeneric, ExpressionGenericInput, ExpressionProof, ExpressionProofInput, ExpressionRef, ExpressionRendered, Flag, Icon, ImportResult, ImportStats, InstanceQuery, InteractionCall, InteractionMeta, InteractionParameter, LanguageExpression, LanguageHandle, LanguageLanguageInput, LanguageMeta, LanguageMetaInput, LanguageMetaInternal, LanguageRef, Link, LinkExpression, LinkExpressionInput, LinkExpressionMutations, LinkExpressionUpdated, LinkInput, LinkMutations, LinkQuery, Literal, ModelOptions, ModelQueryBuilder, Neighbourhood, NeighbourhoodExpression, NeighbourhoodProxy, Notification, NotificationInput, OnlineAgent, Optional, Perspective, PerspectiveAction, PerspectiveDiff, PerspectiveDiffExpression, PerspectiveExpression, PerspectiveHandle, PerspectiveInput, PerspectiveProxy, PerspectiveState, PerspectiveUnsignedInput, Property, QuerySubscriptionProxy, ReadOnly, Resource, ResourceInput, RuntimeInfo, SMART_LITERAL_CONTENT_PREDICATE, SentMessage, SmartLiteral, Subject, TriggeredNotification, UserCreationResult, UserStatistics, VerificationRequestResult, addLink, capSentence, exprRef2String, formatList, hasLink, isExpression, isLink, linkEqual, makeRandomPrologAtom, parseExprUrl, typeDefsString };
@@ -101,12 +101,6 @@ export declare class AuthInfoInput {
101
101
  capabilities?: CapabilityInput[];
102
102
  constructor(appName: string, appDesc: string, appDomain: string, appUrl?: string, appIconPath?: string, capabilities?: CapabilityInput[]);
103
103
  }
104
- export declare class User {
105
- username: string;
106
- did: string;
107
- password: string;
108
- constructor(username: string, did: string, password: string);
109
- }
110
104
  export declare class UserCreationResult {
111
105
  did: string;
112
106
  success: boolean;
@@ -335,30 +335,6 @@ AuthInfoInput = __decorate([
335
335
  __metadata("design:paramtypes", [String, String, String, String, String, Array])
336
336
  ], AuthInfoInput);
337
337
  export { AuthInfoInput };
338
- let User = class User {
339
- constructor(username, did, password) {
340
- this.username = username;
341
- this.did = did;
342
- this.password = password;
343
- }
344
- };
345
- __decorate([
346
- Field(),
347
- __metadata("design:type", String)
348
- ], User.prototype, "username", void 0);
349
- __decorate([
350
- Field(),
351
- __metadata("design:type", String)
352
- ], User.prototype, "did", void 0);
353
- __decorate([
354
- Field(),
355
- __metadata("design:type", String)
356
- ], User.prototype, "password", void 0);
357
- User = __decorate([
358
- ObjectType(),
359
- __metadata("design:paramtypes", [String, String, String])
360
- ], User);
361
- export { User };
362
338
  let UserCreationResult = class UserCreationResult {
363
339
  constructor(did, success, error) {
364
340
  this.did = did;
@@ -3,6 +3,7 @@ import { PerspectiveInput } from "../perspectives/Perspective";
3
3
  import { Agent, Apps, AuthInfoInput, EntanglementProof, EntanglementProofInput, UserCreationResult } from "./Agent";
4
4
  import { AgentStatus } from "./AgentStatus";
5
5
  import { LinkMutations } from "../links/Links";
6
+ import { VerificationRequestResult } from "../runtime/RuntimeResolver";
6
7
  export interface InitializeArgs {
7
8
  did: string;
8
9
  didDocument: string;
@@ -54,6 +55,8 @@ export declare class AgentClient {
54
55
  revokeToken(requestId: string): Promise<Apps[]>;
55
56
  isLocked(): Promise<boolean>;
56
57
  signMessage(message: string): Promise<string>;
57
- createUser(email: string, password: string): Promise<UserCreationResult>;
58
+ createUser(email: string, password: string, appInfo?: AuthInfoInput): Promise<UserCreationResult>;
58
59
  loginUser(email: string, password: string): Promise<string>;
60
+ requestLoginVerification(email: string, appInfo?: AuthInfoInput): Promise<VerificationRequestResult>;
61
+ verifyEmailCode(email: string, code: string, verificationType: string): Promise<string>;
59
62
  }
@@ -428,16 +428,16 @@ export class AgentClient {
428
428
  return agentSignMessage;
429
429
  }
430
430
  // Multi-user methods
431
- async createUser(email, password) {
431
+ async createUser(email, password, appInfo) {
432
432
  const { runtimeCreateUser } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").mutate({
433
- mutation: gql `mutation runtimeCreateUser($email: String!, $password: String!) {
434
- runtimeCreateUser(email: $email, password: $password) {
433
+ mutation: gql `mutation runtimeCreateUser($email: String!, $password: String!, $appInfo: AuthInfoInput) {
434
+ runtimeCreateUser(email: $email, password: $password, appInfo: $appInfo) {
435
435
  did
436
436
  success
437
437
  error
438
438
  }
439
439
  }`,
440
- variables: { email, password },
440
+ variables: { email, password, appInfo },
441
441
  }));
442
442
  return runtimeCreateUser;
443
443
  }
@@ -450,5 +450,28 @@ export class AgentClient {
450
450
  }));
451
451
  return runtimeLoginUser;
452
452
  }
453
+ async requestLoginVerification(email, appInfo) {
454
+ const { runtimeRequestLoginVerification } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").mutate({
455
+ mutation: gql `mutation runtimeRequestLoginVerification($email: String!, $appInfo: AuthInfoInput) {
456
+ runtimeRequestLoginVerification(email: $email, appInfo: $appInfo) {
457
+ success
458
+ message
459
+ requiresPassword
460
+ isExistingUser
461
+ }
462
+ }`,
463
+ variables: { email, appInfo },
464
+ }));
465
+ return runtimeRequestLoginVerification;
466
+ }
467
+ async verifyEmailCode(email, code, verificationType) {
468
+ const { runtimeVerifyEmailCode } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").mutate({
469
+ mutation: gql `mutation runtimeVerifyEmailCode($email: String!, $code: String!, $verificationType: String!) {
470
+ runtimeVerifyEmailCode(email: $email, code: $code, verificationType: $verificationType)
471
+ }`,
472
+ variables: { email, code, verificationType },
473
+ }));
474
+ return runtimeVerifyEmailCode;
475
+ }
453
476
  }
454
477
  _AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap();
@@ -42,6 +42,11 @@ export declare class RuntimeClient {
42
42
  multiUserEnabled(): Promise<boolean>;
43
43
  setMultiUserEnabled(enabled: boolean): Promise<boolean>;
44
44
  listUsers(): Promise<UserStatistics[]>;
45
+ emailTestModeEnable(): Promise<boolean>;
46
+ emailTestModeDisable(): Promise<boolean>;
47
+ emailTestGetCode(email: string): Promise<string | null>;
48
+ emailTestClearCodes(): Promise<boolean>;
49
+ emailTestSetExpiry(email: string, verificationType: string, expiresAt: number): Promise<boolean>;
45
50
  addNotificationTriggeredCallback(cb: NotificationTriggeredCallback): void;
46
51
  subscribeNotificationTriggered(): void;
47
52
  addMessageCallback(cb: MessageCallback): void;
@@ -381,6 +381,48 @@ export class RuntimeClient {
381
381
  }));
382
382
  return runtimeListUsers;
383
383
  }
384
+ async emailTestModeEnable() {
385
+ const { runtimeEmailTestModeEnable } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
386
+ mutation: gql `mutation runtimeEmailTestModeEnable {
387
+ runtimeEmailTestModeEnable
388
+ }`
389
+ }));
390
+ return runtimeEmailTestModeEnable;
391
+ }
392
+ async emailTestModeDisable() {
393
+ const { runtimeEmailTestModeDisable } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
394
+ mutation: gql `mutation runtimeEmailTestModeDisable {
395
+ runtimeEmailTestModeDisable
396
+ }`
397
+ }));
398
+ return runtimeEmailTestModeDisable;
399
+ }
400
+ async emailTestGetCode(email) {
401
+ const { runtimeEmailTestGetCode } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
402
+ mutation: gql `mutation runtimeEmailTestGetCode($email: String!) {
403
+ runtimeEmailTestGetCode(email: $email)
404
+ }`,
405
+ variables: { email }
406
+ }));
407
+ return runtimeEmailTestGetCode;
408
+ }
409
+ async emailTestClearCodes() {
410
+ const { runtimeEmailTestClearCodes } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
411
+ mutation: gql `mutation runtimeEmailTestClearCodes {
412
+ runtimeEmailTestClearCodes
413
+ }`
414
+ }));
415
+ return runtimeEmailTestClearCodes;
416
+ }
417
+ async emailTestSetExpiry(email, verificationType, expiresAt) {
418
+ const { runtimeEmailTestSetExpiry } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
419
+ mutation: gql `mutation runtimeEmailTestSetExpiry($email: String!, $verificationType: String!, $expiresAt: Int!) {
420
+ runtimeEmailTestSetExpiry(email: $email, verificationType: $verificationType, expiresAt: $expiresAt)
421
+ }`,
422
+ variables: { email, verificationType, expiresAt }
423
+ }));
424
+ return runtimeEmailTestSetExpiry;
425
+ }
384
426
  addNotificationTriggeredCallback(cb) {
385
427
  __classPrivateFieldGet(this, _RuntimeClient_notificationTriggeredCallbacks, "f").push(cb);
386
428
  }
@@ -1,5 +1,6 @@
1
1
  import { Perspective, PerspectiveExpression, PerspectiveInput } from "../perspectives/Perspective";
2
2
  import { ExceptionType } from "../Exception";
3
+ import { UserCreationResult, AuthInfoInput } from "../agent/Agent";
3
4
  export declare class SentMessage {
4
5
  recipient: string;
5
6
  message: PerspectiveExpression;
@@ -68,6 +69,12 @@ export declare class UserStatistics {
68
69
  lastSeen?: string;
69
70
  perspectiveCount: number;
70
71
  }
72
+ export declare class VerificationRequestResult {
73
+ success: boolean;
74
+ message: string;
75
+ requiresPassword: boolean;
76
+ isExistingUser: boolean;
77
+ }
71
78
  /**
72
79
  * Resolver classes are used here to define the GraphQL schema
73
80
  * (through the type-graphql annotations)
@@ -112,4 +119,14 @@ export default class RuntimeResolver {
112
119
  runtimeMultiUserEnabled(): boolean;
113
120
  runtimeSetMultiUserEnabled(enabled: boolean): boolean;
114
121
  runtimeListUsers(): UserStatistics[];
122
+ runtimeRequestLoginVerification(email: string, appInfo?: AuthInfoInput): VerificationRequestResult;
123
+ runtimeVerifyEmailCode(email: string, code: string, verificationType: string): string;
124
+ runtimeTestEmail(to: string): boolean;
125
+ runtimeCreateUser(email: string, password: string, appInfo?: AuthInfoInput): UserCreationResult;
126
+ runtimeLoginUser(email: string, password: string): string;
127
+ runtimeEmailTestModeEnable(): boolean;
128
+ runtimeEmailTestModeDisable(): boolean;
129
+ runtimeEmailTestGetCode(email: string): string | null;
130
+ runtimeEmailTestClearCodes(): boolean;
131
+ runtimeEmailTestSetExpiry(email: string, verificationType: string, expiresAt: number): boolean;
115
132
  }