@rjromeoent/ein-supabase 0.1.10 → 0.1.12
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/README.md +4 -1
- package/dist/generated/database.types.d.ts +63 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/rad-rpc.d.ts +25 -0
- package/dist/rad-rpc.js +16 -0
- package/dist/schema-client.d.ts +2 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ Then app repos should depend on the released version:
|
|
|
87
87
|
```json
|
|
88
88
|
{
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@rjromeoent/ein-supabase": "^0.1.
|
|
90
|
+
"@rjromeoent/ein-supabase": "^0.1.11"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
```
|
|
@@ -232,6 +232,9 @@ Examples:
|
|
|
232
232
|
- one RPC request/response type consumed by Atlas and RAD
|
|
233
233
|
- one Edge Function request/response type consumed by Launchpad and Event Ops
|
|
234
234
|
- canonical event-bus envelope types used by multiple apps
|
|
235
|
+
- generated-type corrections for stable backend RPCs where Supabase cannot
|
|
236
|
+
express the real SQL contract, such as nullable `rad.check_set_time_conflicts`
|
|
237
|
+
arguments
|
|
235
238
|
|
|
236
239
|
Why:
|
|
237
240
|
|
|
@@ -6004,6 +6004,56 @@ export type Database = {
|
|
|
6004
6004
|
};
|
|
6005
6005
|
Relationships: [];
|
|
6006
6006
|
};
|
|
6007
|
+
artist_merge_queue: {
|
|
6008
|
+
Row: {
|
|
6009
|
+
error_text: string | null;
|
|
6010
|
+
finished_at: string | null;
|
|
6011
|
+
id: string;
|
|
6012
|
+
keep_id: string;
|
|
6013
|
+
merge_id: string;
|
|
6014
|
+
organization_id: string;
|
|
6015
|
+
requested_at: string;
|
|
6016
|
+
requested_by: string | null;
|
|
6017
|
+
result: Json | null;
|
|
6018
|
+
started_at: string | null;
|
|
6019
|
+
status: string;
|
|
6020
|
+
};
|
|
6021
|
+
Insert: {
|
|
6022
|
+
error_text?: string | null;
|
|
6023
|
+
finished_at?: string | null;
|
|
6024
|
+
id?: string;
|
|
6025
|
+
keep_id: string;
|
|
6026
|
+
merge_id: string;
|
|
6027
|
+
organization_id: string;
|
|
6028
|
+
requested_at?: string;
|
|
6029
|
+
requested_by?: string | null;
|
|
6030
|
+
result?: Json | null;
|
|
6031
|
+
started_at?: string | null;
|
|
6032
|
+
status?: string;
|
|
6033
|
+
};
|
|
6034
|
+
Update: {
|
|
6035
|
+
error_text?: string | null;
|
|
6036
|
+
finished_at?: string | null;
|
|
6037
|
+
id?: string;
|
|
6038
|
+
keep_id?: string;
|
|
6039
|
+
merge_id?: string;
|
|
6040
|
+
organization_id?: string;
|
|
6041
|
+
requested_at?: string;
|
|
6042
|
+
requested_by?: string | null;
|
|
6043
|
+
result?: Json | null;
|
|
6044
|
+
started_at?: string | null;
|
|
6045
|
+
status?: string;
|
|
6046
|
+
};
|
|
6047
|
+
Relationships: [
|
|
6048
|
+
{
|
|
6049
|
+
foreignKeyName: "artist_merge_queue_organization_id_fkey";
|
|
6050
|
+
columns: ["organization_id"];
|
|
6051
|
+
isOneToOne: false;
|
|
6052
|
+
referencedRelation: "organizations";
|
|
6053
|
+
referencedColumns: ["id"];
|
|
6054
|
+
}
|
|
6055
|
+
];
|
|
6056
|
+
};
|
|
6007
6057
|
artist_representations: {
|
|
6008
6058
|
Row: {
|
|
6009
6059
|
agency_contact_email: string | null;
|
|
@@ -8496,6 +8546,13 @@ export type Database = {
|
|
|
8496
8546
|
Args: never;
|
|
8497
8547
|
Returns: Json;
|
|
8498
8548
|
};
|
|
8549
|
+
enqueue_artist_merge: {
|
|
8550
|
+
Args: {
|
|
8551
|
+
p_keep_id: string;
|
|
8552
|
+
p_merge_id: string;
|
|
8553
|
+
};
|
|
8554
|
+
Returns: string;
|
|
8555
|
+
};
|
|
8499
8556
|
find_duplicate_artists: {
|
|
8500
8557
|
Args: {
|
|
8501
8558
|
p_organization_id: string;
|
|
@@ -8734,6 +8791,12 @@ export type Database = {
|
|
|
8734
8791
|
};
|
|
8735
8792
|
Returns: string;
|
|
8736
8793
|
};
|
|
8794
|
+
process_artist_merge_queue: {
|
|
8795
|
+
Args: {
|
|
8796
|
+
p_limit?: number;
|
|
8797
|
+
};
|
|
8798
|
+
Returns: number;
|
|
8799
|
+
};
|
|
8737
8800
|
promote_representation_agency: {
|
|
8738
8801
|
Args: {
|
|
8739
8802
|
p_display_name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from "./app-context.js";
|
|
|
2
2
|
export * from "./auth.js";
|
|
3
3
|
export type * from "./db-enums.js";
|
|
4
4
|
export * from "./json.js";
|
|
5
|
+
export * from "./rad-rpc.js";
|
|
5
6
|
export * from "./schema-client.js";
|
|
6
7
|
export type { Constants, Database, Enums, Json, Tables, TablesInsert, TablesUpdate, } from "./generated/database.types.js";
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PostgrestError, SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import type { Database } from "./generated/database.types.js";
|
|
3
|
+
export interface RadCheckSetTimeConflictsParams {
|
|
4
|
+
eventEditionId: string;
|
|
5
|
+
showDate: string;
|
|
6
|
+
slotLabel: string | null;
|
|
7
|
+
setStart: string;
|
|
8
|
+
setEnd: string;
|
|
9
|
+
excludeSetTimeId?: string | null;
|
|
10
|
+
excludeAssignmentId?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface RadSetTimeConflictRow {
|
|
13
|
+
conflicting_set_time_id: string;
|
|
14
|
+
conflicting_assignment_id: string;
|
|
15
|
+
conflicting_artist_id: string;
|
|
16
|
+
conflicting_artist_name: string | null;
|
|
17
|
+
conflicting_set_start: string;
|
|
18
|
+
conflicting_set_end: string;
|
|
19
|
+
conflicting_slot_label: string | null;
|
|
20
|
+
}
|
|
21
|
+
export type RadCheckSetTimeConflictsResult = {
|
|
22
|
+
data: RadSetTimeConflictRow[] | null;
|
|
23
|
+
error: PostgrestError | null;
|
|
24
|
+
};
|
|
25
|
+
export declare function checkRadSetTimeConflicts(supabase: SupabaseClient<Database>, params: RadCheckSetTimeConflictsParams): Promise<RadCheckSetTimeConflictsResult>;
|
package/dist/rad-rpc.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { schemaClient } from "./schema-client.js";
|
|
2
|
+
export function checkRadSetTimeConflicts(supabase, params) {
|
|
3
|
+
const radDb = schemaClient(supabase, "rad");
|
|
4
|
+
// Supabase generated types currently mark this nullable SQL text argument as
|
|
5
|
+
// non-null. Keep the correction at the shared database-contract boundary.
|
|
6
|
+
const rpc = radDb.rpc;
|
|
7
|
+
return rpc("check_set_time_conflicts", {
|
|
8
|
+
_event_edition_id: params.eventEditionId,
|
|
9
|
+
_show_date: params.showDate,
|
|
10
|
+
_slot_label: params.slotLabel,
|
|
11
|
+
_set_start: params.setStart,
|
|
12
|
+
_set_end: params.setEnd,
|
|
13
|
+
_exclude_set_time_id: params.excludeSetTimeId ?? null,
|
|
14
|
+
_exclude_assignment_id: params.excludeAssignmentId ?? null,
|
|
15
|
+
});
|
|
16
|
+
}
|
package/dist/schema-client.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export type EinSchemaName = Extract<keyof DatabaseWithoutInternals, string>;
|
|
|
5
5
|
export type EinTableRow<SchemaName extends EinSchemaName, TableName extends keyof DatabaseWithoutInternals[SchemaName]["Tables"]> = DatabaseWithoutInternals[SchemaName]["Tables"][TableName] extends {
|
|
6
6
|
Row: infer Row;
|
|
7
7
|
} ? Row : never;
|
|
8
|
-
export
|
|
8
|
+
export type EinSchemaClient<SchemaName extends EinSchemaName> = Pick<SupabaseClient<Database, SchemaName>, "from" | "rpc">;
|
|
9
|
+
export declare function schemaClient<SchemaName extends EinSchemaName>(supabase: SupabaseClient<Database>, schema: SchemaName): EinSchemaClient<SchemaName>;
|
|
9
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjromeoent/ein-supabase",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Shared Supabase types, app context, and contract helpers for EIN-connected apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"types": "./dist/json.d.ts",
|
|
33
33
|
"import": "./dist/json.js"
|
|
34
34
|
},
|
|
35
|
+
"./rad-rpc": {
|
|
36
|
+
"types": "./dist/rad-rpc.d.ts",
|
|
37
|
+
"import": "./dist/rad-rpc.js"
|
|
38
|
+
},
|
|
35
39
|
"./schema-client": {
|
|
36
40
|
"types": "./dist/schema-client.d.ts",
|
|
37
41
|
"import": "./dist/schema-client.js"
|