node-type-registry 0.29.0 → 0.30.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/data/data-realtime.d.ts +2 -0
- package/data/data-realtime.js +31 -0
- package/data/index.d.ts +1 -0
- package/data/index.js +3 -1
- package/esm/data/data-realtime.d.ts +2 -0
- package/esm/data/data-realtime.js +28 -0
- package/esm/data/index.d.ts +1 -0
- package/esm/data/index.js +1 -0
- package/esm/module-presets/auth-email-magic.js +3 -0
- package/esm/module-presets/auth-email.d.ts +6 -2
- package/esm/module-presets/auth-email.js +21 -12
- package/esm/module-presets/auth-hardened.js +3 -1
- package/esm/module-presets/auth-passkey.js +3 -0
- package/esm/module-presets/auth-sso.js +3 -0
- package/esm/module-presets/b2b-storage.d.ts +13 -0
- package/esm/module-presets/b2b-storage.js +70 -0
- package/esm/module-presets/index.d.ts +2 -1
- package/esm/module-presets/index.js +3 -1
- package/module-presets/auth-email-magic.js +3 -0
- package/module-presets/auth-email.d.ts +6 -2
- package/module-presets/auth-email.js +21 -12
- package/module-presets/auth-hardened.js +3 -1
- package/module-presets/auth-passkey.js +3 -0
- package/module-presets/auth-sso.js +3 -0
- package/module-presets/b2b-storage.d.ts +13 -0
- package/module-presets/b2b-storage.js +73 -0
- package/module-presets/index.d.ts +2 -1
- package/module-presets/index.js +4 -1
- package/package.json +2 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataRealtime = void 0;
|
|
4
|
+
exports.DataRealtime = {
|
|
5
|
+
name: 'DataRealtime',
|
|
6
|
+
slug: 'data_realtime',
|
|
7
|
+
category: 'data',
|
|
8
|
+
display_name: 'Realtime Subscriptions',
|
|
9
|
+
description: 'Creates per-table subscriber tables in subscriptions_public with ' +
|
|
10
|
+
'RLS policies derived from source table SELECT policies. Attaches ' +
|
|
11
|
+
'statement-level triggers to emit changes to subscribers.',
|
|
12
|
+
parameter_schema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
operations: {
|
|
16
|
+
type: 'array',
|
|
17
|
+
items: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
enum: ['INSERT', 'UPDATE', 'DELETE']
|
|
20
|
+
},
|
|
21
|
+
description: 'Which DML operations to track with emit_change triggers',
|
|
22
|
+
default: ['INSERT', 'UPDATE', 'DELETE']
|
|
23
|
+
},
|
|
24
|
+
subscriber_table_name: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Custom name for the subscriber table (defaults to {source_table}_subscriber)'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
tags: ['realtime', 'subscriptions', 'triggers']
|
|
31
|
+
};
|
package/data/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { DataOwnedFields } from './data-owned-fields';
|
|
|
17
17
|
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
18
18
|
export { DataPeoplestamps } from './data-peoplestamps';
|
|
19
19
|
export { DataPublishable } from './data-publishable';
|
|
20
|
+
export { DataRealtime } from './data-realtime';
|
|
20
21
|
export { DataSlug } from './data-slug';
|
|
21
22
|
export { DataSoftDelete } from './data-soft-delete';
|
|
22
23
|
export { DataStatusField } from './data-status-field';
|
package/data/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableUserSettings = exports.TableUserProfiles = exports.TableOrganizationSettings = exports.SearchVector = exports.SearchUnified = exports.SearchTrgm = exports.SearchSpatialAggregate = exports.SearchSpatial = exports.SearchFullText = exports.SearchBm25 = exports.DataTimestamps = exports.DataTags = exports.DataStatusField = exports.DataSoftDelete = exports.DataSlug = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.DataOwnedFields = exports.DataJsonb = exports.DataLimitCounter = exports.DataJobTrigger = exports.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataImageEmbedding = exports.DataId = exports.DataForceCurrentUser = exports.DataFeatureFlag = exports.DataFileEmbedding = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = exports.DataChunks = void 0;
|
|
3
|
+
exports.TableUserSettings = exports.TableUserProfiles = exports.TableOrganizationSettings = exports.SearchVector = exports.SearchUnified = exports.SearchTrgm = exports.SearchSpatialAggregate = exports.SearchSpatial = exports.SearchFullText = exports.SearchBm25 = exports.DataTimestamps = exports.DataTags = exports.DataStatusField = exports.DataSoftDelete = exports.DataSlug = exports.DataRealtime = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.DataOwnedFields = exports.DataJsonb = exports.DataLimitCounter = exports.DataJobTrigger = exports.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataImageEmbedding = exports.DataId = exports.DataForceCurrentUser = exports.DataFeatureFlag = exports.DataFileEmbedding = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = exports.DataChunks = void 0;
|
|
4
4
|
var data_chunks_1 = require("./data-chunks");
|
|
5
5
|
Object.defineProperty(exports, "DataChunks", { enumerable: true, get: function () { return data_chunks_1.DataChunks; } });
|
|
6
6
|
var data_composite_field_1 = require("./data-composite-field");
|
|
@@ -39,6 +39,8 @@ var data_peoplestamps_1 = require("./data-peoplestamps");
|
|
|
39
39
|
Object.defineProperty(exports, "DataPeoplestamps", { enumerable: true, get: function () { return data_peoplestamps_1.DataPeoplestamps; } });
|
|
40
40
|
var data_publishable_1 = require("./data-publishable");
|
|
41
41
|
Object.defineProperty(exports, "DataPublishable", { enumerable: true, get: function () { return data_publishable_1.DataPublishable; } });
|
|
42
|
+
var data_realtime_1 = require("./data-realtime");
|
|
43
|
+
Object.defineProperty(exports, "DataRealtime", { enumerable: true, get: function () { return data_realtime_1.DataRealtime; } });
|
|
42
44
|
var data_slug_1 = require("./data-slug");
|
|
43
45
|
Object.defineProperty(exports, "DataSlug", { enumerable: true, get: function () { return data_slug_1.DataSlug; } });
|
|
44
46
|
var data_soft_delete_1 = require("./data-soft-delete");
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const DataRealtime = {
|
|
2
|
+
name: 'DataRealtime',
|
|
3
|
+
slug: 'data_realtime',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'Realtime Subscriptions',
|
|
6
|
+
description: 'Creates per-table subscriber tables in subscriptions_public with ' +
|
|
7
|
+
'RLS policies derived from source table SELECT policies. Attaches ' +
|
|
8
|
+
'statement-level triggers to emit changes to subscribers.',
|
|
9
|
+
parameter_schema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
operations: {
|
|
13
|
+
type: 'array',
|
|
14
|
+
items: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
enum: ['INSERT', 'UPDATE', 'DELETE']
|
|
17
|
+
},
|
|
18
|
+
description: 'Which DML operations to track with emit_change triggers',
|
|
19
|
+
default: ['INSERT', 'UPDATE', 'DELETE']
|
|
20
|
+
},
|
|
21
|
+
subscriber_table_name: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Custom name for the subscriber table (defaults to {source_table}_subscriber)'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
tags: ['realtime', 'subscriptions', 'triggers']
|
|
28
|
+
};
|
package/esm/data/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { DataOwnedFields } from './data-owned-fields';
|
|
|
17
17
|
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
18
18
|
export { DataPeoplestamps } from './data-peoplestamps';
|
|
19
19
|
export { DataPublishable } from './data-publishable';
|
|
20
|
+
export { DataRealtime } from './data-realtime';
|
|
20
21
|
export { DataSlug } from './data-slug';
|
|
21
22
|
export { DataSoftDelete } from './data-soft-delete';
|
|
22
23
|
export { DataStatusField } from './data-status-field';
|
package/esm/data/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { DataOwnedFields } from './data-owned-fields';
|
|
|
17
17
|
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
18
18
|
export { DataPeoplestamps } from './data-peoplestamps';
|
|
19
19
|
export { DataPublishable } from './data-publishable';
|
|
20
|
+
export { DataRealtime } from './data-realtime';
|
|
20
21
|
export { DataSlug } from './data-slug';
|
|
21
22
|
export { DataSoftDelete } from './data-soft-delete';
|
|
22
23
|
export { DataStatusField } from './data-status-field';
|
|
@@ -9,9 +9,13 @@ import type { ModulePreset } from './types';
|
|
|
9
9
|
* `set_password`, `reset_password`, `forgot_password`, `verify_email`,
|
|
10
10
|
* `delete_account`, `my_sessions`, API-key CRUD. Nothing more.
|
|
11
11
|
*
|
|
12
|
+
* Includes `permissions_module:app`, `limits_module:app`, and
|
|
13
|
+
* `levels_module:app` because `memberships_module:app` has NOT NULL
|
|
14
|
+
* foreign keys to the tables they create (grants, caps, levels).
|
|
15
|
+
*
|
|
12
16
|
* It deliberately excludes rate limits, connected accounts / identity
|
|
13
17
|
* providers (OAuth), WebAuthn (passkeys), phone numbers (SMS), invites,
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* and org-scoped memberships. Bolt those on by moving to a richer preset
|
|
19
|
+
* (`auth:hardened`, `b2b`) when you actually need them.
|
|
16
20
|
*/
|
|
17
21
|
export declare const PresetAuthEmail: ModulePreset;
|
|
@@ -8,24 +8,28 @@
|
|
|
8
8
|
* `set_password`, `reset_password`, `forgot_password`, `verify_email`,
|
|
9
9
|
* `delete_account`, `my_sessions`, API-key CRUD. Nothing more.
|
|
10
10
|
*
|
|
11
|
+
* Includes `permissions_module:app`, `limits_module:app`, and
|
|
12
|
+
* `levels_module:app` because `memberships_module:app` has NOT NULL
|
|
13
|
+
* foreign keys to the tables they create (grants, caps, levels).
|
|
14
|
+
*
|
|
11
15
|
* It deliberately excludes rate limits, connected accounts / identity
|
|
12
16
|
* providers (OAuth), WebAuthn (passkeys), phone numbers (SMS), invites,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
17
|
+
* and org-scoped memberships. Bolt those on by moving to a richer preset
|
|
18
|
+
* (`auth:hardened`, `b2b`) when you actually need them.
|
|
15
19
|
*/
|
|
16
20
|
export const PresetAuthEmail = {
|
|
17
21
|
name: 'auth:email',
|
|
18
22
|
display_name: 'Email + Password',
|
|
19
|
-
summary: 'Standard email/password auth flow. No orgs, no SSO, no MFA
|
|
23
|
+
summary: 'Standard email/password auth flow with app-level permissions. No orgs, no SSO, no MFA.',
|
|
20
24
|
description: 'Installs `user_auth_module` with exactly the table dependencies its insert trigger ' +
|
|
21
|
-
'hard-requires: users, app-scoped memberships
|
|
22
|
-
'sessions, plus RLS. You get the
|
|
23
|
-
|
|
24
|
-
'Everything else in the module
|
|
25
|
-
'
|
|
26
|
-
'consumer apps in the first weeks, internal
|
|
27
|
-
'where you want the lightest possible working
|
|
28
|
-
'forced to.',
|
|
25
|
+
'hard-requires: users, app-scoped memberships (plus their permissions/limits/levels ' +
|
|
26
|
+
'dependencies), emails, secrets, encrypted secrets, sessions, plus RLS. You get the ' +
|
|
27
|
+
'standard password-based auth procedures (sign_up, sign_in, reset_password, ' +
|
|
28
|
+
"verify_email, delete_account, ...) and that's it. Everything else in the module " +
|
|
29
|
+
'catalog — SSO, passkeys, SMS, rate limits, orgs, invites — is deliberately omitted. ' +
|
|
30
|
+
'This is the right shape for single-tenant consumer apps in the first weeks, internal ' +
|
|
31
|
+
'tools that need a real login, or anything where you want the lightest possible working ' +
|
|
32
|
+
'auth and will add complexity only when forced to.',
|
|
29
33
|
good_for: [
|
|
30
34
|
'Single-tenant consumer apps in the first week of development',
|
|
31
35
|
'Internal tools where one simple login is enough',
|
|
@@ -40,6 +44,9 @@ export const PresetAuthEmail = {
|
|
|
40
44
|
modules: [
|
|
41
45
|
'users_module',
|
|
42
46
|
'membership_types_module',
|
|
47
|
+
'permissions_module:app',
|
|
48
|
+
'limits_module:app',
|
|
49
|
+
'levels_module:app',
|
|
43
50
|
'memberships_module:app',
|
|
44
51
|
'sessions_module',
|
|
45
52
|
'secrets_module',
|
|
@@ -51,6 +58,9 @@ export const PresetAuthEmail = {
|
|
|
51
58
|
includes_notes: {
|
|
52
59
|
'memberships_module:app': 'Required by `user_auth_module`: every user gets an app-level membership row at sign-up.',
|
|
53
60
|
membership_types_module: "Required by `memberships_module:app`; defines the 'app' scope.",
|
|
61
|
+
'permissions_module:app': 'Required by `memberships_module:app`: NOT NULL FK to grants table.',
|
|
62
|
+
'limits_module:app': 'Required by `memberships_module:app`: NOT NULL FK to caps table.',
|
|
63
|
+
'levels_module:app': 'Required by `memberships_module:app`: NOT NULL FK to levels table.',
|
|
54
64
|
emails_module: 'Required by the `user_auth_module` insert trigger (`RAISE EXCEPTION REQUIRES emails_module`).',
|
|
55
65
|
encrypted_secrets_module: 'Required for password hashing; referenced by `set_password`, `verify_password`, and reset flows.',
|
|
56
66
|
secrets_module: 'API-key storage (`create_api_key`, `revoke_api_key`, `my_api_keys`).'
|
|
@@ -62,7 +72,6 @@ export const PresetAuthEmail = {
|
|
|
62
72
|
webauthn_credentials_module: 'No passkeys — add `auth:passkey`.',
|
|
63
73
|
phone_numbers_module: 'No SMS login — add `auth:hardened` or the SMS-only refactor path.',
|
|
64
74
|
'memberships_module:org': 'No org/team structure — move to `b2b` when you need one.',
|
|
65
|
-
'permissions_module:app': 'No fine-grained RBAC; the `is_admin` flag on users is the only gate.',
|
|
66
75
|
invites_module: 'Self-serve signup only.',
|
|
67
76
|
session_secrets_module: 'No magic-link / email-OTP nonces; add `auth:email+magic`.'
|
|
68
77
|
}
|
|
@@ -30,6 +30,9 @@ export const PresetAuthHardened = {
|
|
|
30
30
|
modules: [
|
|
31
31
|
'users_module',
|
|
32
32
|
'membership_types_module',
|
|
33
|
+
'permissions_module:app',
|
|
34
|
+
'limits_module:app',
|
|
35
|
+
'levels_module:app',
|
|
33
36
|
'memberships_module:app',
|
|
34
37
|
'sessions_module',
|
|
35
38
|
'secrets_module',
|
|
@@ -56,7 +59,6 @@ export const PresetAuthHardened = {
|
|
|
56
59
|
},
|
|
57
60
|
omits_notes: {
|
|
58
61
|
'memberships_module:org': 'No orgs / teams — use `b2b` when you need multi-tenancy.',
|
|
59
|
-
'permissions_module:app': 'No RBAC beyond the `is_admin` flag — add via `b2b`.',
|
|
60
62
|
invites_module: 'No invite flow — add via `b2b`.',
|
|
61
63
|
storage_module: 'Add separately if you need file uploads.',
|
|
62
64
|
crypto_addresses_module: 'Not a web3 preset; omit unless doing wallet sign-in.'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModulePreset } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* `b2b:storage` — everything in `b2b` plus `storage_module` for file uploads.
|
|
4
|
+
*
|
|
5
|
+
* This is the common shape for B2B SaaS apps that need file upload
|
|
6
|
+
* infrastructure tied to their org/workspace structure. The storage module
|
|
7
|
+
* creates `app_buckets` and `app_files` tables with RLS policies, and
|
|
8
|
+
* entity-type-level storage scopes can be provisioned on top.
|
|
9
|
+
*
|
|
10
|
+
* If you don't need orgs, use a lighter preset and add `storage_module`
|
|
11
|
+
* separately via provisioning options.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PresetB2bStorage: ModulePreset;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `b2b:storage` — everything in `b2b` plus `storage_module` for file uploads.
|
|
3
|
+
*
|
|
4
|
+
* This is the common shape for B2B SaaS apps that need file upload
|
|
5
|
+
* infrastructure tied to their org/workspace structure. The storage module
|
|
6
|
+
* creates `app_buckets` and `app_files` tables with RLS policies, and
|
|
7
|
+
* entity-type-level storage scopes can be provisioned on top.
|
|
8
|
+
*
|
|
9
|
+
* If you don't need orgs, use a lighter preset and add `storage_module`
|
|
10
|
+
* separately via provisioning options.
|
|
11
|
+
*/
|
|
12
|
+
export const PresetB2bStorage = {
|
|
13
|
+
name: 'b2b:storage',
|
|
14
|
+
display_name: 'B2B SaaS + File Storage',
|
|
15
|
+
summary: '`b2b` + file upload infrastructure (buckets, files, RLS).',
|
|
16
|
+
description: 'Everything in `b2b` (auth:hardened + orgs + invites + permissions + levels + profiles + ' +
|
|
17
|
+
'hierarchy), plus `storage_module` for file uploads. The storage module creates ' +
|
|
18
|
+
'`app_buckets` and `app_files` tables with full RLS: AuthzPublishable for public reads, ' +
|
|
19
|
+
'AuthzAppMembership for member access, AuthzDirectOwner for uploader-only modify/delete. ' +
|
|
20
|
+
'Entity-type provisioning with `has_storage=true` adds per-scope storage tables ' +
|
|
21
|
+
'automatically. Choose this when your B2B app needs file uploads, avatars, attachments, ' +
|
|
22
|
+
'or any object storage tied to workspaces.',
|
|
23
|
+
good_for: [
|
|
24
|
+
'B2B SaaS with file uploads (documents, avatars, attachments)',
|
|
25
|
+
'Apps where storage is scoped to orgs/workspaces',
|
|
26
|
+
'Apps that need per-entity-type file storage (e.g., project files, team assets)'
|
|
27
|
+
],
|
|
28
|
+
not_for: [
|
|
29
|
+
'Single-tenant consumer apps — use `auth:email` or `auth:hardened` and add storage separately',
|
|
30
|
+
'Apps without file upload needs — use `b2b` to avoid the storage table overhead'
|
|
31
|
+
],
|
|
32
|
+
modules: [
|
|
33
|
+
'users_module',
|
|
34
|
+
'membership_types_module',
|
|
35
|
+
'permissions_module:app',
|
|
36
|
+
'permissions_module:org',
|
|
37
|
+
'limits_module:app',
|
|
38
|
+
'limits_module:org',
|
|
39
|
+
'levels_module:app',
|
|
40
|
+
'levels_module:org',
|
|
41
|
+
'memberships_module:app',
|
|
42
|
+
'memberships_module:org',
|
|
43
|
+
'sessions_module',
|
|
44
|
+
'secrets_module',
|
|
45
|
+
'encrypted_secrets_module',
|
|
46
|
+
'emails_module',
|
|
47
|
+
'rls_module',
|
|
48
|
+
'user_auth_module',
|
|
49
|
+
'session_secrets_module',
|
|
50
|
+
'rate_limits_module',
|
|
51
|
+
'connected_accounts_module',
|
|
52
|
+
'identity_providers_module',
|
|
53
|
+
'webauthn_credentials_module',
|
|
54
|
+
'webauthn_auth_module',
|
|
55
|
+
'phone_numbers_module',
|
|
56
|
+
'profiles_module:app',
|
|
57
|
+
'profiles_module:org',
|
|
58
|
+
'hierarchy_module:org',
|
|
59
|
+
'invites_module:app',
|
|
60
|
+
'invites_module:org',
|
|
61
|
+
'storage_module'
|
|
62
|
+
],
|
|
63
|
+
includes_notes: {
|
|
64
|
+
storage_module: 'File upload infrastructure: app_buckets + app_files tables with RLS. Entity-type storage scopes layered on top via `has_storage=true`.'
|
|
65
|
+
},
|
|
66
|
+
omits_notes: {
|
|
67
|
+
crypto_addresses_module: 'Not a web3 preset.'
|
|
68
|
+
},
|
|
69
|
+
extends: ['b2b']
|
|
70
|
+
};
|
|
@@ -5,10 +5,11 @@ import { PresetAuthHardened } from './auth-hardened';
|
|
|
5
5
|
import { PresetAuthPasskey } from './auth-passkey';
|
|
6
6
|
import { PresetAuthSso } from './auth-sso';
|
|
7
7
|
import { PresetB2b } from './b2b';
|
|
8
|
+
import { PresetB2bStorage } from './b2b-storage';
|
|
8
9
|
import { PresetFull } from './full';
|
|
9
10
|
import { PresetMinimal } from './minimal';
|
|
10
11
|
import type { ModulePreset } from './types';
|
|
11
|
-
export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetFull, PresetMinimal };
|
|
12
|
+
export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetB2bStorage, PresetFull, PresetMinimal };
|
|
12
13
|
/**
|
|
13
14
|
* Ordered list of all shipped module presets, from smallest to largest
|
|
14
15
|
* module footprint. Stable ordering — CLIs / UIs can present this directly.
|
|
@@ -4,9 +4,10 @@ import { PresetAuthHardened } from './auth-hardened';
|
|
|
4
4
|
import { PresetAuthPasskey } from './auth-passkey';
|
|
5
5
|
import { PresetAuthSso } from './auth-sso';
|
|
6
6
|
import { PresetB2b } from './b2b';
|
|
7
|
+
import { PresetB2bStorage } from './b2b-storage';
|
|
7
8
|
import { PresetFull } from './full';
|
|
8
9
|
import { PresetMinimal } from './minimal';
|
|
9
|
-
export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetFull, PresetMinimal };
|
|
10
|
+
export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetB2bStorage, PresetFull, PresetMinimal };
|
|
10
11
|
/**
|
|
11
12
|
* Ordered list of all shipped module presets, from smallest to largest
|
|
12
13
|
* module footprint. Stable ordering — CLIs / UIs can present this directly.
|
|
@@ -19,6 +20,7 @@ export const allModulePresets = [
|
|
|
19
20
|
PresetAuthPasskey,
|
|
20
21
|
PresetAuthHardened,
|
|
21
22
|
PresetB2b,
|
|
23
|
+
PresetB2bStorage,
|
|
22
24
|
PresetFull
|
|
23
25
|
];
|
|
24
26
|
/** Look up a preset by name. Returns undefined if the name isn't known. */
|
|
@@ -9,9 +9,13 @@ import type { ModulePreset } from './types';
|
|
|
9
9
|
* `set_password`, `reset_password`, `forgot_password`, `verify_email`,
|
|
10
10
|
* `delete_account`, `my_sessions`, API-key CRUD. Nothing more.
|
|
11
11
|
*
|
|
12
|
+
* Includes `permissions_module:app`, `limits_module:app`, and
|
|
13
|
+
* `levels_module:app` because `memberships_module:app` has NOT NULL
|
|
14
|
+
* foreign keys to the tables they create (grants, caps, levels).
|
|
15
|
+
*
|
|
12
16
|
* It deliberately excludes rate limits, connected accounts / identity
|
|
13
17
|
* providers (OAuth), WebAuthn (passkeys), phone numbers (SMS), invites,
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* and org-scoped memberships. Bolt those on by moving to a richer preset
|
|
19
|
+
* (`auth:hardened`, `b2b`) when you actually need them.
|
|
16
20
|
*/
|
|
17
21
|
export declare const PresetAuthEmail: ModulePreset;
|
|
@@ -11,24 +11,28 @@ exports.PresetAuthEmail = void 0;
|
|
|
11
11
|
* `set_password`, `reset_password`, `forgot_password`, `verify_email`,
|
|
12
12
|
* `delete_account`, `my_sessions`, API-key CRUD. Nothing more.
|
|
13
13
|
*
|
|
14
|
+
* Includes `permissions_module:app`, `limits_module:app`, and
|
|
15
|
+
* `levels_module:app` because `memberships_module:app` has NOT NULL
|
|
16
|
+
* foreign keys to the tables they create (grants, caps, levels).
|
|
17
|
+
*
|
|
14
18
|
* It deliberately excludes rate limits, connected accounts / identity
|
|
15
19
|
* providers (OAuth), WebAuthn (passkeys), phone numbers (SMS), invites,
|
|
16
|
-
*
|
|
17
|
-
*
|
|
20
|
+
* and org-scoped memberships. Bolt those on by moving to a richer preset
|
|
21
|
+
* (`auth:hardened`, `b2b`) when you actually need them.
|
|
18
22
|
*/
|
|
19
23
|
exports.PresetAuthEmail = {
|
|
20
24
|
name: 'auth:email',
|
|
21
25
|
display_name: 'Email + Password',
|
|
22
|
-
summary: 'Standard email/password auth flow. No orgs, no SSO, no MFA
|
|
26
|
+
summary: 'Standard email/password auth flow with app-level permissions. No orgs, no SSO, no MFA.',
|
|
23
27
|
description: 'Installs `user_auth_module` with exactly the table dependencies its insert trigger ' +
|
|
24
|
-
'hard-requires: users, app-scoped memberships
|
|
25
|
-
'sessions, plus RLS. You get the
|
|
26
|
-
|
|
27
|
-
'Everything else in the module
|
|
28
|
-
'
|
|
29
|
-
'consumer apps in the first weeks, internal
|
|
30
|
-
'where you want the lightest possible working
|
|
31
|
-
'forced to.',
|
|
28
|
+
'hard-requires: users, app-scoped memberships (plus their permissions/limits/levels ' +
|
|
29
|
+
'dependencies), emails, secrets, encrypted secrets, sessions, plus RLS. You get the ' +
|
|
30
|
+
'standard password-based auth procedures (sign_up, sign_in, reset_password, ' +
|
|
31
|
+
"verify_email, delete_account, ...) and that's it. Everything else in the module " +
|
|
32
|
+
'catalog — SSO, passkeys, SMS, rate limits, orgs, invites — is deliberately omitted. ' +
|
|
33
|
+
'This is the right shape for single-tenant consumer apps in the first weeks, internal ' +
|
|
34
|
+
'tools that need a real login, or anything where you want the lightest possible working ' +
|
|
35
|
+
'auth and will add complexity only when forced to.',
|
|
32
36
|
good_for: [
|
|
33
37
|
'Single-tenant consumer apps in the first week of development',
|
|
34
38
|
'Internal tools where one simple login is enough',
|
|
@@ -43,6 +47,9 @@ exports.PresetAuthEmail = {
|
|
|
43
47
|
modules: [
|
|
44
48
|
'users_module',
|
|
45
49
|
'membership_types_module',
|
|
50
|
+
'permissions_module:app',
|
|
51
|
+
'limits_module:app',
|
|
52
|
+
'levels_module:app',
|
|
46
53
|
'memberships_module:app',
|
|
47
54
|
'sessions_module',
|
|
48
55
|
'secrets_module',
|
|
@@ -54,6 +61,9 @@ exports.PresetAuthEmail = {
|
|
|
54
61
|
includes_notes: {
|
|
55
62
|
'memberships_module:app': 'Required by `user_auth_module`: every user gets an app-level membership row at sign-up.',
|
|
56
63
|
membership_types_module: "Required by `memberships_module:app`; defines the 'app' scope.",
|
|
64
|
+
'permissions_module:app': 'Required by `memberships_module:app`: NOT NULL FK to grants table.',
|
|
65
|
+
'limits_module:app': 'Required by `memberships_module:app`: NOT NULL FK to caps table.',
|
|
66
|
+
'levels_module:app': 'Required by `memberships_module:app`: NOT NULL FK to levels table.',
|
|
57
67
|
emails_module: 'Required by the `user_auth_module` insert trigger (`RAISE EXCEPTION REQUIRES emails_module`).',
|
|
58
68
|
encrypted_secrets_module: 'Required for password hashing; referenced by `set_password`, `verify_password`, and reset flows.',
|
|
59
69
|
secrets_module: 'API-key storage (`create_api_key`, `revoke_api_key`, `my_api_keys`).'
|
|
@@ -65,7 +75,6 @@ exports.PresetAuthEmail = {
|
|
|
65
75
|
webauthn_credentials_module: 'No passkeys — add `auth:passkey`.',
|
|
66
76
|
phone_numbers_module: 'No SMS login — add `auth:hardened` or the SMS-only refactor path.',
|
|
67
77
|
'memberships_module:org': 'No org/team structure — move to `b2b` when you need one.',
|
|
68
|
-
'permissions_module:app': 'No fine-grained RBAC; the `is_admin` flag on users is the only gate.',
|
|
69
78
|
invites_module: 'Self-serve signup only.',
|
|
70
79
|
session_secrets_module: 'No magic-link / email-OTP nonces; add `auth:email+magic`.'
|
|
71
80
|
}
|
|
@@ -33,6 +33,9 @@ exports.PresetAuthHardened = {
|
|
|
33
33
|
modules: [
|
|
34
34
|
'users_module',
|
|
35
35
|
'membership_types_module',
|
|
36
|
+
'permissions_module:app',
|
|
37
|
+
'limits_module:app',
|
|
38
|
+
'levels_module:app',
|
|
36
39
|
'memberships_module:app',
|
|
37
40
|
'sessions_module',
|
|
38
41
|
'secrets_module',
|
|
@@ -59,7 +62,6 @@ exports.PresetAuthHardened = {
|
|
|
59
62
|
},
|
|
60
63
|
omits_notes: {
|
|
61
64
|
'memberships_module:org': 'No orgs / teams — use `b2b` when you need multi-tenancy.',
|
|
62
|
-
'permissions_module:app': 'No RBAC beyond the `is_admin` flag — add via `b2b`.',
|
|
63
65
|
invites_module: 'No invite flow — add via `b2b`.',
|
|
64
66
|
storage_module: 'Add separately if you need file uploads.',
|
|
65
67
|
crypto_addresses_module: 'Not a web3 preset; omit unless doing wallet sign-in.'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModulePreset } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* `b2b:storage` — everything in `b2b` plus `storage_module` for file uploads.
|
|
4
|
+
*
|
|
5
|
+
* This is the common shape for B2B SaaS apps that need file upload
|
|
6
|
+
* infrastructure tied to their org/workspace structure. The storage module
|
|
7
|
+
* creates `app_buckets` and `app_files` tables with RLS policies, and
|
|
8
|
+
* entity-type-level storage scopes can be provisioned on top.
|
|
9
|
+
*
|
|
10
|
+
* If you don't need orgs, use a lighter preset and add `storage_module`
|
|
11
|
+
* separately via provisioning options.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PresetB2bStorage: ModulePreset;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresetB2bStorage = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `b2b:storage` — everything in `b2b` plus `storage_module` for file uploads.
|
|
6
|
+
*
|
|
7
|
+
* This is the common shape for B2B SaaS apps that need file upload
|
|
8
|
+
* infrastructure tied to their org/workspace structure. The storage module
|
|
9
|
+
* creates `app_buckets` and `app_files` tables with RLS policies, and
|
|
10
|
+
* entity-type-level storage scopes can be provisioned on top.
|
|
11
|
+
*
|
|
12
|
+
* If you don't need orgs, use a lighter preset and add `storage_module`
|
|
13
|
+
* separately via provisioning options.
|
|
14
|
+
*/
|
|
15
|
+
exports.PresetB2bStorage = {
|
|
16
|
+
name: 'b2b:storage',
|
|
17
|
+
display_name: 'B2B SaaS + File Storage',
|
|
18
|
+
summary: '`b2b` + file upload infrastructure (buckets, files, RLS).',
|
|
19
|
+
description: 'Everything in `b2b` (auth:hardened + orgs + invites + permissions + levels + profiles + ' +
|
|
20
|
+
'hierarchy), plus `storage_module` for file uploads. The storage module creates ' +
|
|
21
|
+
'`app_buckets` and `app_files` tables with full RLS: AuthzPublishable for public reads, ' +
|
|
22
|
+
'AuthzAppMembership for member access, AuthzDirectOwner for uploader-only modify/delete. ' +
|
|
23
|
+
'Entity-type provisioning with `has_storage=true` adds per-scope storage tables ' +
|
|
24
|
+
'automatically. Choose this when your B2B app needs file uploads, avatars, attachments, ' +
|
|
25
|
+
'or any object storage tied to workspaces.',
|
|
26
|
+
good_for: [
|
|
27
|
+
'B2B SaaS with file uploads (documents, avatars, attachments)',
|
|
28
|
+
'Apps where storage is scoped to orgs/workspaces',
|
|
29
|
+
'Apps that need per-entity-type file storage (e.g., project files, team assets)'
|
|
30
|
+
],
|
|
31
|
+
not_for: [
|
|
32
|
+
'Single-tenant consumer apps — use `auth:email` or `auth:hardened` and add storage separately',
|
|
33
|
+
'Apps without file upload needs — use `b2b` to avoid the storage table overhead'
|
|
34
|
+
],
|
|
35
|
+
modules: [
|
|
36
|
+
'users_module',
|
|
37
|
+
'membership_types_module',
|
|
38
|
+
'permissions_module:app',
|
|
39
|
+
'permissions_module:org',
|
|
40
|
+
'limits_module:app',
|
|
41
|
+
'limits_module:org',
|
|
42
|
+
'levels_module:app',
|
|
43
|
+
'levels_module:org',
|
|
44
|
+
'memberships_module:app',
|
|
45
|
+
'memberships_module:org',
|
|
46
|
+
'sessions_module',
|
|
47
|
+
'secrets_module',
|
|
48
|
+
'encrypted_secrets_module',
|
|
49
|
+
'emails_module',
|
|
50
|
+
'rls_module',
|
|
51
|
+
'user_auth_module',
|
|
52
|
+
'session_secrets_module',
|
|
53
|
+
'rate_limits_module',
|
|
54
|
+
'connected_accounts_module',
|
|
55
|
+
'identity_providers_module',
|
|
56
|
+
'webauthn_credentials_module',
|
|
57
|
+
'webauthn_auth_module',
|
|
58
|
+
'phone_numbers_module',
|
|
59
|
+
'profiles_module:app',
|
|
60
|
+
'profiles_module:org',
|
|
61
|
+
'hierarchy_module:org',
|
|
62
|
+
'invites_module:app',
|
|
63
|
+
'invites_module:org',
|
|
64
|
+
'storage_module'
|
|
65
|
+
],
|
|
66
|
+
includes_notes: {
|
|
67
|
+
storage_module: 'File upload infrastructure: app_buckets + app_files tables with RLS. Entity-type storage scopes layered on top via `has_storage=true`.'
|
|
68
|
+
},
|
|
69
|
+
omits_notes: {
|
|
70
|
+
crypto_addresses_module: 'Not a web3 preset.'
|
|
71
|
+
},
|
|
72
|
+
extends: ['b2b']
|
|
73
|
+
};
|
|
@@ -5,10 +5,11 @@ import { PresetAuthHardened } from './auth-hardened';
|
|
|
5
5
|
import { PresetAuthPasskey } from './auth-passkey';
|
|
6
6
|
import { PresetAuthSso } from './auth-sso';
|
|
7
7
|
import { PresetB2b } from './b2b';
|
|
8
|
+
import { PresetB2bStorage } from './b2b-storage';
|
|
8
9
|
import { PresetFull } from './full';
|
|
9
10
|
import { PresetMinimal } from './minimal';
|
|
10
11
|
import type { ModulePreset } from './types';
|
|
11
|
-
export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetFull, PresetMinimal };
|
|
12
|
+
export { PresetAuthEmail, PresetAuthEmailMagic, PresetAuthHardened, PresetAuthPasskey, PresetAuthSso, PresetB2b, PresetB2bStorage, PresetFull, PresetMinimal };
|
|
12
13
|
/**
|
|
13
14
|
* Ordered list of all shipped module presets, from smallest to largest
|
|
14
15
|
* module footprint. Stable ordering — CLIs / UIs can present this directly.
|
package/module-presets/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.allModulePresets = exports.PresetMinimal = exports.PresetFull = exports.PresetB2b = exports.PresetAuthSso = exports.PresetAuthPasskey = exports.PresetAuthHardened = exports.PresetAuthEmailMagic = exports.PresetAuthEmail = void 0;
|
|
3
|
+
exports.allModulePresets = exports.PresetMinimal = exports.PresetFull = exports.PresetB2bStorage = exports.PresetB2b = exports.PresetAuthSso = exports.PresetAuthPasskey = exports.PresetAuthHardened = exports.PresetAuthEmailMagic = exports.PresetAuthEmail = void 0;
|
|
4
4
|
exports.getModulePreset = getModulePreset;
|
|
5
5
|
const auth_email_1 = require("./auth-email");
|
|
6
6
|
Object.defineProperty(exports, "PresetAuthEmail", { enumerable: true, get: function () { return auth_email_1.PresetAuthEmail; } });
|
|
@@ -14,6 +14,8 @@ const auth_sso_1 = require("./auth-sso");
|
|
|
14
14
|
Object.defineProperty(exports, "PresetAuthSso", { enumerable: true, get: function () { return auth_sso_1.PresetAuthSso; } });
|
|
15
15
|
const b2b_1 = require("./b2b");
|
|
16
16
|
Object.defineProperty(exports, "PresetB2b", { enumerable: true, get: function () { return b2b_1.PresetB2b; } });
|
|
17
|
+
const b2b_storage_1 = require("./b2b-storage");
|
|
18
|
+
Object.defineProperty(exports, "PresetB2bStorage", { enumerable: true, get: function () { return b2b_storage_1.PresetB2bStorage; } });
|
|
17
19
|
const full_1 = require("./full");
|
|
18
20
|
Object.defineProperty(exports, "PresetFull", { enumerable: true, get: function () { return full_1.PresetFull; } });
|
|
19
21
|
const minimal_1 = require("./minimal");
|
|
@@ -30,6 +32,7 @@ exports.allModulePresets = [
|
|
|
30
32
|
auth_passkey_1.PresetAuthPasskey,
|
|
31
33
|
auth_hardened_1.PresetAuthHardened,
|
|
32
34
|
b2b_1.PresetB2b,
|
|
35
|
+
b2b_storage_1.PresetB2bStorage,
|
|
33
36
|
full_1.PresetFull
|
|
34
37
|
];
|
|
35
38
|
/** Look up a preset by name. Returns undefined if the name isn't known. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-type-registry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Node type definitions for the Constructive blueprint system. Single source of truth for all Authz*, Data*, Relation*, and View* node types.",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"main": "index.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"registry",
|
|
48
48
|
"graphile"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "90016935b53d6fb84e0b83879377f0c2eb9abce6"
|
|
51
51
|
}
|