@glissandoo/lib 1.124.2 → 1.125.0

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.
@@ -5,19 +5,55 @@ import { CommOverwrite } from './overwrites/comm';
5
5
  import { CommHistory } from './overwrites/comm_history';
6
6
  import { EventOverwrite } from './overwrites/event';
7
7
  import { EventHistory } from './overwrites/event_history';
8
+ import { EventPlayerModelOverwrite, EventPlayerOverwrite } from './overwrites/eventPlayer';
8
9
  import { GroupOverwrite } from './overwrites/group';
9
10
  import { GroupHistory } from './overwrites/group_history';
11
+ import { GroupPlayerModelOverwrite, GroupPlayerOverwrite } from './overwrites/groupPlayer';
10
12
  import { OfferOverwrite } from './overwrites/offer';
11
13
  import { OfferHistory } from './overwrites/offer_history';
14
+ import { PublicApiGroupModelOverwrite } from './overwrites/publicApiGroupModel';
12
15
  import { RepertoireOverwrite } from './overwrites/repertoire';
13
16
  import { RepertoireHistory } from './overwrites/repertoire_history';
17
+ import { ListPublicApiRepertoireFunction } from './publicApi';
14
18
 
15
- export type Database = MergeDeep<
19
+ // MergeDeep produces conditional types that don't satisfy SupabaseClient's
20
+ // GenericSchema constraint; SimplifyTableRecord resolves them back into plain
21
+ // mapped types that TypeScript can verify structurally.
22
+ type SimplifyTableRecord<
23
+ T extends Record<
24
+ string,
25
+ { Row: object; Insert?: object; Update?: object; Relationships: unknown }
26
+ >
27
+ > = {
28
+ [K in keyof T]: {
29
+ Row: { [F in keyof T[K]['Row']]: T[K]['Row'][F] };
30
+ Insert: T[K] extends { Insert: object }
31
+ ? { [F in keyof T[K]['Insert']]: T[K]['Insert'][F] }
32
+ : never;
33
+ Update: T[K] extends { Update: object }
34
+ ? { [F in keyof T[K]['Update']]: T[K]['Update'][F] }
35
+ : never;
36
+ Relationships: T[K]['Relationships'];
37
+ };
38
+ };
39
+
40
+ type DatabaseMerged = MergeDeep<
16
41
  DatabaseGenerated,
17
42
  {
18
43
  public: {
19
44
  Tables: {
20
45
  group: Overwrite<GroupOverwrite, 'configSites' | 'socialNetworks'>;
46
+ groupPlayer: Overwrite<
47
+ GroupPlayerOverwrite,
48
+ | 'additionalInfo'
49
+ | 'customFields'
50
+ | 'badgeAccPractices'
51
+ | 'badgeAccPerformances'
52
+ | 'badgeStrikePractices'
53
+ | 'badgeAnswerEvents'
54
+ | 'badgePlayedWorks'
55
+ >;
56
+ eventPlayer: Overwrite<EventPlayerOverwrite, 'questions' | 'history'>;
21
57
  event: Overwrite<EventOverwrite, 'repeat' | 'stage'>;
22
58
  offer: Overwrite<OfferOverwrite>;
23
59
  repertoire: Overwrite<RepertoireOverwrite>;
@@ -31,6 +67,117 @@ export type Database = MergeDeep<
31
67
  offer_history: Overwrite<Omit<OfferHistory, 'id'>, 'prev_value' | 'value'>;
32
68
  comm_history: Overwrite<Omit<CommHistory, 'id'>, 'prev_value' | 'value'>;
33
69
  };
70
+ Views: {
71
+ publicApiGroupModel: Overwrite<PublicApiGroupModelOverwrite>;
72
+ groupPlayerModel: Overwrite<
73
+ GroupPlayerModelOverwrite,
74
+ | 'additionalInfo'
75
+ | 'customFields'
76
+ | 'badgeAccPractices'
77
+ | 'badgeAccPerformances'
78
+ | 'badgeStrikePractices'
79
+ | 'badgeAnswerEvents'
80
+ | 'badgePlayedWorks'
81
+ >;
82
+ eventPlayerModel: Overwrite<EventPlayerModelOverwrite, 'questions' | 'history'>;
83
+ };
84
+ Functions: {
85
+ listPublicApiRepertoire: ListPublicApiRepertoireFunction;
86
+ };
34
87
  };
35
88
  }
36
89
  >;
