node-type-registry 0.18.1 → 0.20.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.
Files changed (151) hide show
  1. package/authz/authz-allow-all.js +10 -10
  2. package/authz/authz-composite.js +28 -28
  3. package/authz/authz-deny-all.js +10 -10
  4. package/authz/authz-direct-owner-any.js +19 -18
  5. package/authz/authz-direct-owner.js +17 -16
  6. package/authz/authz-entity-membership.js +39 -38
  7. package/authz/authz-member-list.js +17 -16
  8. package/authz/authz-membership-check.js +34 -34
  9. package/authz/authz-not-read-only.js +23 -22
  10. package/authz/authz-org-hierarchy.js +33 -31
  11. package/authz/authz-peer-ownership.js +40 -39
  12. package/authz/authz-publishable.js +26 -24
  13. package/authz/authz-related-entity-membership.js +57 -55
  14. package/authz/authz-related-member-list.js +35 -32
  15. package/authz/authz-related-peer-ownership.js +62 -59
  16. package/authz/authz-temporal.js +32 -30
  17. package/authz/index.d.ts +9 -9
  18. package/authz/index.js +19 -19
  19. package/blueprint-types.generated.d.ts +10 -17
  20. package/blueprint-types.generated.js +1 -1
  21. package/codegen/generate-types.js +10 -21
  22. package/data/data-composite-field.js +27 -25
  23. package/data/data-direct-owner.js +24 -23
  24. package/data/data-entity-membership.js +24 -23
  25. package/data/data-force-current-user.js +17 -16
  26. package/data/data-id.js +16 -15
  27. package/data/data-immutable-fields.js +20 -19
  28. package/data/data-inflection.js +33 -32
  29. package/data/data-inherit-from-parent.js +31 -29
  30. package/data/data-job-trigger.js +87 -84
  31. package/data/data-jsonb.js +27 -26
  32. package/data/data-owned-fields.js +25 -23
  33. package/data/data-ownership-in-entity.js +21 -21
  34. package/data/data-peoplestamps.js +19 -19
  35. package/data/data-publishable.js +16 -16
  36. package/data/data-slug.js +21 -19
  37. package/data/data-soft-delete.js +14 -14
  38. package/data/data-status-field.js +32 -31
  39. package/data/data-tags.js +23 -22
  40. package/data/data-timestamps.js +15 -15
  41. package/data/index.d.ts +17 -17
  42. package/data/index.js +35 -35
  43. package/data/search-bm25.js +34 -33
  44. package/data/search-full-text.js +49 -47
  45. package/data/search-spatial-aggregate.js +77 -74
  46. package/data/search-spatial.js +51 -50
  47. package/data/search-trgm.js +20 -19
  48. package/data/search-unified.js +170 -162
  49. package/data/search-vector.js +104 -101
  50. package/data/table-organization-settings.js +13 -13
  51. package/data/table-user-profiles.js +13 -13
  52. package/data/table-user-settings.js +13 -13
  53. package/esm/authz/authz-allow-all.js +10 -10
  54. package/esm/authz/authz-composite.js +28 -28
  55. package/esm/authz/authz-deny-all.js +10 -10
  56. package/esm/authz/authz-direct-owner-any.js +19 -18
  57. package/esm/authz/authz-direct-owner.js +17 -16
  58. package/esm/authz/authz-entity-membership.js +39 -38
  59. package/esm/authz/authz-member-list.js +17 -16
  60. package/esm/authz/authz-membership-check.js +34 -34
  61. package/esm/authz/authz-not-read-only.js +23 -22
  62. package/esm/authz/authz-org-hierarchy.js +33 -31
  63. package/esm/authz/authz-peer-ownership.js +40 -39
  64. package/esm/authz/authz-publishable.js +26 -24
  65. package/esm/authz/authz-related-entity-membership.js +57 -55
  66. package/esm/authz/authz-related-member-list.js +35 -32
  67. package/esm/authz/authz-related-peer-ownership.js +62 -59
  68. package/esm/authz/authz-temporal.js +32 -30
  69. package/esm/authz/index.d.ts +9 -9
  70. package/esm/authz/index.js +9 -9
  71. package/esm/blueprint-types.generated.d.ts +10 -17
  72. package/esm/blueprint-types.generated.js +1 -1
  73. package/esm/codegen/generate-types.js +10 -21
  74. package/esm/data/data-composite-field.js +27 -25
  75. package/esm/data/data-direct-owner.js +24 -23
  76. package/esm/data/data-entity-membership.js +24 -23
  77. package/esm/data/data-force-current-user.js +17 -16
  78. package/esm/data/data-id.js +16 -15
  79. package/esm/data/data-immutable-fields.js +20 -19
  80. package/esm/data/data-inflection.js +33 -32
  81. package/esm/data/data-inherit-from-parent.js +31 -29
  82. package/esm/data/data-job-trigger.js +87 -84
  83. package/esm/data/data-jsonb.js +27 -26
  84. package/esm/data/data-owned-fields.js +25 -23
  85. package/esm/data/data-ownership-in-entity.js +21 -21
  86. package/esm/data/data-peoplestamps.js +19 -19
  87. package/esm/data/data-publishable.js +16 -16
  88. package/esm/data/data-slug.js +21 -19
  89. package/esm/data/data-soft-delete.js +14 -14
  90. package/esm/data/data-status-field.js +32 -31
  91. package/esm/data/data-tags.js +23 -22
  92. package/esm/data/data-timestamps.js +15 -15
  93. package/esm/data/index.d.ts +17 -17
  94. package/esm/data/index.js +17 -17
  95. package/esm/data/search-bm25.js +34 -33
  96. package/esm/data/search-full-text.js +49 -47
  97. package/esm/data/search-spatial-aggregate.js +77 -74
  98. package/esm/data/search-spatial.js +51 -50
  99. package/esm/data/search-trgm.js +20 -19
  100. package/esm/data/search-unified.js +170 -162
  101. package/esm/data/search-vector.js +104 -101
  102. package/esm/data/table-organization-settings.js +13 -13
  103. package/esm/data/table-user-profiles.js +13 -13
  104. package/esm/data/table-user-settings.js +13 -13
  105. package/esm/index.d.ts +3 -3
  106. package/esm/index.js +3 -3
  107. package/esm/module-presets/auth-email-magic.js +2 -2
  108. package/esm/module-presets/auth-email.js +8 -8
  109. package/esm/module-presets/auth-passkey.js +4 -4
  110. package/esm/module-presets/auth-sso.js +7 -7
  111. package/esm/module-presets/full.js +1 -1
  112. package/esm/module-presets/index.d.ts +5 -5
  113. package/esm/module-presets/index.js +4 -4
  114. package/esm/relation/index.d.ts +1 -1
  115. package/esm/relation/index.js +1 -1
  116. package/esm/relation/relation-belongs-to.js +41 -40
  117. package/esm/relation/relation-has-many.js +42 -41
  118. package/esm/relation/relation-has-one.js +42 -41
  119. package/esm/relation/relation-many-to-many.js +70 -68
  120. package/esm/relation/relation-spatial.js +54 -54
  121. package/esm/view/index.d.ts +3 -3
  122. package/esm/view/index.js +3 -3
  123. package/esm/view/view-aggregated.js +50 -48
  124. package/esm/view/view-composite.js +18 -18
  125. package/esm/view/view-filtered-table.js +37 -36
  126. package/esm/view/view-joined-tables.js +65 -61
  127. package/esm/view/view-table-projection.js +29 -28
  128. package/index.d.ts +3 -3
  129. package/index.js +3 -3
  130. package/module-presets/auth-email-magic.js +2 -2
  131. package/module-presets/auth-email.js +8 -8
  132. package/module-presets/auth-passkey.js +4 -4
  133. package/module-presets/auth-sso.js +7 -7
  134. package/module-presets/full.js +1 -1
  135. package/module-presets/index.d.ts +5 -5
  136. package/module-presets/index.js +7 -7
  137. package/package.json +2 -2
  138. package/relation/index.d.ts +1 -1
  139. package/relation/index.js +3 -3
  140. package/relation/relation-belongs-to.js +41 -40
  141. package/relation/relation-has-many.js +42 -41
  142. package/relation/relation-has-one.js +42 -41
  143. package/relation/relation-many-to-many.js +70 -68
  144. package/relation/relation-spatial.js +54 -54
  145. package/view/index.d.ts +3 -3
  146. package/view/index.js +7 -7
  147. package/view/view-aggregated.js +50 -48
  148. package/view/view-composite.js +18 -18
  149. package/view/view-filtered-table.js +37 -36
  150. package/view/view-joined-tables.js +65 -61
  151. package/view/view-table-projection.js +29 -28
