The routing endpoint plans a route through the waypoints for one of six profiles, for the people signed in, at most 50 waypoints and 30 plans a person a minute, nothing kept or logged; refused without BROUTER_URL. BRouter's GeoJSON is read into points, elevations, climb and descent above 3 m, turn hints and stretches by surface. Train's running profile for BRouter, halkyon-run.brf, is a first guess not yet tried on BRouter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
1137 lines
35 KiB
Dart
1137 lines
35 KiB
Dart
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
|
|
/* To generate run: "serverpod generate" */
|
|
|
|
// ignore_for_file: implementation_imports
|
|
// ignore_for_file: library_private_types_in_public_api
|
|
// ignore_for_file: non_constant_identifier_names
|
|
// ignore_for_file: public_member_api_docs
|
|
// ignore_for_file: type_literal_in_constant_pattern
|
|
// ignore_for_file: use_super_parameters
|
|
// ignore_for_file: invalid_use_of_internal_member
|
|
// ignore_for_file: dead_code, unnecessary_type_check
|
|
|
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
|
import 'package:halkyon_base_server/halkyon_base_server.dart' as _ik8molhd;
|
|
import 'package:halkyon_oidc_server/halkyon_oidc_server.dart' as _ipoqfiqr;
|
|
import 'package:halkyon_train_server/src/generated/routing/route_point.dart'
|
|
as _is4pcfub;
|
|
import 'package:serverpod/protocol.dart' as _isp;
|
|
import 'package:serverpod/serverpod.dart' as _is;
|
|
import 'package:serverpod_auth_core_server/serverpod_auth_core_server.dart'
|
|
as _iacs;
|
|
import 'package:serverpod_auth_idp_server/serverpod_auth_idp_server.dart'
|
|
as _iais;
|
|
import 'package:serverpod_offline_sync_server/serverpod_offline_sync_server.dart'
|
|
as _izehhkf5;
|
|
import 'day/day.dart' as _ikmv9f3y;
|
|
import 'day/day_series.dart' as _ir1ofny6;
|
|
import 'day/night.dart' as _i17cgxdf;
|
|
import 'firmware/loop_firmware.dart' as _i4qollgq;
|
|
import 'firmware/loop_firmware_refused.dart' as _ipcwdy0l;
|
|
import 'map/map_source.dart' as _ikw0qg8x;
|
|
import 'plan/plan.dart' as _i45prw73;
|
|
import 'privacy/content_key.dart' as _imed3x5d;
|
|
import 'profile/profile.dart' as _ia5j8fch;
|
|
import 'routing/planned_route.dart' as _ikjgxraq;
|
|
import 'routing/route_hint.dart' as _if6974nb;
|
|
import 'routing/route_point.dart' as _isqtfus6;
|
|
import 'routing/route_profile.dart' as _ifl4j5ep;
|
|
import 'routing/route_refused.dart' as _ix4aepwk;
|
|
import 'routing/route_stretch.dart' as _ic7f85bc;
|
|
import 'workout/workout.dart' as _i5b9b17z;
|
|
import 'workout/workout_series.dart' as _i92mefto;
|
|
export 'day/day.dart';
|
|
export 'day/day_series.dart';
|
|
export 'day/night.dart';
|
|
export 'firmware/loop_firmware.dart';
|
|
export 'firmware/loop_firmware_refused.dart';
|
|
export 'map/map_source.dart';
|
|
export 'plan/plan.dart';
|
|
export 'privacy/content_key.dart';
|
|
export 'profile/profile.dart';
|
|
export 'routing/planned_route.dart';
|
|
export 'routing/route_hint.dart';
|
|
export 'routing/route_point.dart';
|
|
export 'routing/route_profile.dart';
|
|
export 'routing/route_refused.dart';
|
|
export 'routing/route_stretch.dart';
|
|
export 'workout/workout.dart';
|
|
export 'workout/workout_series.dart';
|
|
export 'sync_tables.dart';
|
|
|
|
class Protocol extends _is.DatabaseSerializationManager {
|
|
Protocol._();
|
|
|
|
factory Protocol() => _instance;
|
|
|
|
static final Protocol _instance = Protocol._().._registerHostProtocols();
|
|
|
|
static List<_isp.TableDefinition> get targetTableDefinitions => [
|
|
_isp.TableDefinition(
|
|
name: 'content_key',
|
|
dartName: 'ContentKey',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'dataKeyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: false,
|
|
dartType: 'String',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'sealedKey',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'content_key_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'content_key_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'day',
|
|
dartName: 'Day',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'day_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'day_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'day_series',
|
|
dartName: 'DaySeries',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'dayId',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'day_series_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'day_series_fk_1',
|
|
columns: ['dayId'],
|
|
referenceTable: 'day',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
deferrable: _isp.DeferrableConstraint.initiallyDeferred,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'day_series_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
_isp.IndexDefinition(
|
|
indexName: 'day_series_day_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'dayId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'night',
|
|
dartName: 'Night',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'night_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'night_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'plan',
|
|
dartName: 'Plan',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'plan_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'plan_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'profile',
|
|
dartName: 'Profile',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'profile_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'profile_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'workout',
|
|
dartName: 'Workout',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'workout_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'workout_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
_isp.TableDefinition(
|
|
name: 'workout_series',
|
|
dartName: 'WorkoutSeries',
|
|
schema: 'public',
|
|
module: 'halkyon_train',
|
|
columns: [
|
|
_isp.ColumnDefinition(
|
|
name: 'id',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue?',
|
|
columnDefault: 'random_v7',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'spaceId',
|
|
columnType: _isp.ColumnType.bigint,
|
|
isNullable: true,
|
|
dartType: 'int?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'workoutId',
|
|
columnType: _isp.ColumnType.uuid,
|
|
isNullable: false,
|
|
dartType: 'UuidValue',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'keyId',
|
|
columnType: _isp.ColumnType.text,
|
|
isNullable: true,
|
|
dartType: 'String?',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'payload',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: false,
|
|
dartType: 'dart:typed_data:ByteData',
|
|
),
|
|
_isp.ColumnDefinition(
|
|
name: 'nonce',
|
|
columnType: _isp.ColumnType.bytea,
|
|
isNullable: true,
|
|
dartType: 'dart:typed_data:ByteData?',
|
|
),
|
|
],
|
|
foreignKeys: [
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'workout_series_fk_0',
|
|
columns: ['spaceId'],
|
|
referenceTable: 'offline_sync_spaces',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
),
|
|
_isp.ForeignKeyDefinition(
|
|
constraintName: 'workout_series_fk_1',
|
|
columns: ['workoutId'],
|
|
referenceTable: 'workout',
|
|
referenceTableSchema: 'public',
|
|
referenceColumns: ['id'],
|
|
onUpdate: _isp.ForeignKeyAction.noAction,
|
|
onDelete: _isp.ForeignKeyAction.cascade,
|
|
matchType: null,
|
|
deferrable: _isp.DeferrableConstraint.initiallyDeferred,
|
|
),
|
|
],
|
|
indexes: [
|
|
_isp.IndexDefinition(
|
|
indexName: 'workout_series_space_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'spaceId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
_isp.IndexDefinition(
|
|
indexName: 'workout_series_workout_idx',
|
|
tableSpace: null,
|
|
elements: [
|
|
_isp.IndexElementDefinition(
|
|
type: _isp.IndexElementDefinitionType.column,
|
|
definition: 'workoutId',
|
|
),
|
|
],
|
|
type: 'btree',
|
|
isUnique: false,
|
|
isPrimary: false,
|
|
),
|
|
],
|
|
managed: true,
|
|
),
|
|
..._ik8molhd.Protocol.targetTableDefinitions,
|
|
..._iais.Protocol.targetTableDefinitions,
|
|
..._izehhkf5.Protocol.targetTableDefinitions,
|
|
..._ipoqfiqr.Protocol.targetTableDefinitions,
|
|
..._iacs.Protocol.targetTableDefinitions,
|
|
..._isp.Protocol.targetTableDefinitions,
|
|
];
|
|
|
|
static String? getClassNameFromObjectJson(dynamic data) {
|
|
if (data is! Map) return null;
|
|
final className = data['__className__'] as String?;
|
|
return className;
|
|
}
|
|
|
|
@override
|
|
T deserialize<T>(
|
|
dynamic data, [
|
|
Type? t,
|
|
]) {
|
|
t ??= T;
|
|
|
|
final dataClassName = getClassNameFromObjectJson(data);
|
|
if (dataClassName != null && dataClassName != getClassNameForType(t)) {
|
|
try {
|
|
return deserializeByClassName({
|
|
'className': dataClassName,
|
|
'data': data,
|
|
});
|
|
} on _is.DeserializationClassNameNotFoundException catch (_) {
|
|
// If the className is not recognized (e.g., older client receiving
|
|
// data with a new subtype), fall back to deserializing without the
|
|
// className, using the expected type T.
|
|
}
|
|
}
|
|
|
|
if (t == _ikmv9f3y.Day) {
|
|
return _ikmv9f3y.Day.fromJson(data) as T;
|
|
}
|
|
if (t == _ir1ofny6.DaySeries) {
|
|
return _ir1ofny6.DaySeries.fromJson(data) as T;
|
|
}
|
|
if (t == _i17cgxdf.Night) {
|
|
return _i17cgxdf.Night.fromJson(data) as T;
|
|
}
|
|
if (t == _i4qollgq.LoopFirmware) {
|
|
return _i4qollgq.LoopFirmware.fromJson(data) as T;
|
|
}
|
|
if (t == _ipcwdy0l.LoopFirmwareRefused) {
|
|
return _ipcwdy0l.LoopFirmwareRefused.fromJson(data) as T;
|
|
}
|
|
if (t == _ikw0qg8x.MapSource) {
|
|
return _ikw0qg8x.MapSource.fromJson(data) as T;
|
|
}
|
|
if (t == _i45prw73.Plan) {
|
|
return _i45prw73.Plan.fromJson(data) as T;
|
|
}
|
|
if (t == _imed3x5d.ContentKey) {
|
|
return _imed3x5d.ContentKey.fromJson(data) as T;
|
|
}
|
|
if (t == _ia5j8fch.Profile) {
|
|
return _ia5j8fch.Profile.fromJson(data) as T;
|
|
}
|
|
if (t == _ikjgxraq.PlannedRoute) {
|
|
return _ikjgxraq.PlannedRoute.fromJson(data) as T;
|
|
}
|
|
if (t == _if6974nb.RouteHint) {
|
|
return _if6974nb.RouteHint.fromJson(data) as T;
|
|
}
|
|
if (t == _isqtfus6.RoutePoint) {
|
|
return _isqtfus6.RoutePoint.fromJson(data) as T;
|
|
}
|
|
if (t == _ifl4j5ep.RouteProfile) {
|
|
return _ifl4j5ep.RouteProfile.fromJson(data) as T;
|
|
}
|
|
if (t == _ix4aepwk.RouteRefused) {
|
|
return _ix4aepwk.RouteRefused.fromJson(data) as T;
|
|
}
|
|
if (t == _ic7f85bc.RouteStretch) {
|
|
return _ic7f85bc.RouteStretch.fromJson(data) as T;
|
|
}
|
|
if (t == _i5b9b17z.Workout) {
|
|
return _i5b9b17z.Workout.fromJson(data) as T;
|
|
}
|
|
if (t == _i92mefto.WorkoutSeries) {
|
|
return _i92mefto.WorkoutSeries.fromJson(data) as T;
|
|
}
|
|
if (t == _is.getType<_ikmv9f3y.Day?>()) {
|
|
return (data != null ? _ikmv9f3y.Day.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ir1ofny6.DaySeries?>()) {
|
|
return (data != null ? _ir1ofny6.DaySeries.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_i17cgxdf.Night?>()) {
|
|
return (data != null ? _i17cgxdf.Night.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_i4qollgq.LoopFirmware?>()) {
|
|
return (data != null ? _i4qollgq.LoopFirmware.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ipcwdy0l.LoopFirmwareRefused?>()) {
|
|
return (data != null
|
|
? _ipcwdy0l.LoopFirmwareRefused.fromJson(data)
|
|
: null)
|
|
as T;
|
|
}
|
|
if (t == _is.getType<_ikw0qg8x.MapSource?>()) {
|
|
return (data != null ? _ikw0qg8x.MapSource.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_i45prw73.Plan?>()) {
|
|
return (data != null ? _i45prw73.Plan.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_imed3x5d.ContentKey?>()) {
|
|
return (data != null ? _imed3x5d.ContentKey.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ia5j8fch.Profile?>()) {
|
|
return (data != null ? _ia5j8fch.Profile.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ikjgxraq.PlannedRoute?>()) {
|
|
return (data != null ? _ikjgxraq.PlannedRoute.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_if6974nb.RouteHint?>()) {
|
|
return (data != null ? _if6974nb.RouteHint.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_isqtfus6.RoutePoint?>()) {
|
|
return (data != null ? _isqtfus6.RoutePoint.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ifl4j5ep.RouteProfile?>()) {
|
|
return (data != null ? _ifl4j5ep.RouteProfile.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ix4aepwk.RouteRefused?>()) {
|
|
return (data != null ? _ix4aepwk.RouteRefused.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_ic7f85bc.RouteStretch?>()) {
|
|
return (data != null ? _ic7f85bc.RouteStretch.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_i5b9b17z.Workout?>()) {
|
|
return (data != null ? _i5b9b17z.Workout.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _is.getType<_i92mefto.WorkoutSeries?>()) {
|
|
return (data != null ? _i92mefto.WorkoutSeries.fromJson(data) : null)
|
|
as T;
|
|
}
|
|
if (t == List<_isqtfus6.RoutePoint>) {
|
|
return (data as List)
|
|
.map((e) => deserialize<_isqtfus6.RoutePoint>(e))
|
|
.toList()
|
|
as T;
|
|
}
|
|
if (t == List<double>) {
|
|
return (data as List).map((e) => deserialize<double>(e)).toList() as T;
|
|
}
|
|
if (t == List<_if6974nb.RouteHint>) {
|
|
return (data as List)
|
|
.map((e) => deserialize<_if6974nb.RouteHint>(e))
|
|
.toList()
|
|
as T;
|
|
}
|
|
if (t == List<_ic7f85bc.RouteStretch>) {
|
|
return (data as List)
|
|
.map((e) => deserialize<_ic7f85bc.RouteStretch>(e))
|
|
.toList()
|
|
as T;
|
|
}
|
|
if (t == List<_is4pcfub.RoutePoint>) {
|
|
return (data as List)
|
|
.map((e) => deserialize<_is4pcfub.RoutePoint>(e))
|
|
.toList()
|
|
as T;
|
|
}
|
|
try {
|
|
return _ik8molhd.Protocol().deserialize<T>(data, t);
|
|
} on _is.DeserializationTypeNotFoundException catch (_) {}
|
|
try {
|
|
return _iais.Protocol().deserialize<T>(data, t);
|
|
} on _is.DeserializationTypeNotFoundException catch (_) {}
|
|
try {
|
|
return _izehhkf5.Protocol().deserialize<T>(data, t);
|
|
} on _is.DeserializationTypeNotFoundException catch (_) {}
|
|
try {
|
|
return _ipoqfiqr.Protocol().deserialize<T>(data, t);
|
|
} on _is.DeserializationTypeNotFoundException catch (_) {}
|
|
try {
|
|
return _iacs.Protocol().deserialize<T>(data, t);
|
|
} on _is.DeserializationTypeNotFoundException catch (_) {}
|
|
try {
|
|
return _isp.Protocol().deserialize<T>(data, t);
|
|
} on _is.DeserializationTypeNotFoundException catch (_) {}
|
|
return super.deserialize<T>(data, t);
|
|
}
|
|
|
|
static String? getClassNameForType(Type type) {
|
|
return switch (type) {
|
|
_ikmv9f3y.Day => 'Day',
|
|
_ir1ofny6.DaySeries => 'DaySeries',
|
|
_i17cgxdf.Night => 'Night',
|
|
_i4qollgq.LoopFirmware => 'LoopFirmware',
|
|
_ipcwdy0l.LoopFirmwareRefused => 'LoopFirmwareRefused',
|
|
_ikw0qg8x.MapSource => 'MapSource',
|
|
_i45prw73.Plan => 'Plan',
|
|
_imed3x5d.ContentKey => 'ContentKey',
|
|
_ia5j8fch.Profile => 'Profile',
|
|
_ikjgxraq.PlannedRoute => 'PlannedRoute',
|
|
_if6974nb.RouteHint => 'RouteHint',
|
|
_isqtfus6.RoutePoint => 'RoutePoint',
|
|
_ifl4j5ep.RouteProfile => 'RouteProfile',
|
|
_ix4aepwk.RouteRefused => 'RouteRefused',
|
|
_ic7f85bc.RouteStretch => 'RouteStretch',
|
|
_i5b9b17z.Workout => 'Workout',
|
|
_i92mefto.WorkoutSeries => 'WorkoutSeries',
|
|
_ => null,
|
|
};
|
|
}
|
|
|
|
@override
|
|
String? getClassNameForObject(Object? data) {
|
|
String? className = super.getClassNameForObject(data);
|
|
if (className != null) return className;
|
|
|
|
if (data is Map<String, dynamic> && data['__className__'] is String) {
|
|
return (data['__className__'] as String).replaceFirst(
|
|
'halkyon_train.',
|
|
'',
|
|
);
|
|
}
|
|
|
|
switch (data) {
|
|
case _ikmv9f3y.Day():
|
|
return 'Day';
|
|
case _ir1ofny6.DaySeries():
|
|
return 'DaySeries';
|
|
case _i17cgxdf.Night():
|
|
return 'Night';
|
|
case _i4qollgq.LoopFirmware():
|
|
return 'LoopFirmware';
|
|
case _ipcwdy0l.LoopFirmwareRefused():
|
|
return 'LoopFirmwareRefused';
|
|
case _ikw0qg8x.MapSource():
|
|
return 'MapSource';
|
|
case _i45prw73.Plan():
|
|
return 'Plan';
|
|
case _imed3x5d.ContentKey():
|
|
return 'ContentKey';
|
|
case _ia5j8fch.Profile():
|
|
return 'Profile';
|
|
case _ikjgxraq.PlannedRoute():
|
|
return 'PlannedRoute';
|
|
case _if6974nb.RouteHint():
|
|
return 'RouteHint';
|
|
case _isqtfus6.RoutePoint():
|
|
return 'RoutePoint';
|
|
case _ifl4j5ep.RouteProfile():
|
|
return 'RouteProfile';
|
|
case _ix4aepwk.RouteRefused():
|
|
return 'RouteRefused';
|
|
case _ic7f85bc.RouteStretch():
|
|
return 'RouteStretch';
|
|
case _i5b9b17z.Workout():
|
|
return 'Workout';
|
|
case _i92mefto.WorkoutSeries():
|
|
return 'WorkoutSeries';
|
|
}
|
|
className = _ik8molhd.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return className.contains('.') ? className : 'halkyon_base.$className';
|
|
}
|
|
className = _iais.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return className.contains('.')
|
|
? className
|
|
: 'serverpod_auth_idp.$className';
|
|
}
|
|
className = _izehhkf5.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return className.contains('.')
|
|
? className
|
|
: 'serverpod_offline_sync.$className';
|
|
}
|
|
className = _ipoqfiqr.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return className.contains('.') ? className : 'halkyon_oidc.$className';
|
|
}
|
|
className = _iacs.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return className.contains('.')
|
|
? className
|
|
: 'serverpod_auth_core.$className';
|
|
}
|
|
className = _isp.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return className.contains('.') ? className : 'serverpod.$className';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@override
|
|
dynamic deserializeByClassName(Map<String, dynamic> data) {
|
|
var dataClassName = data['className'];
|
|
if (dataClassName is! String) {
|
|
return super.deserializeByClassName(data);
|
|
}
|
|
if (dataClassName == 'Day') {
|
|
return deserialize<_ikmv9f3y.Day>(data['data']);
|
|
}
|
|
if (dataClassName == 'DaySeries') {
|
|
return deserialize<_ir1ofny6.DaySeries>(data['data']);
|
|
}
|
|
if (dataClassName == 'Night') {
|
|
return deserialize<_i17cgxdf.Night>(data['data']);
|
|
}
|
|
if (dataClassName == 'LoopFirmware') {
|
|
return deserialize<_i4qollgq.LoopFirmware>(data['data']);
|
|
}
|
|
if (dataClassName == 'LoopFirmwareRefused') {
|
|
return deserialize<_ipcwdy0l.LoopFirmwareRefused>(data['data']);
|
|
}
|
|
if (dataClassName == 'MapSource') {
|
|
return deserialize<_ikw0qg8x.MapSource>(data['data']);
|
|
}
|
|
if (dataClassName == 'Plan') {
|
|
return deserialize<_i45prw73.Plan>(data['data']);
|
|
}
|
|
if (dataClassName == 'ContentKey') {
|
|
return deserialize<_imed3x5d.ContentKey>(data['data']);
|
|
}
|
|
if (dataClassName == 'Profile') {
|
|
return deserialize<_ia5j8fch.Profile>(data['data']);
|
|
}
|
|
if (dataClassName == 'PlannedRoute') {
|
|
return deserialize<_ikjgxraq.PlannedRoute>(data['data']);
|
|
}
|
|
if (dataClassName == 'RouteHint') {
|
|
return deserialize<_if6974nb.RouteHint>(data['data']);
|
|
}
|
|
if (dataClassName == 'RoutePoint') {
|
|
return deserialize<_isqtfus6.RoutePoint>(data['data']);
|
|
}
|
|
if (dataClassName == 'RouteProfile') {
|
|
return deserialize<_ifl4j5ep.RouteProfile>(data['data']);
|
|
}
|
|
if (dataClassName == 'RouteRefused') {
|
|
return deserialize<_ix4aepwk.RouteRefused>(data['data']);
|
|
}
|
|
if (dataClassName == 'RouteStretch') {
|
|
return deserialize<_ic7f85bc.RouteStretch>(data['data']);
|
|
}
|
|
if (dataClassName == 'Workout') {
|
|
return deserialize<_i5b9b17z.Workout>(data['data']);
|
|
}
|
|
if (dataClassName == 'WorkoutSeries') {
|
|
return deserialize<_i92mefto.WorkoutSeries>(data['data']);
|
|
}
|
|
if (dataClassName.startsWith('halkyon_base.')) {
|
|
data['className'] = dataClassName.substring(13);
|
|
return _ik8molhd.Protocol().deserializeByClassName(data);
|
|
}
|
|
if (dataClassName.startsWith('serverpod_auth_idp.')) {
|
|
data['className'] = dataClassName.substring(19);
|
|
return _iais.Protocol().deserializeByClassName(data);
|
|
}
|
|
if (dataClassName.startsWith('serverpod_offline_sync.')) {
|
|
data['className'] = dataClassName.substring(23);
|
|
return _izehhkf5.Protocol().deserializeByClassName(data);
|
|
}
|
|
if (dataClassName.startsWith('halkyon_oidc.')) {
|
|
data['className'] = dataClassName.substring(13);
|
|
return _ipoqfiqr.Protocol().deserializeByClassName(data);
|
|
}
|
|
if (dataClassName.startsWith('serverpod_auth_core.')) {
|
|
data['className'] = dataClassName.substring(20);
|
|
return _iacs.Protocol().deserializeByClassName(data);
|
|
}
|
|
if (dataClassName.startsWith('serverpod.')) {
|
|
data['className'] = dataClassName.substring(10);
|
|
return _isp.Protocol().deserializeByClassName(data);
|
|
}
|
|
return super.deserializeByClassName(data);
|
|
}
|
|
|
|
void _registerHostProtocols() {
|
|
_ik8molhd.Protocol().registerHostProtocol('halkyon_train', this);
|
|
_iais.Protocol().registerHostProtocol('halkyon_train', this);
|
|
_izehhkf5.Protocol().registerHostProtocol('halkyon_train', this);
|
|
_ipoqfiqr.Protocol().registerHostProtocol('halkyon_train', this);
|
|
_iacs.Protocol().registerHostProtocol('halkyon_train', this);
|
|
}
|
|
|
|
@override
|
|
_is.Table? getTableForType(Type t) {
|
|
{
|
|
var table = _ik8molhd.Protocol().getTableForType(t);
|
|
if (table != null) {
|
|
return table;
|
|
}
|
|
}
|
|
{
|
|
var table = _iais.Protocol().getTableForType(t);
|
|
if (table != null) {
|
|
return table;
|
|
}
|
|
}
|
|
{
|
|
var table = _izehhkf5.Protocol().getTableForType(t);
|
|
if (table != null) {
|
|
return table;
|
|
}
|
|
}
|
|
{
|
|
var table = _ipoqfiqr.Protocol().getTableForType(t);
|
|
if (table != null) {
|
|
return table;
|
|
}
|
|
}
|
|
{
|
|
var table = _iacs.Protocol().getTableForType(t);
|
|
if (table != null) {
|
|
return table;
|
|
}
|
|
}
|
|
{
|
|
var table = _isp.Protocol().getTableForType(t);
|
|
if (table != null) {
|
|
return table;
|
|
}
|
|
}
|
|
switch (t) {
|
|
case _ikmv9f3y.Day:
|
|
return _ikmv9f3y.Day.t;
|
|
case _ir1ofny6.DaySeries:
|
|
return _ir1ofny6.DaySeries.t;
|
|
case _i17cgxdf.Night:
|
|
return _i17cgxdf.Night.t;
|
|
case _i45prw73.Plan:
|
|
return _i45prw73.Plan.t;
|
|
case _imed3x5d.ContentKey:
|
|
return _imed3x5d.ContentKey.t;
|
|
case _ia5j8fch.Profile:
|
|
return _ia5j8fch.Profile.t;
|
|
case _i5b9b17z.Workout:
|
|
return _i5b9b17z.Workout.t;
|
|
case _i92mefto.WorkoutSeries:
|
|
return _i92mefto.WorkoutSeries.t;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@override
|
|
List<_isp.TableDefinition> getTargetTableDefinitions() =>
|
|
targetTableDefinitions;
|
|
|
|
@override
|
|
String getModuleName() => 'halkyon_train';
|
|
|
|
/// Maps any `Record`s known to this [Protocol] to their JSON representation
|
|
///
|
|
/// Throws in case the record type is not known.
|
|
///
|
|
/// This method will return `null` (only) for `null` inputs.
|
|
Map<String, dynamic>? mapRecordToJson(Record? record) {
|
|
if (record == null) {
|
|
return null;
|
|
}
|
|
try {
|
|
return _ik8molhd.Protocol().mapRecordToJson(record);
|
|
} catch (_) {}
|
|
try {
|
|
return _iais.Protocol().mapRecordToJson(record);
|
|
} catch (_) {}
|
|
try {
|
|
return _izehhkf5.Protocol().mapRecordToJson(record);
|
|
} catch (_) {}
|
|
try {
|
|
return _ipoqfiqr.Protocol().mapRecordToJson(record);
|
|
} catch (_) {}
|
|
try {
|
|
return _iacs.Protocol().mapRecordToJson(record);
|
|
} catch (_) {}
|
|
throw Exception('Unsupported record type ${record.runtimeType}');
|
|
}
|
|
}
|