90
+
91
+ // Structurally identical to DatabaseMerged but produces plain mapped types that
92
+ // satisfy SupabaseClient<Database> generics.
93
+ export type Database = Omit<DatabaseMerged, 'public'> & {
94
+ public: Omit<DatabaseMerged['public'], 'Tables' | 'Views'> & {
95
+ Tables: SimplifyTableRecord<DatabaseMerged['public']['Tables']>;
96
+ Views: SimplifyTableRecord<DatabaseMerged['public']['Views']>;
97
+ };
98
+ };
99
+
100
+ type DatabaseWithoutInternals = Omit<Database, '__InternalSupabase'>;
101
+
102
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, 'public'>];
103
+
104
+ export type RelationName = keyof (DefaultSchema['Tables'] & DefaultSchema['Views']);
105
+ export type IsRelationName<T extends RelationName> = T;
106
+
107
+ export type Tables<
108
+ DefaultSchemaTableNameOrOptions extends
109
+ | keyof (DefaultSchema['Tables'] & DefaultSchema['Views'])
110
+ | { schema: keyof DatabaseWithoutInternals },
111
+ TableName extends DefaultSchemaTableNameOrOptions extends {
112
+ schema: keyof DatabaseWithoutInternals;
113
+ }
114
+ ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
115
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])
116
+ : never = never
117
+ > = DefaultSchemaTableNameOrOptions extends {
118
+ schema: keyof DatabaseWithoutInternals;
119
+ }
120
+ ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
121
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])[TableName] extends {
122
+ Row: infer R;
123
+ }
124
+ ? R
125
+ : never
126
+ : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema['Tables'] &
127
+ DefaultSchema['Views'])
128
+ ? (DefaultSchema['Tables'] & DefaultSchema['Views'])[DefaultSchemaTableNameOrOptions] extends {
129
+ Row: infer R;
130
+ }
131
+ ? R
132
+ : never
133
+ : never;
134
+
135
+ export type TablesInsert<
136
+ DefaultSchemaTableNameOrOptions extends
137
+ | keyof DefaultSchema['Tables']
138
+ | { schema: keyof DatabaseWithoutInternals },
139
+ TableName extends DefaultSchemaTableNameOrOptions extends {
140
+ schema: keyof DatabaseWithoutInternals;
141
+ }
142
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
143
+ : never = never
144
+ > = DefaultSchemaTableNameOrOptions extends {
145
+ schema: keyof DatabaseWithoutInternals;
146
+ }
147
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
148
+ Insert: infer I;
149
+ }
150
+ ? I
151
+ : never
152
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables']
153
+ ? DefaultSchema['Tables'][DefaultSchemaTableNameOrOptions] extends {
154
+ Insert: infer I;
155
+ }
156
+ ? I
157
+ : never
158
+ : never;
159
+
160
+ export type TablesUpdate<
161
+ DefaultSchemaTableNameOrOptions extends
162
+ | keyof DefaultSchema['Tables']
163
+ | { schema: keyof DatabaseWithoutInternals },
164
+ TableName extends DefaultSchemaTableNameOrOptions extends {
165
+ schema: keyof DatabaseWithoutInternals;
166
+ }
167
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
168
+ : never = never
169
+ > = DefaultSchemaTableNameOrOptions extends {
170
+ schema: keyof DatabaseWithoutInternals;
171
+ }
172
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
173
+ Update: infer U;
174
+ }
175
+ ? U
176
+ : never
177
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables']
178
+ ? DefaultSchema['Tables'][DefaultSchemaTableNameOrOptions] extends {
179
+ Update: infer U;
180
+ }
181
+ ? U
182
+ : never
183
+ : never;
@@ -0,0 +1,11 @@
1
+ import { EventPlayerJsonHistory, EventPlayerJsonQuestions } from '../../../models/supabase/EventPlayer/types';
2
+ export interface EventPlayerOverwrite {
3
+ questions: EventPlayerJsonQuestions;
4
+ history: EventPlayerJsonHistory[];
5
+ }
6
+ export interface EventPlayerModelOverwrite extends EventPlayerOverwrite {
7
+ eventId: string;
8
+ userId: string;
9
+ isGuest: boolean;
10
+ updatedAt: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import {
2
+ EventPlayerJsonHistory,
3
+ EventPlayerJsonQuestions,
4
+ } from '../../../models/supabase/EventPlayer/types';
5
+
6
+ export interface EventPlayerOverwrite {
7
+ questions: EventPlayerJsonQuestions;
8
+ history: EventPlayerJsonHistory[];
9
+ }
10
+
11
+ // Restore the NOT NULL guarantees inherited from eventPlayer. Supabase's view
12
+ // introspection otherwise marks every projected column as nullable.
13
+ export interface EventPlayerModelOverwrite extends EventPlayerOverwrite {
14
+ eventId: string;
15
+ userId: string;
16
+ isGuest: boolean;
17
+ updatedAt: string;
18
+ }
@@ -0,0 +1,20 @@
1
+ import { GroupPlayerAdditionalInfo, GroupPlayerJsonBadgeLevels, GroupPlayerJsonCustomFields } from '../../../models/supabase/GroupPlayer/types';
2
+ export interface GroupPlayerOverwrite {
3
+ additionalInfo: GroupPlayerAdditionalInfo;
4
+ customFields: GroupPlayerJsonCustomFields;
5
+ badgeAccPractices: GroupPlayerJsonBadgeLevels;
6
+ badgeAccPerformances: GroupPlayerJsonBadgeLevels;
7
+ badgeStrikePractices: GroupPlayerJsonBadgeLevels;
8
+ badgeAnswerEvents: GroupPlayerJsonBadgeLevels;
9
+ badgePlayedWorks: GroupPlayerJsonBadgeLevels;
10
+ }
11
+ export interface GroupPlayerModelOverwrite extends GroupPlayerOverwrite {
12
+ userId: string;
13
+ groupId: string;
14
+ role: string;
15
+ isAdmin: boolean;
16
+ permissions: string[];
17
+ instruments: string[];
18
+ updatedAt: string;
19
+ fakeUser: boolean;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,30 @@
1
+ import {
2
+ GroupPlayerAdditionalInfo,
3
+ GroupPlayerJsonBadgeLevels,
4
+ GroupPlayerJsonCustomFields,
5
+ } from '../../../models/supabase/GroupPlayer/types';
6
+
7
+ export interface GroupPlayerOverwrite {
8
+ additionalInfo: GroupPlayerAdditionalInfo;
9
+ customFields: GroupPlayerJsonCustomFields;
10
+ badgeAccPractices: GroupPlayerJsonBadgeLevels;
11
+ badgeAccPerformances: GroupPlayerJsonBadgeLevels;
12
+ badgeStrikePractices: GroupPlayerJsonBadgeLevels;
13
+ badgeAnswerEvents: GroupPlayerJsonBadgeLevels;
14
+ badgePlayedWorks: GroupPlayerJsonBadgeLevels;
15
+ }
16
+
17
+ // PostgreSQL exposes every view column as nullable to the generated client even
18
+ // when it originates in a NOT NULL membership column. Restore the guarantees
19
+ // of the underlying groupPlayer row without making joined profile fields
20
+ // artificially required.
21
+ export interface GroupPlayerModelOverwrite extends GroupPlayerOverwrite {
22
+ userId: string;
23
+ groupId: string;
24
+ role: string;
25
+ isAdmin: boolean;
26
+ permissions: string[];
27
+ instruments: string[];
28
+ updatedAt: string;
29
+ fakeUser: boolean;
30
+ }
@@ -0,0 +1,7 @@
1
+ import { Database } from '../generated';
2
+ import { GroupOverwrite } from './group';
3
+ type GroupRow = Database['public']['Tables']['group']['Row'];
4
+ export type PublicApiGroupModelOverwrite = GroupRow & GroupOverwrite & {
5
+ activePlayersCount: number;
6
+ };
7
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { Database } from '../generated';
2
+ import { GroupOverwrite } from './group';
3
+
4
+ type GroupRow = Database['public']['Tables']['group']['Row'];
5
+
6
+ // PostgreSQL reports view columns as nullable. This view retains every
7
+ // guarantee from the canonical group row and adds one non-null derived count.
8
+ export type PublicApiGroupModelOverwrite = GroupRow &
9
+ GroupOverwrite & {
10
+ activePlayersCount: number;
11
+ };
@@ -0,0 +1,2 @@
1
+ import { Database as DatabaseGenerated } from './generated';
2
+ export type ListPublicApiRepertoireFunction = DatabaseGenerated['public']['Functions']['listPublicApiRepertoire'];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Database as DatabaseGenerated } from './generated';
2
+
3
+ // Composer is not published in this branch, so `source_composition` keeps its
4
+ // generated JSON type instead of the Composer SourceComposition model.
5
+ export type ListPublicApiRepertoireFunction =
6
+ DatabaseGenerated['public']['Functions']['listPublicApiRepertoire'];