@@ -1,17 +1,17 @@
1
1
  export const TableOrganizationSettings = {
2
- "name": "TableOrganizationSettings",
3
- "slug": "table_organization_settings",
4
- "category": "data",
5
- "display_name": "Organization Settings",
6
- "description": "Creates an organization settings table with standard business fields (legal_name, address fields). Uses AuthzEntityMembership for access control.",
7
- "parameter_schema": {
8
- "type": "object",
9
- "properties": {}
2
+ name: 'TableOrganizationSettings',
3
+ slug: 'table_organization_settings',
4
+ category: 'data',
5
+ display_name: 'Organization Settings',
6
+ description: 'Creates an organization settings table with standard business fields (legal_name, address fields). Uses AuthzEntityMembership for access control.',
7
+ parameter_schema: {
8
+ type: 'object',
9
+ properties: {}
10
10
  },
11
- "tags": [
12
- "template",
13
- "settings",
14
- "membership",
15
- "schema"
11
+ tags: [
12
+ 'template',
13
+ 'settings',
14
+ 'membership',
15
+ 'schema'
16
16
  ]
17
17
  };
@@ -1,17 +1,17 @@
1
1
  export const TableUserProfiles = {
2
- "name": "TableUserProfiles",
3
- "slug": "table_user_profiles",
4
- "category": "data",
5
- "display_name": "User Profiles",
6
- "description": "Creates a user profiles table with standard profile fields (profile_picture, bio, first_name, last_name, tags, desired). Uses AuthzDirectOwner for edit access and AuthzAllowAll for select.",
7
- "parameter_schema": {
8
- "type": "object",
9
- "properties": {}
2
+ name: 'TableUserProfiles',
3
+ slug: 'table_user_profiles',
4
+ category: 'data',
5
+ display_name: 'User Profiles',
6
+ description: 'Creates a user profiles table with standard profile fields (profile_picture, bio, first_name, last_name, tags, desired). Uses AuthzDirectOwner for edit access and AuthzAllowAll for select.',
7
+ parameter_schema: {
8
+ type: 'object',
9
+ properties: {}
10
10
  },
11
- "tags": [
12
- "template",
13
- "settings",
14
- "ownership",
15
- "schema"
11
+ tags: [
12
+ 'template',
13
+ 'settings',
14
+ 'ownership',
15
+ 'schema'
16
16
  ]
17
17
  };
@@ -1,17 +1,17 @@
1
1
  export const TableUserSettings = {
2
- "name": "TableUserSettings",
3
- "slug": "table_user_settings",
4
- "category": "data",
5
- "display_name": "User Settings",
6
- "description": "Creates a user settings table for user-specific configuration. Uses AuthzDirectOwner for access control.",
7
- "parameter_schema": {
8
- "type": "object",
9
- "properties": {}
2
+ name: 'TableUserSettings',
3
+ slug: 'table_user_settings',
4
+ category: 'data',
5
+ display_name: 'User Settings',
6
+ description: 'Creates a user settings table for user-specific configuration. Uses AuthzDirectOwner for access control.',
7
+ parameter_schema: {
8
+ type: 'object',
9
+ properties: {}
10
10
  },
11
- "tags": [
12
- "template",
13
- "settings",
14
- "ownership",
15
- "schema"
11
+ tags: [
12
+ 'template',
13
+ 'settings',
14
+ 'ownership',
15
+ 'schema'
16
16
  ]
17
17
  };
package/esm/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export type { NodeTypeDefinition, JSONSchema } from './types';
2
1
  export * from './authz';
2
+ export * from './blueprint-types.generated';
3
3
  export * from './data';
4
+ export * from './module-presets';
4
5
  export * from './relation';
6
+ export type { JSONSchema, NodeTypeDefinition } from './types';
5
7
  export * from './view';
6
- export * from './blueprint-types.generated';
7
- export * from './module-presets';
8
8
  import type { NodeTypeDefinition } from './types';
9
9
  export declare const allNodeTypes: NodeTypeDefinition[];
package/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export * from './authz';
2
+ export * from './blueprint-types.generated';
2
3
  export * from './data';
4
+ export * from './module-presets';
3
5
  export * from './relation';
4
6
  export * from './view';
5
- export * from './blueprint-types.generated';
6
- export * from './module-presets';
7
7
  import * as authz from './authz';
8
8
  import * as data from './data';
9
9
  import * as relation from './relation';
@@ -12,5 +12,5 @@ export const allNodeTypes = [
12
12
  ...Object.values(authz),
13
13
  ...Object.values(data),
14
14
  ...Object.values(relation),
15
- ...Object.values(view),
15
+ ...Object.values(view)
16
16
  ];
@@ -19,8 +19,8 @@ export const PresetAuthEmailMagic = {
19
19
  'generator emits the passwordless procedures: `sign_up_magic_link`, `sign_in_magic_link`, ' +
20
20
  '`sign_in_email_otp`. Password flows still exist — you opt into passwordless-only by ' +
21
21
  'flipping the `allow_password_sign_*` toggles off in `app_settings_auth` after install. ' +
22
- "This is the right step up from `auth:email` when you want to ship magic links without yet " +
23
- "taking on SSO or passkeys.",
22
+ 'This is the right step up from `auth:email` when you want to ship magic links without yet ' +
23
+ 'taking on SSO or passkeys.',
24
24
  good_for: [
25
25
  'Consumer apps that want passwordless from day one',
26
26
  'Apps targeting users who forget passwords (newsletters, one-off tools)',
@@ -17,15 +17,15 @@ export const PresetAuthEmail = {
17
17
  name: 'auth:email',
18
18
  display_name: 'Email + Password',
19
19
  summary: 'Standard email/password auth flow. No orgs, no SSO, no MFA, no rate limits.',
20
- description: "Installs `user_auth_module` with exactly the table dependencies its insert trigger " +
21
- "hard-requires: users, app-scoped memberships, emails, secrets, encrypted secrets, " +
22
- "sessions, plus RLS. You get the standard password-based auth procedures (sign_up, " +
20
+ description: 'Installs `user_auth_module` with exactly the table dependencies its insert trigger ' +
21
+ 'hard-requires: users, app-scoped memberships, emails, secrets, encrypted secrets, ' +
22
+ 'sessions, plus RLS. You get the standard password-based auth procedures (sign_up, ' +
23
23
  "sign_in, reset_password, verify_email, delete_account, ...) and that's it. " +
24
- "Everything else in the module catalog — SSO, passkeys, SMS, rate limits, orgs, " +
25
- "invites, permissions — is deliberately omitted. This is the right shape for single-tenant " +
26
- "consumer apps in the first weeks, internal tools that need a real login, or anything " +
27
- "where you want the lightest possible working auth and will add complexity only when " +
28
- "forced to.",
24
+ 'Everything else in the module catalog — SSO, passkeys, SMS, rate limits, orgs, ' +
25
+ 'invites, permissions — is deliberately omitted. This is the right shape for single-tenant ' +
26
+ 'consumer apps in the first weeks, internal tools that need a real login, or anything ' +
27
+ 'where you want the lightest possible working auth and will add complexity only when ' +
28
+ 'forced to.',
29
29
  good_for: [
30
30
  'Single-tenant consumer apps in the first week of development',
31
31
  'Internal tools where one simple login is enough',
@@ -15,10 +15,10 @@ export const PresetAuthPasskey = {
15
15
  display_name: 'Passkeys (WebAuthn)',
16
16
  summary: '`auth:email` plus WebAuthn passkey registration and assertion.',
17
17
  description: "Installs the three modules WebAuthn needs: `webauthn_credentials_module` for each user's " +
18
- "registered public keys, `webauthn_auth_module` for the runtime challenge/assertion flow, " +
19
- "and `session_secrets_module` for the one-time challenge nonces. With these installed, " +
20
- "the generator emits WebAuthn registration/login procs. Keep password flows as a recovery " +
21
- "path, or disable them in `app_settings_auth` for passkey-only deployments.",
18
+ 'registered public keys, `webauthn_auth_module` for the runtime challenge/assertion flow, ' +
19
+ 'and `session_secrets_module` for the one-time challenge nonces. With these installed, ' +
20
+ 'the generator emits WebAuthn registration/login procs. Keep password flows as a recovery ' +
21
+ 'path, or disable them in `app_settings_auth` for passkey-only deployments.',
22
22
  good_for: [
23
23
  'Apps where you want users to adopt phishing-resistant auth',
24
24
  'Consumer apps with a tech-forward audience',
@@ -21,13 +21,13 @@ export const PresetAuthSso = {
21
21
  name: 'auth:sso',
22
22
  display_name: 'OAuth / OpenID Connect',
23
23
  summary: '`auth:email` plus OAuth providers and connected-account linkage.',
24
- description: "Adds the two modules that make SSO work: `identity_providers_module` (where provider " +
25
- "definitions live — Google, GitHub, Okta, etc., with their URLs, client IDs, and " +
26
- "encrypted client secrets) and `connected_accounts_module` (the junction mapping a " +
27
- "Constructive user to a `(provider, external_id)` pair). The generator emits " +
28
- "`sign_in_identity` and `sign_up_identity` procedures which decrypt the client secret " +
29
- "through `encrypted_secrets_module` at auth time. Keep password flows as break-glass, or " +
30
- "disable them via `app_settings_auth` toggles for strictly-SSO deployments.",
24
+ description: 'Adds the two modules that make SSO work: `identity_providers_module` (where provider ' +
25
+ 'definitions live — Google, GitHub, Okta, etc., with their URLs, client IDs, and ' +
26
+ 'encrypted client secrets) and `connected_accounts_module` (the junction mapping a ' +
27
+ 'Constructive user to a `(provider, external_id)` pair). The generator emits ' +
28
+ '`sign_in_identity` and `sign_up_identity` procedures which decrypt the client secret ' +
29
+ 'through `encrypted_secrets_module` at auth time. Keep password flows as break-glass, or ' +
30
+ 'disable them via `app_settings_auth` toggles for strictly-SSO deployments.',
31
31
  good_for: [
32
32
  'B2B apps where end users sign in via their employer IdP',
33
33
  'Consumer apps that want "Sign in with Google / GitHub"',
@@ -18,7 +18,7 @@ export const PresetFull = {
18
18
  description: 'Installs every module in the catalog: everything in `b2b` plus `storage_module` ' +
19
19
  'for file uploads and `crypto_addresses_module` / `crypto_auth_module` for ' +
20
20
  'wallet-based sign-in. This matches the current default when `provision_database_modules` ' +
21
- "is called without an explicit `v_modules` argument. Use it for fully-featured " +
21
+ 'is called without an explicit `v_modules` argument. Use it for fully-featured ' +
22
22
  'demo/example databases, kitchen-sink reference deployments, or greenfield apps that ' +
23
23
  'would rather feature-flag at the app_settings level than uninstall modules.',
24
24
  good_for: [
@@ -1,14 +1,14 @@
1
1
  export type { ModulePreset } from './types';
2
- import type { ModulePreset } from './types';
3
- import { PresetMinimal } from './minimal';
4
2
  import { PresetAuthEmail } from './auth-email';
5
3
  import { PresetAuthEmailMagic } from './auth-email-magic';
6
- import { PresetAuthSso } from './auth-sso';
7
- import { PresetAuthPasskey } from './auth-passkey';
8
4
  import { PresetAuthHardened } from './auth-hardened';
5
+ import { PresetAuthPasskey } from './auth-passkey';
6
+ import { PresetAuthSso } from './auth-sso';
9
7
  import { PresetB2b } from './b2b';
10
8
  import { PresetFull } from './full';
11
- export { PresetMinimal, PresetAuthEmail, PresetAuthEmailMagic, PresetAuthSso, PresetAuthPasskey, PresetAuthHardened, PresetB2b, PresetFull };
9
+ import { PresetMinimal } from './minimal';
10
+ import type { ModulePreset } from './types';
11
+ export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetFull, PresetMinimal };
12
12
  /**
13
13
  * Ordered list of all shipped module presets, from smallest to largest
14
14
  * module footprint. Stable ordering — CLIs / UIs can present this directly.
@@ -1,12 +1,12 @@
1
- import { PresetMinimal } from './minimal';
2
1
  import { PresetAuthEmail } from './auth-email';
3
2
  import { PresetAuthEmailMagic } from './auth-email-magic';
4
- import { PresetAuthSso } from './auth-sso';
5
- import { PresetAuthPasskey } from './auth-passkey';
6
3
  import { PresetAuthHardened } from './auth-hardened';
4
+ import { PresetAuthPasskey } from './auth-passkey';
5
+ import { PresetAuthSso } from './auth-sso';
7
6
  import { PresetB2b } from './b2b';
8
7
  import { PresetFull } from './full';
9
- export { PresetMinimal, PresetAuthEmail, PresetAuthEmailMagic, PresetAuthSso, PresetAuthPasskey, PresetAuthHardened, PresetB2b, PresetFull };
8
+ import { PresetMinimal } from './minimal';
9
+ export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetFull, PresetMinimal };
10
10
  /**
11
11
  * Ordered list of all shipped module presets, from smallest to largest
12
12
  * module footprint. Stable ordering — CLIs / UIs can present this directly.
@@ -1,5 +1,5 @@
1
1
  export { RelationBelongsTo } from './relation-belongs-to';
2
- export { RelationHasOne } from './relation-has-one';
3
2
  export { RelationHasMany } from './relation-has-many';
3
+ export { RelationHasOne } from './relation-has-one';
4
4
  export { RelationManyToMany } from './relation-many-to-many';
5
5
  export { RelationSpatial } from './relation-spatial';
@@ -1,5 +1,5 @@
1
1
  export { RelationBelongsTo } from './relation-belongs-to';
2
- export { RelationHasOne } from './relation-has-one';
3
2
  export { RelationHasMany } from './relation-has-many';
3
+ export { RelationHasOne } from './relation-has-one';
4
4
  export { RelationManyToMany } from './relation-many-to-many';
5
5
  export { RelationSpatial } from './relation-spatial';
@@ -1,52 +1,53 @@
1
1
  export const RelationBelongsTo = {
2
- "name": "RelationBelongsTo",
3
- "slug": "relation_belongs_to",
4
- "category": "relation",
5
- "display_name": "Belongs To",
6
- "description": "Creates a foreign key field on the source table referencing the target table. Auto-derives the FK field name from the target table name using inflection (e.g., projects derives project_id). delete_action is required and must be explicitly provided by the caller.",
7
- "parameter_schema": {
8
- "type": "object",
9
- "properties": {
10
- "source_table_id": {
11
- "type": "string",
12
- "format": "uuid",
13
- "description": "Table that will have the FK field added"
2
+ name: 'RelationBelongsTo',
3
+ slug: 'relation_belongs_to',
4
+ category: 'relation',
5
+ display_name: 'Belongs To',
6
+ description: 'Creates a foreign key field on the source table referencing the target table. Auto-derives the FK field name from the target table name using inflection (e.g., projects derives project_id). delete_action is required and must be explicitly provided by the caller.',
7
+ parameter_schema: {
8
+ type: 'object',
9
+ properties: {
10
+ source_table_id: {
11
+ type: 'string',
12
+ format: 'uuid',
13
+ description: 'Table that will have the FK field added'
14
14
  },
15
- "target_table_id": {
16
- "type": "string",
17
- "format": "uuid",
18
- "description": "Table being referenced by the FK"
15
+ target_table_id: {
16
+ type: 'string',
17
+ format: 'uuid',
18
+ description: 'Table being referenced by the FK'
19
19
  },
20
- "field_name": {
21
- "type": "string",
22
- "description": "FK field name on the source table. Auto-derived from target table name if omitted (e.g., projects → project_id)"
20
+ field_name: {
21
+ type: 'string',
22
+ format: 'column-ref',
23
+ description: 'FK field name on the source table. Auto-derived from target table name if omitted (e.g., projects → project_id)'
23
24
  },
24
- "delete_action": {
25
- "type": "string",
26
- "enum": [
27
- "c",
28
- "r",
29
- "n",
30
- "d",
31
- "a"
25
+ delete_action: {
26
+ type: 'string',
27
+ enum: [
28
+ 'c',
29
+ 'r',
30
+ 'n',
31
+ 'd',
32
+ 'a'
32
33
  ],
33
- "description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
34
+ description: 'FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required.'
34
35
  },
35
- "is_required": {
36
- "type": "boolean",
37
- "description": "Whether the FK field is NOT NULL",
38
- "default": true
36
+ is_required: {
37
+ type: 'boolean',
38
+ description: 'Whether the FK field is NOT NULL',
39
+ default: true
39
40
  }
40
41
  },
41
- "required": [
42
- "source_table_id",
43
- "target_table_id",
44
- "delete_action"
42
+ required: [
43
+ 'source_table_id',
44
+ 'target_table_id',
45
+ 'delete_action'
45
46
  ]
46
47
  },
47
- "tags": [
48
- "relation",
49
- "foreign_key",
50
- "schema"
48
+ tags: [
49
+ 'relation',
50
+ 'foreign_key',
51
+ 'schema'
51
52
  ]
52
53
  };
@@ -1,53 +1,54 @@
1
1
  export const RelationHasMany = {
2
- "name": "RelationHasMany",
3
- "slug": "relation_has_many",
4
- "category": "relation",
5
- "display_name": "Has Many",
6
- "description": "Creates a foreign key field on the target table referencing the source table. Inverse of RelationBelongsTo — same FK, different perspective. \"projects has many tasks\" creates tasks.project_id. Auto-derives the FK field name from the source table name using inflection. delete_action is required and must be explicitly provided by the caller.",
7
- "parameter_schema": {
8
- "type": "object",
9
- "properties": {
10
- "source_table_id": {
11
- "type": "string",
12
- "format": "uuid",
13
- "description": "Parent table being referenced by the FK (e.g., projects in projects has many tasks)"
2
+ name: 'RelationHasMany',
3
+ slug: 'relation_has_many',
4
+ category: 'relation',
5
+ display_name: 'Has Many',
6
+ description: 'Creates a foreign key field on the target table referencing the source table. Inverse of RelationBelongsTo — same FK, different perspective. "projects has many tasks" creates tasks.project_id. Auto-derives the FK field name from the source table name using inflection. delete_action is required and must be explicitly provided by the caller.',
7
+ parameter_schema: {
8
+ type: 'object',
9
+ properties: {
10
+ source_table_id: {
11
+ type: 'string',
12
+ format: 'uuid',
13
+ description: 'Parent table being referenced by the FK (e.g., projects in projects has many tasks)'
14
14
  },
15
- "target_table_id": {
16
- "type": "string",
17
- "format": "uuid",
18
- "description": "Child table that receives the FK field (e.g., tasks in projects has many tasks)"
15
+ target_table_id: {
16
+ type: 'string',
17
+ format: 'uuid',
18
+ description: 'Child table that receives the FK field (e.g., tasks in projects has many tasks)'
19
19
  },
20
- "field_name": {
21
- "type": "string",
22
- "description": "FK field name on the target table. Auto-derived from source table name if omitted (e.g., projects derives project_id)"
20
+ field_name: {
21
+ type: 'string',
22
+ format: 'column-ref',
23
+ description: 'FK field name on the target table. Auto-derived from source table name if omitted (e.g., projects derives project_id)'
23
24
  },
24
- "delete_action": {
25
- "type": "string",
26
- "enum": [
27
- "c",
28
- "r",
29
- "n",
30
- "d",
31
- "a"
25
+ delete_action: {
26
+ type: 'string',
27
+ enum: [
28
+ 'c',
29
+ 'r',
30
+ 'n',
31
+ 'd',
32
+ 'a'
32
33
  ],
33
- "description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
34
+ description: 'FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required.'
34
35
  },
35
- "is_required": {
36
- "type": "boolean",
37
- "description": "Whether the FK field is NOT NULL",
38
- "default": true
36
+ is_required: {
37
+ type: 'boolean',
38
+ description: 'Whether the FK field is NOT NULL',
39
+ default: true
39
40
  }
40
41
  },
41
- "required": [
42
- "source_table_id",
43
- "target_table_id",
44
- "delete_action"
42
+ required: [
43
+ 'source_table_id',
44
+ 'target_table_id',
45
+ 'delete_action'
45
46
  ]
46
47
  },
47
- "tags": [
48
- "relation",
49
- "foreign_key",
50
- "has_many",
51
- "schema"
48
+ tags: [
49
+ 'relation',
50
+ 'foreign_key',
51
+ 'has_many',
52
+ 'schema'
52
53
  ]
53
54
  };
@@ -1,53 +1,54 @@
1
1
  export const RelationHasOne = {
2
- "name": "RelationHasOne",
3
- "slug": "relation_has_one",
4
- "category": "relation",
5
- "display_name": "Has One",
6
- "description": "Creates a foreign key field with a unique constraint on the source table referencing the target table. Enforces 1:1 cardinality. Auto-derives the FK field name from the target table name using inflection. delete_action is required and must be explicitly provided by the caller.",
7
- "parameter_schema": {
8
- "type": "object",
9
- "properties": {
10
- "source_table_id": {
11
- "type": "string",
12
- "format": "uuid",
13
- "description": "Table that will have the FK field and unique constraint"
2
+ name: 'RelationHasOne',
3
+ slug: 'relation_has_one',
4
+ category: 'relation',
5
+ display_name: 'Has One',
6
+ description: 'Creates a foreign key field with a unique constraint on the source table referencing the target table. Enforces 1:1 cardinality. Auto-derives the FK field name from the target table name using inflection. delete_action is required and must be explicitly provided by the caller.',
7
+ parameter_schema: {
8
+ type: 'object',
9
+ properties: {
10
+ source_table_id: {
11
+ type: 'string',
12
+ format: 'uuid',
13
+ description: 'Table that will have the FK field and unique constraint'
14
14
  },
15
- "target_table_id": {
16
- "type": "string",
17
- "format": "uuid",
18
- "description": "Table being referenced by the FK"
15
+ target_table_id: {
16
+ type: 'string',
17
+ format: 'uuid',
18
+ description: 'Table being referenced by the FK'
19
19
  },
20
- "field_name": {
21
- "type": "string",
22
- "description": "FK field name on the source table. Auto-derived from target table name if omitted (e.g., users → user_id)"
20
+ field_name: {
21
+ type: 'string',
22
+ format: 'column-ref',
23
+ description: 'FK field name on the source table. Auto-derived from target table name if omitted (e.g., users → user_id)'
23
24
  },
24
- "delete_action": {
25
- "type": "string",
26
- "enum": [
27
- "c",
28
- "r",
29
- "n",
30
- "d",
31
- "a"
25
+ delete_action: {
26
+ type: 'string',
27
+ enum: [
28
+ 'c',
29
+ 'r',
30
+ 'n',
31
+ 'd',
32
+ 'a'
32
33
  ],
33
- "description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
34
+ description: 'FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required.'
34
35
  },
35
- "is_required": {
36
- "type": "boolean",
37
- "description": "Whether the FK field is NOT NULL",
38
- "default": true
36
+ is_required: {
37
+ type: 'boolean',
38
+ description: 'Whether the FK field is NOT NULL',
39
+ default: true
39
40
  }
40
41
  },
41
- "required": [
42
- "source_table_id",
43
- "target_table_id",
44
- "delete_action"
42
+ required: [
43
+ 'source_table_id',
44
+ 'target_table_id',
45
+ 'delete_action'
45
46
  ]
46
47
  },
47
- "tags": [
48
- "relation",
49
- "foreign_key",
50
- "unique",
51
- "schema"
48
+ tags: [
49
+ 'relation',
50
+ 'foreign_key',
51
+ 'unique',
52
+ 'schema'
52
53
  ]
53
54
  };