@elevasis/core 0.35.1 → 0.36.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.
- package/dist/auth/index.d.ts +45 -2
- package/dist/auth/index.js +14 -1
- package/dist/test-utils/index.d.ts +18 -0
- package/dist/test-utils/index.js +1 -1
- package/package.json +1 -1
- package/src/auth/multi-tenancy/invitations/api-schemas.ts +24 -9
- package/src/auth/multi-tenancy/invitations/index.ts +11 -9
- package/src/auth/multi-tenancy/organizations/__tests__/api-schemas.test.ts +39 -3
- package/src/auth/multi-tenancy/organizations/api-schemas.ts +36 -8
- package/src/auth/multi-tenancy/organizations/index.ts +13 -11
- package/src/business/acquisition/build-templates.test.ts +34 -0
- package/src/business/acquisition/build-templates.ts +8 -1
- package/src/organization-model/__tests__/migration-helpers.test.ts +11 -11
- package/src/organization-model/migration-helpers.ts +8 -1
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/registry/__tests__/resource-registry.test.ts +2053 -2054
- package/src/scaffold-registry/index.ts +4 -4
- package/src/supabase/database.types.ts +15 -0
- package/src/test-utils/rls/RLSTestContext.ts +3 -3
|
@@ -50,15 +50,15 @@ function monorepoRoot(): string {
|
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const YAML_FILENAME = '.claude/scaffold-registry.yml'
|
|
54
|
-
const JSON_FILENAME = '.claude/scaffold-registry.compiled.json'
|
|
53
|
+
const YAML_FILENAME = '.claude/registries/scaffold-registry.yml'
|
|
54
|
+
const JSON_FILENAME = '.claude/registries/scaffold-registry.compiled.json'
|
|
55
55
|
|
|
56
56
|
// ---------------------------------------------------------------------------
|
|
57
57
|
// Load + validate
|
|
58
58
|
// ---------------------------------------------------------------------------
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Load and Zod-validate the scaffold registry from `.claude/scaffold-registry.yml`.
|
|
61
|
+
* Load and Zod-validate the scaffold registry from `.claude/registries/scaffold-registry.yml`.
|
|
62
62
|
*
|
|
63
63
|
* Throws if:
|
|
64
64
|
* - The YAML file is missing or unreadable
|
|
@@ -123,7 +123,7 @@ export function loadScaffoldRegistry(): ScaffoldRegistry {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Load, validate, and write the pre-compiled JSON lookup file.
|
|
126
|
-
* Run this whenever `.claude/scaffold-registry.yml` changes.
|
|
126
|
+
* Run this whenever `.claude/registries/scaffold-registry.yml` changes.
|
|
127
127
|
*
|
|
128
128
|
* Called by the `pnpm scaffold:compile-registry` script (wired in Step 2 CI).
|
|
129
129
|
*/
|
|
@@ -3063,6 +3063,17 @@ export type Database = {
|
|
|
3063
3063
|
}
|
|
3064
3064
|
process_due_schedules: { Args: never; Returns: Json }
|
|
3065
3065
|
recompute_all_memberships: { Args: never; Returns: undefined }
|
|
3066
|
+
repair_membership_role_assignments: {
|
|
3067
|
+
Args: never
|
|
3068
|
+
Returns: {
|
|
3069
|
+
membership_id: string
|
|
3070
|
+
organization_id: string
|
|
3071
|
+
repaired: boolean
|
|
3072
|
+
role_id: string
|
|
3073
|
+
role_slug: string
|
|
3074
|
+
user_id: string
|
|
3075
|
+
}[]
|
|
3076
|
+
}
|
|
3066
3077
|
sync_all_memberships_with_role: {
|
|
3067
3078
|
Args: { p_role_id: string }
|
|
3068
3079
|
Returns: undefined
|
|
@@ -3071,6 +3082,10 @@ export type Database = {
|
|
|
3071
3082
|
Args: { p_membership_id: string }
|
|
3072
3083
|
Returns: undefined
|
|
3073
3084
|
}
|
|
3085
|
+
update_membership_role_assignment: {
|
|
3086
|
+
Args: { p_role_slug: string; p_workos_membership_id: string }
|
|
3087
|
+
Returns: string
|
|
3088
|
+
}
|
|
3074
3089
|
upsert_user_profile: {
|
|
3075
3090
|
Args: never
|
|
3076
3091
|
Returns: {
|
|
@@ -249,9 +249,9 @@ export class RLSTestContext {
|
|
|
249
249
|
throw new Error(`Failed to look up system role '${slug}': ${roleErr?.message ?? 'not found'}`)
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
const { error: assignErr } = await this.adminClient
|
|
253
|
-
.from('org_rol_assignments')
|
|
254
|
-
.
|
|
252
|
+
const { error: assignErr } = await this.adminClient
|
|
253
|
+
.from('org_rol_assignments')
|
|
254
|
+
.upsert({ membership_id: membershipId, role_id: roleDef.id }, { onConflict: 'membership_id,role_id' })
|
|
255
255
|
|
|
256
256
|
if (assignErr) {
|
|
257
257
|
throw new Error(`Failed to assign system role '${slug}' to membership: ${assignErr.message}`)
|