initializeEndpoints method
Initializes all endpoints that are connected to the dispatch.
Implementation
@override
void initializeEndpoints(_i1.Server server) {
var endpoints = <String, _i1.Endpoint>{
'admin': _i2.AdminEndpoint()
..initialize(
server,
'admin',
'serverpod_auth',
),
'apple': _i3.AppleEndpoint()
..initialize(
server,
'apple',
'serverpod_auth',
),
'email': _i4.EmailEndpoint()
..initialize(
server,
'email',
'serverpod_auth',
),
'firebase': _i5.FirebaseEndpoint()
..initialize(
server,
'firebase',
'serverpod_auth',
),
'google': _i6.GoogleEndpoint()
..initialize(
server,
'google',
'serverpod_auth',
),
'status': _i7.StatusEndpoint()
..initialize(
server,
'status',
'serverpod_auth',
),
'user': _i8.UserEndpoint()
..initialize(
server,
'user',
'serverpod_auth',
),
};
connectors['admin'] = _i1.EndpointConnector(
name: 'admin',
endpoint: endpoints['admin']!,
methodConnectors: {
'getUserInfo': _i1.MethodConnector(
name: 'getUserInfo',
params: {
'userId': _i1.ParameterDescription(
name: 'userId',
type: _i1.getType<int>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['admin'] as _i2.AdminEndpoint).getUserInfo(
session,
params['userId'],
),
)
},
);
connectors['apple'] = _i1.EndpointConnector(
name: 'apple',
endpoint: endpoints['apple']!,
methodConnectors: {
'authenticate': _i1.MethodConnector(
name: 'authenticate',
params: {
'authInfo': _i1.ParameterDescription(
name: 'authInfo',
type: _i1.getType<_i9.AppleAuthInfo>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['apple'] as _i3.AppleEndpoint).authenticate(
session,
params['authInfo'],
),
)
},
);
connectors['email'] = _i1.EndpointConnector(
name: 'email',
endpoint: endpoints['email']!,
methodConnectors: {
'authenticate': _i1.MethodConnector(
name: 'authenticate',
params: {
'email': _i1.ParameterDescription(
name: 'email',
type: _i1.getType<String>(),
nullable: false,
),
'password': _i1.ParameterDescription(
name: 'password',
type: _i1.getType<String>(),
nullable: false,
),
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint).authenticate(
session,
params['email'],
params['password'],
),
),
'changePassword': _i1.MethodConnector(
name: 'changePassword',
params: {
'oldPassword': _i1.ParameterDescription(
name: 'oldPassword',
type: _i1.getType<String>(),
nullable: false,
),
'newPassword': _i1.ParameterDescription(
name: 'newPassword',
type: _i1.getType<String>(),
nullable: false,
),
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint).changePassword(
session,
params['oldPassword'],
params['newPassword'],
),
),
'initiatePasswordReset': _i1.MethodConnector(
name: 'initiatePasswordReset',
params: {
'email': _i1.ParameterDescription(
name: 'email',
type: _i1.getType<String>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint).initiatePasswordReset(
session,
params['email'],
),
),
'verifyEmailPasswordReset': _i1.MethodConnector(
name: 'verifyEmailPasswordReset',
params: {
'verificationCode': _i1.ParameterDescription(
name: 'verificationCode',
type: _i1.getType<String>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint)
.verifyEmailPasswordReset(
session,
params['verificationCode'],
),
),
'resetPassword': _i1.MethodConnector(
name: 'resetPassword',
params: {
'verificationCode': _i1.ParameterDescription(
name: 'verificationCode',
type: _i1.getType<String>(),
nullable: false,
),
'password': _i1.ParameterDescription(
name: 'password',
type: _i1.getType<String>(),
nullable: false,
),
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint).resetPassword(
session,
params['verificationCode'],
params['password'],
),
),
'createAccountRequest': _i1.MethodConnector(
name: 'createAccountRequest',
params: {
'userName': _i1.ParameterDescription(
name: 'userName',
type: _i1.getType<String>(),
nullable: false,
),
'email': _i1.ParameterDescription(
name: 'email',
type: _i1.getType<String>(),
nullable: false,
),
'password': _i1.ParameterDescription(
name: 'password',
type: _i1.getType<String>(),
nullable: false,
),
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint).createAccountRequest(
session,
params['userName'],
params['email'],
params['password'],
),
),
'createAccount': _i1.MethodConnector(
name: 'createAccount',
params: {
'email': _i1.ParameterDescription(
name: 'email',
type: _i1.getType<String>(),
nullable: false,
),
'verificationCode': _i1.ParameterDescription(
name: 'verificationCode',
type: _i1.getType<String>(),
nullable: false,
),
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['email'] as _i4.EmailEndpoint).createAccount(
session,
params['email'],
params['verificationCode'],
),
),
},
);
connectors['firebase'] = _i1.EndpointConnector(
name: 'firebase',
endpoint: endpoints['firebase']!,
methodConnectors: {
'authenticate': _i1.MethodConnector(
name: 'authenticate',
params: {
'idToken': _i1.ParameterDescription(
name: 'idToken',
type: _i1.getType<String>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['firebase'] as _i5.FirebaseEndpoint).authenticate(
session,
params['idToken'],
),
)
},
);
connectors['google'] = _i1.EndpointConnector(
name: 'google',
endpoint: endpoints['google']!,
methodConnectors: {
'authenticateWithServerAuthCode': _i1.MethodConnector(
name: 'authenticateWithServerAuthCode',
params: {
'authenticationCode': _i1.ParameterDescription(
name: 'authenticationCode',
type: _i1.getType<String>(),
nullable: false,
),
'redirectUri': _i1.ParameterDescription(
name: 'redirectUri',
type: _i1.getType<String?>(),
nullable: true,
),
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['google'] as _i6.GoogleEndpoint)
.authenticateWithServerAuthCode(
session,
params['authenticationCode'],
params['redirectUri'],
),
),
'authenticateWithIdToken': _i1.MethodConnector(
name: 'authenticateWithIdToken',
params: {
'idToken': _i1.ParameterDescription(
name: 'idToken',
type: _i1.getType<String>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['google'] as _i6.GoogleEndpoint)
.authenticateWithIdToken(
session,
params['idToken'],
),
),
},
);
connectors['status'] = _i1.EndpointConnector(
name: 'status',
endpoint: endpoints['status']!,
methodConnectors: {
'isSignedIn': _i1.MethodConnector(
name: 'isSignedIn',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['status'] as _i7.StatusEndpoint).isSignedIn(session),
),
'signOut': _i1.MethodConnector(
name: 'signOut',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['status'] as _i7.StatusEndpoint).signOut(session),
),
'getUserInfo': _i1.MethodConnector(
name: 'getUserInfo',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['status'] as _i7.StatusEndpoint).getUserInfo(session),
),
'getUserSettingsConfig': _i1.MethodConnector(
name: 'getUserSettingsConfig',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['status'] as _i7.StatusEndpoint)
.getUserSettingsConfig(session),
),
},
);
connectors['user'] = _i1.EndpointConnector(
name: 'user',
endpoint: endpoints['user']!,
methodConnectors: {
'removeUserImage': _i1.MethodConnector(
name: 'removeUserImage',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['user'] as _i8.UserEndpoint).removeUserImage(session),
),
'setUserImage': _i1.MethodConnector(
name: 'setUserImage',
params: {
'image': _i1.ParameterDescription(
name: 'image',
type: _i1.getType<_i10.ByteData>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['user'] as _i8.UserEndpoint).setUserImage(
session,
params['image'],
),
),
'changeUserName': _i1.MethodConnector(
name: 'changeUserName',
params: {
'userName': _i1.ParameterDescription(
name: 'userName',
type: _i1.getType<String>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['user'] as _i8.UserEndpoint).changeUserName(
session,
params['userName'],
),
),
},
);
}