@vrplatform/kysely 1.3.41-4246 → 1.3.41-4247
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/build/main/control-plane/index.d.ts +1 -0
- package/build/main/control-plane/index.js.map +1 -1
- package/build/migrations/0000000000041-audit-tenant-fk.ts +66 -0
- package/build/migrations/0000000000044-tenant-cross-region-fks.ts +45 -0
- package/build/migrations/0000000000045-cloudflare-region-env.ts +100 -0
- package/build/module/control-plane/index.d.ts +1 -0
- package/build/module/control-plane/index.js.map +1 -1
- package/package.json +1 -1
- /package/build/migrations/{0000000000038-ramp-staging-connect-params.ts → 0000000000042-ramp-staging-connect-params.ts} +0 -0
- /package/build/migrations/{0000000000039-gl-pms-accounting-window-guard.ts → 0000000000043-gl-pms-accounting-window-guard.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColumnType, Kysely as K } from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n name: string | null;\n partnerId: string | null;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'public.app': ControlPlaneApp;\n 'public.bookingChannel': ControlPlaneBookingChannel;\n 'public.connectionRoute': ControlPlaneConnectionRoute;\n 'public.currency': ControlPlaneCurrency;\n 'public.feature': ControlPlaneFeature;\n 'public.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'public.controlPlaneOutbox': ControlPlaneOutbox;\n 'public.tenant': ControlPlaneTenant;\n 'public.tenantUser': ControlPlaneTenantUser;\n 'public.token': ControlPlaneToken;\n 'public.user': ControlPlaneUser;\n}\n\nexport type ControlPlaneKysely = K<ControlPlaneDB>;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColumnType, Kysely as K } from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n billingPlan: string | null;\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n name: string | null;\n partnerId: string | null;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'public.app': ControlPlaneApp;\n 'public.bookingChannel': ControlPlaneBookingChannel;\n 'public.connectionRoute': ControlPlaneConnectionRoute;\n 'public.currency': ControlPlaneCurrency;\n 'public.feature': ControlPlaneFeature;\n 'public.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'public.controlPlaneOutbox': ControlPlaneOutbox;\n 'public.tenant': ControlPlaneTenant;\n 'public.tenantUser': ControlPlaneTenantUser;\n 'public.token': ControlPlaneToken;\n 'public.user': ControlPlaneUser;\n}\n\nexport type ControlPlaneKysely = K<ControlPlaneDB>;\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
// The audit schema is an append-only trail that outlives placement: actions
|
|
5
|
+
// can be performed by tenants homed in other regions (cell workers), and the
|
|
6
|
+
// audit rows of a delete action are written after the tenant row is gone.
|
|
7
|
+
// Tenant deletion already purges audit rows explicitly
|
|
8
|
+
// (packages/repository/src/tenant/delete.ts), so the tenant FKs (and their
|
|
9
|
+
// redundant cascades) only cause false failures; drop them.
|
|
10
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
11
|
+
await sql`
|
|
12
|
+
alter table audit.action
|
|
13
|
+
drop constraint if exists action_tenant_id_fkey;
|
|
14
|
+
`.execute(db);
|
|
15
|
+
await sql`
|
|
16
|
+
alter table audit.mutation
|
|
17
|
+
drop constraint if exists mutation_tenant_id_fkey;
|
|
18
|
+
`.execute(db);
|
|
19
|
+
await sql`
|
|
20
|
+
alter table audit.effect
|
|
21
|
+
drop constraint if exists effect_tenant_id_fkey;
|
|
22
|
+
`.execute(db);
|
|
23
|
+
await sql`
|
|
24
|
+
alter table audit.effect_attempt
|
|
25
|
+
drop constraint if exists effect_attempt_tenant_id_fkey;
|
|
26
|
+
`.execute(db);
|
|
27
|
+
await sql`
|
|
28
|
+
alter table audit.journal_delta
|
|
29
|
+
drop constraint if exists journal_delta_tenant_id_fkey;
|
|
30
|
+
`.execute(db);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
34
|
+
// NOT VALID: rows referencing since-deleted or cross-region tenants may
|
|
35
|
+
// legitimately exist; only future writes are constrained again.
|
|
36
|
+
await sql`
|
|
37
|
+
alter table audit.action
|
|
38
|
+
add constraint action_tenant_id_fkey
|
|
39
|
+
foreign key (tenant_id) references public.tenant(id)
|
|
40
|
+
on delete cascade not valid;
|
|
41
|
+
`.execute(db);
|
|
42
|
+
await sql`
|
|
43
|
+
alter table audit.mutation
|
|
44
|
+
add constraint mutation_tenant_id_fkey
|
|
45
|
+
foreign key (tenant_id) references public.tenant(id)
|
|
46
|
+
on delete cascade not valid;
|
|
47
|
+
`.execute(db);
|
|
48
|
+
await sql`
|
|
49
|
+
alter table audit.effect
|
|
50
|
+
add constraint effect_tenant_id_fkey
|
|
51
|
+
foreign key (tenant_id) references public.tenant(id)
|
|
52
|
+
on delete cascade not valid;
|
|
53
|
+
`.execute(db);
|
|
54
|
+
await sql`
|
|
55
|
+
alter table audit.effect_attempt
|
|
56
|
+
add constraint effect_attempt_tenant_id_fkey
|
|
57
|
+
foreign key (tenant_id) references public.tenant(id)
|
|
58
|
+
on delete cascade not valid;
|
|
59
|
+
`.execute(db);
|
|
60
|
+
await sql`
|
|
61
|
+
alter table audit.journal_delta
|
|
62
|
+
add constraint journal_delta_tenant_id_fkey
|
|
63
|
+
foreign key (tenant_id) references public.tenant(id)
|
|
64
|
+
on delete cascade not valid;
|
|
65
|
+
`.execute(db);
|
|
66
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
// Tenant-to-tenant references (partner, billing partner, chart-of-accounts
|
|
5
|
+
// source) are cross-region: a partner homed in one cell manages tenants in
|
|
6
|
+
// another, so these self-referential FKs cannot hold within a single regional
|
|
7
|
+
// database. The control plane holds the authoritative tenant graph; the
|
|
8
|
+
// regional columns keep the ids as plain references. Drop the FKs.
|
|
9
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
10
|
+
await sql`
|
|
11
|
+
alter table public.tenant
|
|
12
|
+
drop constraint if exists tenant_partner_id_fkey;
|
|
13
|
+
`.execute(db);
|
|
14
|
+
await sql`
|
|
15
|
+
alter table public.tenant
|
|
16
|
+
drop constraint if exists tenant_billing_partner_id_fkey;
|
|
17
|
+
`.execute(db);
|
|
18
|
+
await sql`
|
|
19
|
+
alter table public.tenant
|
|
20
|
+
drop constraint if exists tenant_chart_of_account_tenant_id_fkey;
|
|
21
|
+
`.execute(db);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
25
|
+
// NOT VALID: cross-region references may already exist; only future writes
|
|
26
|
+
// are constrained again.
|
|
27
|
+
await sql`
|
|
28
|
+
alter table public.tenant
|
|
29
|
+
add constraint tenant_partner_id_fkey
|
|
30
|
+
foreign key (partner_id) references public.tenant(id)
|
|
31
|
+
on update restrict on delete restrict not valid;
|
|
32
|
+
`.execute(db);
|
|
33
|
+
await sql`
|
|
34
|
+
alter table public.tenant
|
|
35
|
+
add constraint tenant_billing_partner_id_fkey
|
|
36
|
+
foreign key (billing_partner_id) references public.tenant(id)
|
|
37
|
+
on update restrict on delete restrict not valid;
|
|
38
|
+
`.execute(db);
|
|
39
|
+
await sql`
|
|
40
|
+
alter table public.tenant
|
|
41
|
+
add constraint tenant_chart_of_account_tenant_id_fkey
|
|
42
|
+
foreign key (chart_of_account_tenant_id) references public.tenant(id)
|
|
43
|
+
on update restrict on delete restrict not valid;
|
|
44
|
+
`.execute(db);
|
|
45
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
const regionalApiEnvKeys = sql`array[
|
|
5
|
+
'staging-ap',
|
|
6
|
+
'staging-crunchy',
|
|
7
|
+
'staging-eu',
|
|
8
|
+
'staging-hostaway',
|
|
9
|
+
'staging-us',
|
|
10
|
+
'production-ap',
|
|
11
|
+
'production-crunchy',
|
|
12
|
+
'production-eu',
|
|
13
|
+
'production-hostaway',
|
|
14
|
+
'production-us'
|
|
15
|
+
]::text[]`;
|
|
16
|
+
|
|
17
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
18
|
+
await sql`
|
|
19
|
+
do $$
|
|
20
|
+
begin
|
|
21
|
+
if exists (
|
|
22
|
+
select 1
|
|
23
|
+
from public.app
|
|
24
|
+
cross join lateral jsonb_each(
|
|
25
|
+
coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
26
|
+
) as env(key, value)
|
|
27
|
+
where env.key = any(${regionalApiEnvKeys})
|
|
28
|
+
and not (
|
|
29
|
+
coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
30
|
+
? split_part(env.key, '-', 1)
|
|
31
|
+
)
|
|
32
|
+
group by public.app.id, split_part(env.key, '-', 1)
|
|
33
|
+
having count(distinct env.value::text) > 1
|
|
34
|
+
) then
|
|
35
|
+
raise exception
|
|
36
|
+
'Regional defaultConnectParamsByApiEnv values disagree; add staging/production explicitly before removing regional keys';
|
|
37
|
+
end if;
|
|
38
|
+
end $$;
|
|
39
|
+
`.execute(db);
|
|
40
|
+
|
|
41
|
+
await sql`
|
|
42
|
+
with base_values as (
|
|
43
|
+
select
|
|
44
|
+
public.app.id,
|
|
45
|
+
split_part(env.key, '-', 1) as base_env,
|
|
46
|
+
min(env.value::text)::jsonb as params
|
|
47
|
+
from public.app
|
|
48
|
+
cross join lateral jsonb_each(
|
|
49
|
+
coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
50
|
+
) as env(key, value)
|
|
51
|
+
where env.key = any(${regionalApiEnvKeys})
|
|
52
|
+
and not (
|
|
53
|
+
coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
54
|
+
? split_part(env.key, '-', 1)
|
|
55
|
+
)
|
|
56
|
+
group by public.app.id, split_part(env.key, '-', 1)
|
|
57
|
+
),
|
|
58
|
+
per_app as (
|
|
59
|
+
select id, jsonb_object_agg(base_env, params) as params_by_env
|
|
60
|
+
from base_values
|
|
61
|
+
group by id
|
|
62
|
+
)
|
|
63
|
+
update public.app
|
|
64
|
+
set authentication = jsonb_set(
|
|
65
|
+
coalesce(authentication, '{}'::jsonb),
|
|
66
|
+
'{defaultConnectParamsByApiEnv}',
|
|
67
|
+
coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
68
|
+
|| per_app.params_by_env,
|
|
69
|
+
true
|
|
70
|
+
)
|
|
71
|
+
from per_app
|
|
72
|
+
where public.app.id = per_app.id;
|
|
73
|
+
`.execute(db);
|
|
74
|
+
|
|
75
|
+
await sql`
|
|
76
|
+
update public.app
|
|
77
|
+
set authentication = jsonb_set(
|
|
78
|
+
coalesce(authentication, '{}'::jsonb),
|
|
79
|
+
'{defaultConnectParamsByApiEnv}',
|
|
80
|
+
coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
81
|
+
- 'staging-ap'
|
|
82
|
+
- 'staging-crunchy'
|
|
83
|
+
- 'staging-eu'
|
|
84
|
+
- 'staging-hostaway'
|
|
85
|
+
- 'staging-us'
|
|
86
|
+
- 'production-ap'
|
|
87
|
+
- 'production-crunchy'
|
|
88
|
+
- 'production-eu'
|
|
89
|
+
- 'production-hostaway'
|
|
90
|
+
- 'production-us',
|
|
91
|
+
true
|
|
92
|
+
)
|
|
93
|
+
where coalesce(authentication -> 'defaultConnectParamsByApiEnv', '{}'::jsonb)
|
|
94
|
+
?| ${regionalApiEnvKeys};
|
|
95
|
+
`.execute(db);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
99
|
+
await sql`select 1`.execute(db);
|
|
100
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColumnType, Kysely as K } from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n name: string | null;\n partnerId: string | null;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'public.app': ControlPlaneApp;\n 'public.bookingChannel': ControlPlaneBookingChannel;\n 'public.connectionRoute': ControlPlaneConnectionRoute;\n 'public.currency': ControlPlaneCurrency;\n 'public.feature': ControlPlaneFeature;\n 'public.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'public.controlPlaneOutbox': ControlPlaneOutbox;\n 'public.tenant': ControlPlaneTenant;\n 'public.tenantUser': ControlPlaneTenantUser;\n 'public.token': ControlPlaneToken;\n 'public.user': ControlPlaneUser;\n}\n\nexport type ControlPlaneKysely = K<ControlPlaneDB>;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColumnType, Kysely as K } from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n billingPlan: string | null;\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n name: string | null;\n partnerId: string | null;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'public.app': ControlPlaneApp;\n 'public.bookingChannel': ControlPlaneBookingChannel;\n 'public.connectionRoute': ControlPlaneConnectionRoute;\n 'public.currency': ControlPlaneCurrency;\n 'public.feature': ControlPlaneFeature;\n 'public.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'public.controlPlaneOutbox': ControlPlaneOutbox;\n 'public.tenant': ControlPlaneTenant;\n 'public.tenantUser': ControlPlaneTenantUser;\n 'public.token': ControlPlaneToken;\n 'public.user': ControlPlaneUser;\n}\n\nexport type ControlPlaneKysely = K<ControlPlaneDB>;\n"]}
|
package/package.json
CHANGED
|
File without changes
|