node-type-registry 0.37.0 → 0.38.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/blueprint-types.generated.d.ts +7 -7
- package/codegen/generate-types.js +4 -4
- package/data/index.d.ts +0 -15
- package/data/index.js +1 -31
- package/esm/blueprint-types.generated.d.ts +7 -7
- package/esm/codegen/generate-types.js +4 -4
- package/esm/data/index.d.ts +0 -15
- package/esm/data/index.js +0 -15
- package/esm/event/index.d.ts +2 -0
- package/esm/event/index.js +2 -0
- package/esm/event/referral.d.ts +2 -0
- package/esm/event/referral.js +62 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +12 -0
- package/esm/job/index.d.ts +1 -0
- package/esm/job/index.js +1 -0
- package/esm/limit/index.d.ts +8 -0
- package/esm/limit/index.js +8 -0
- package/esm/module-presets/auth-email-magic.js +2 -2
- package/esm/module-presets/auth-email.js +5 -5
- package/esm/module-presets/auth-hardened.js +2 -2
- package/esm/module-presets/auth-passkey.js +2 -2
- package/esm/module-presets/auth-sso.d.ts +1 -1
- package/esm/module-presets/auth-sso.js +5 -5
- package/esm/module-presets/b2b-storage.js +6 -6
- package/esm/module-presets/b2b.js +2 -2
- package/esm/module-presets/minimal.d.ts +1 -1
- package/esm/module-presets/minimal.js +3 -3
- package/esm/{data/data-chunks.js → process/chunks.js} +2 -3
- package/esm/{data/data-file-embedding.js → process/file-embedding.js} +2 -2
- package/esm/process/index.d.ts +5 -0
- package/esm/process/index.js +5 -0
- package/event/index.d.ts +2 -0
- package/event/index.js +7 -0
- package/event/referral.d.ts +2 -0
- package/event/referral.js +65 -0
- package/index.d.ts +4 -0
- package/index.js +12 -0
- package/job/index.d.ts +1 -0
- package/job/index.js +5 -0
- package/limit/index.d.ts +8 -0
- package/limit/index.js +19 -0
- package/module-presets/auth-email-magic.js +2 -2
- package/module-presets/auth-email.js +5 -5
- package/module-presets/auth-hardened.js +2 -2
- package/module-presets/auth-passkey.js +2 -2
- package/module-presets/auth-sso.d.ts +1 -1
- package/module-presets/auth-sso.js +5 -5
- package/module-presets/b2b-storage.js +6 -6
- package/module-presets/b2b.js +2 -2
- package/module-presets/minimal.d.ts +1 -1
- package/module-presets/minimal.js +3 -3
- package/package.json +2 -2
- package/{data/data-chunks.js → process/chunks.js} +2 -3
- package/{data/data-file-embedding.js → process/file-embedding.js} +2 -2
- package/process/index.d.ts +5 -0
- package/process/index.js +13 -0
- /package/{data/event-tracker.d.ts → esm/event/tracker.d.ts} +0 -0
- /package/esm/{data/event-tracker.js → event/tracker.js} +0 -0
- /package/{data/data-job-trigger.d.ts → esm/job/trigger.d.ts} +0 -0
- /package/esm/{data/data-job-trigger.js → job/trigger.js} +0 -0
- /package/{data/data-aggregate-limit-counter.d.ts → esm/limit/enforce-aggregate.d.ts} +0 -0
- /package/esm/{data/data-aggregate-limit-counter.js → limit/enforce-aggregate.js} +0 -0
- /package/{data/data-limit-counter.d.ts → esm/limit/enforce-counter.d.ts} +0 -0
- /package/esm/{data/data-limit-counter.js → limit/enforce-counter.js} +0 -0
- /package/{data/data-feature-flag.d.ts → esm/limit/enforce-feature.d.ts} +0 -0
- /package/esm/{data/data-feature-flag.js → limit/enforce-feature.js} +0 -0
- /package/{data/data-meter-rate-limit.d.ts → esm/limit/enforce-rate.d.ts} +0 -0
- /package/esm/{data/data-meter-rate-limit.js → limit/enforce-rate.js} +0 -0
- /package/{data/data-billing-meter.d.ts → esm/limit/track-usage.d.ts} +0 -0
- /package/esm/{data/data-billing-meter.js → limit/track-usage.js} +0 -0
- /package/{data/limit-warning-aggregate.d.ts → esm/limit/warning-aggregate.d.ts} +0 -0
- /package/esm/{data/limit-warning-aggregate.js → limit/warning-aggregate.js} +0 -0
- /package/{data/limit-warning-counter.d.ts → esm/limit/warning-counter.d.ts} +0 -0
- /package/esm/{data/limit-warning-counter.js → limit/warning-counter.js} +0 -0
- /package/{data/limit-warning-rate.d.ts → esm/limit/warning-rate.d.ts} +0 -0
- /package/esm/{data/limit-warning-rate.js → limit/warning-rate.js} +0 -0
- /package/{data/data-chunks.d.ts → esm/process/chunks.d.ts} +0 -0
- /package/{data/process-extraction.d.ts → esm/process/extraction.d.ts} +0 -0
- /package/esm/{data/process-extraction.js → process/extraction.js} +0 -0
- /package/{data/data-file-embedding.d.ts → esm/process/file-embedding.d.ts} +0 -0
- /package/{data/data-image-embedding.d.ts → esm/process/image-embedding.d.ts} +0 -0
- /package/esm/{data/data-image-embedding.js → process/image-embedding.js} +0 -0
- /package/{data/process-image-versions.d.ts → esm/process/image-versions.d.ts} +0 -0
- /package/esm/{data/process-image-versions.js → process/image-versions.js} +0 -0
- /package/{esm/data/event-tracker.d.ts → event/tracker.d.ts} +0 -0
- /package/{data/event-tracker.js → event/tracker.js} +0 -0
- /package/{esm/data/data-job-trigger.d.ts → job/trigger.d.ts} +0 -0
- /package/{data/data-job-trigger.js → job/trigger.js} +0 -0
- /package/{esm/data/data-aggregate-limit-counter.d.ts → limit/enforce-aggregate.d.ts} +0 -0
- /package/{data/data-aggregate-limit-counter.js → limit/enforce-aggregate.js} +0 -0
- /package/{esm/data/data-limit-counter.d.ts → limit/enforce-counter.d.ts} +0 -0
- /package/{data/data-limit-counter.js → limit/enforce-counter.js} +0 -0
- /package/{esm/data/data-feature-flag.d.ts → limit/enforce-feature.d.ts} +0 -0
- /package/{data/data-feature-flag.js → limit/enforce-feature.js} +0 -0
- /package/{esm/data/data-meter-rate-limit.d.ts → limit/enforce-rate.d.ts} +0 -0
- /package/{data/data-meter-rate-limit.js → limit/enforce-rate.js} +0 -0
- /package/{esm/data/data-billing-meter.d.ts → limit/track-usage.d.ts} +0 -0
- /package/{data/data-billing-meter.js → limit/track-usage.js} +0 -0
- /package/{esm/data/limit-warning-aggregate.d.ts → limit/warning-aggregate.d.ts} +0 -0
- /package/{data/limit-warning-aggregate.js → limit/warning-aggregate.js} +0 -0
- /package/{esm/data/limit-warning-counter.d.ts → limit/warning-counter.d.ts} +0 -0
- /package/{data/limit-warning-counter.js → limit/warning-counter.js} +0 -0
- /package/{esm/data/limit-warning-rate.d.ts → limit/warning-rate.d.ts} +0 -0
- /package/{data/limit-warning-rate.js → limit/warning-rate.js} +0 -0
- /package/{esm/data/data-chunks.d.ts → process/chunks.d.ts} +0 -0
- /package/{esm/data/process-extraction.d.ts → process/extraction.d.ts} +0 -0
- /package/{data/process-extraction.js → process/extraction.js} +0 -0
- /package/{esm/data/data-file-embedding.d.ts → process/file-embedding.d.ts} +0 -0
- /package/{esm/data/data-image-embedding.d.ts → process/image-embedding.d.ts} +0 -0
- /package/{data/data-image-embedding.js → process/image-embedding.js} +0 -0
- /package/{esm/data/process-image-versions.d.ts → process/image-versions.d.ts} +0 -0
- /package/{data/process-image-versions.js → process/image-versions.js} +0 -0
|
@@ -810,7 +810,9 @@ export interface BlueprintBucketSeed {
|
|
|
810
810
|
}
|
|
811
811
|
/** Storage configuration for an entity type. Seeds initial buckets, overrides module-level settings (expiry times, file size limits, CORS), and provides per-table provisioning overrides via provisions. */
|
|
812
812
|
export interface BlueprintStorageConfig {
|
|
813
|
-
/**
|
|
813
|
+
/** Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case. */
|
|
814
|
+
storage_key?: string;
|
|
815
|
+
/** Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning. */
|
|
814
816
|
buckets?: BlueprintBucketSeed[];
|
|
815
817
|
/** Override for presigned upload URL expiry time in seconds. */
|
|
816
818
|
upload_url_expiry_seconds?: number;
|
|
@@ -901,8 +903,6 @@ export interface BlueprintEntityType {
|
|
|
901
903
|
has_profiles?: boolean;
|
|
902
904
|
/** Whether to provision a levels module for this entity type. Defaults to false. */
|
|
903
905
|
has_levels?: boolean;
|
|
904
|
-
/** Whether to provision a storage module (buckets, files tables) for this entity type. Defaults to false. */
|
|
905
|
-
has_storage?: boolean;
|
|
906
906
|
/** Whether to provision entity-scoped invite tables ({prefix}_invites, {prefix}_claimed_invites) and a submit_{prefix}_invite_code() function. Defaults to false. */
|
|
907
907
|
has_invites?: boolean;
|
|
908
908
|
/** Whether to auto-attach an EventTracker to the claimed_invites table for invite-based achievements. Requires has_invites=true AND has_levels=true. When true, records 'invite_claimed' events credited to the sender (inviter) on each claimed invite. Defaults to false. */
|
|
@@ -911,8 +911,8 @@ export interface BlueprintEntityType {
|
|
|
911
911
|
skip_entity_policies?: boolean;
|
|
912
912
|
/** Override for the entity table. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, its policies[] replaces the five default entity-table policies; is_visible becomes a no-op. When NULL (default), the five default policies are applied (gated by is_visible). */
|
|
913
913
|
table_provision?: BlueprintEntityTableProvision;
|
|
914
|
-
/** Storage configuration.
|
|
915
|
-
storage?: BlueprintStorageConfig;
|
|
914
|
+
/** Storage configuration (array-only). A non-empty array enables storage provisioning. Each entry creates a separate storage module with its own tables ({prefix}_{storage_key}_buckets/files). Controls RLS policies, bucket seeding, and module-level settings. */
|
|
915
|
+
storage?: BlueprintStorageConfig[];
|
|
916
916
|
}
|
|
917
917
|
/** String shorthand -- just the node type name. */
|
|
918
918
|
export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'LimitAggregate' | 'BillingMeter' | 'DataBulk' | 'ProcessChunks' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'ProcessFileEmbedding' | 'LimitFeatureFlag' | 'DataForceCurrentUser' | 'DataId' | 'ProcessImageEmbedding' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'JobTrigger' | 'LimitCounter' | 'DataJsonb' | 'DataOwnedFields' | 'ProcessExtraction' | 'ProcessImageVersions' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings';
|
|
@@ -1177,8 +1177,8 @@ export interface BlueprintDefinition {
|
|
|
1177
1177
|
unique_constraints?: BlueprintUniqueConstraint[];
|
|
1178
1178
|
/** Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security. */
|
|
1179
1179
|
entity_types?: BlueprintEntityType[];
|
|
1180
|
-
/** App-level storage configuration. Creates
|
|
1181
|
-
storage?: BlueprintStorageConfig;
|
|
1180
|
+
/** App-level storage configuration (array-only). Creates storage_module(s) (membership_type = NULL), seeds initial buckets, and overrides module-level settings. Each entry creates a separate storage module. For entity-scoped storage, use entity_types[].storage instead. */
|
|
1181
|
+
storage?: BlueprintStorageConfig[];
|
|
1182
1182
|
/** Achievement definitions. Each entry creates a level with requirements and optional rewards in the events_module. Requires events_module to be provisioned (e.g., via entity_types[].has_levels = true or modules includes events_module). */
|
|
1183
1183
|
achievements?: BlueprintAchievement[];
|
|
1184
1184
|
}
|
|
@@ -515,7 +515,8 @@ function buildBlueprintBucketSeed() {
|
|
|
515
515
|
*/
|
|
516
516
|
function buildBlueprintStorageConfig() {
|
|
517
517
|
return addJSDoc(exportInterface('BlueprintStorageConfig', [
|
|
518
|
-
addJSDoc(optionalProp('
|
|
518
|
+
addJSDoc(optionalProp('storage_key', t.tsStringKeyword()), 'Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case.'),
|
|
519
|
+
addJSDoc(optionalProp('buckets', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintBucketSeed')))), 'Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning.'),
|
|
519
520
|
addJSDoc(optionalProp('upload_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned upload URL expiry time in seconds.'),
|
|
520
521
|
addJSDoc(optionalProp('download_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned download URL expiry time in seconds.'),
|
|
521
522
|
addJSDoc(optionalProp('default_max_file_size', t.tsNumberKeyword()), 'Default maximum file size in bytes for the storage module.'),
|
|
@@ -582,12 +583,11 @@ function buildBlueprintEntityType() {
|
|
|
582
583
|
addJSDoc(optionalProp('has_limits', t.tsBooleanKeyword()), 'Whether to provision a limits module for this entity type. Defaults to false.'),
|
|
583
584
|
addJSDoc(optionalProp('has_profiles', t.tsBooleanKeyword()), 'Whether to provision a profiles module for this entity type. Defaults to false.'),
|
|
584
585
|
addJSDoc(optionalProp('has_levels', t.tsBooleanKeyword()), 'Whether to provision a levels module for this entity type. Defaults to false.'),
|
|
585
|
-
addJSDoc(optionalProp('has_storage', t.tsBooleanKeyword()), 'Whether to provision a storage module (buckets, files tables) for this entity type. Defaults to false.'),
|
|
586
586
|
addJSDoc(optionalProp('has_invites', t.tsBooleanKeyword()), 'Whether to provision entity-scoped invite tables ({prefix}_invites, {prefix}_claimed_invites) and a submit_{prefix}_invite_code() function. Defaults to false.'),
|
|
587
587
|
addJSDoc(optionalProp('has_invite_achievements', t.tsBooleanKeyword()), "Whether to auto-attach an EventTracker to the claimed_invites table for invite-based achievements. Requires has_invites=true AND has_levels=true. When true, records 'invite_claimed' events credited to the sender (inviter) on each claimed invite. Defaults to false."),
|
|
588
588
|
addJSDoc(optionalProp('skip_entity_policies', t.tsBooleanKeyword()), 'Escape hatch: when true AND table_provision is NULL, zero policies are provisioned on the entity table. Defaults to false.'),
|
|
589
589
|
addJSDoc(optionalProp('table_provision', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))), 'Override for the entity table. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, its policies[] replaces the five default entity-table policies; is_visible becomes a no-op. When NULL (default), the five default policies are applied (gated by is_visible).'),
|
|
590
|
-
addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'Storage configuration.
|
|
590
|
+
addJSDoc(optionalProp('storage', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintStorageConfig')))), 'Storage module configuration array. Each entry provisions a separate storage module with its own tables, RLS, and settings. When non-empty, has_storage is derived as true. Each entry may specify a storage_key for multi-module support (defaults to "default").')
|
|
591
591
|
]), 'An entity type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision.');
|
|
592
592
|
}
|
|
593
593
|
function buildBlueprintTable() {
|
|
@@ -615,7 +615,7 @@ function buildBlueprintDefinition() {
|
|
|
615
615
|
addJSDoc(optionalProp('full_text_searches', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintFullTextSearch')))), 'Full-text search configurations.'),
|
|
616
616
|
addJSDoc(optionalProp('unique_constraints', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintUniqueConstraint')))), 'Unique constraints on table columns.'),
|
|
617
617
|
addJSDoc(optionalProp('entity_types', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintEntityType')))), 'Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security.'),
|
|
618
|
-
addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'App-level storage configuration.
|
|
618
|
+
addJSDoc(optionalProp('storage', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintStorageConfig')))), 'App-level storage configuration array. Each entry creates a storage_module (membership_type = NULL) with its own tables and settings. For entity-scoped storage, use entity_types[].storage instead.'),
|
|
619
619
|
addJSDoc(optionalProp('achievements', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintAchievement')))), 'Achievement definitions. Each entry creates a level with requirements and optional rewards in the events_module. Requires events_module to be provisioned (e.g., via entity_types[].has_levels = true or modules includes events_module).')
|
|
620
620
|
]), 'The complete blueprint definition -- the JSONB shape accepted by construct_blueprint().');
|
|
621
621
|
}
|
package/data/index.d.ts
CHANGED
|
@@ -2,32 +2,17 @@ export { CheckGreaterThan } from './check-greater-than';
|
|
|
2
2
|
export { CheckLessThan } from './check-less-than';
|
|
3
3
|
export { CheckNotEqual } from './check-not-equal';
|
|
4
4
|
export { CheckOneOf } from './check-one-of';
|
|
5
|
-
export { LimitEnforceAggregate } from './data-aggregate-limit-counter';
|
|
6
|
-
export { LimitTrackUsage } from './data-billing-meter';
|
|
7
5
|
export { DataBulk } from './data-bulk';
|
|
8
|
-
export { ProcessChunks } from './data-chunks';
|
|
9
6
|
export { DataCompositeField } from './data-composite-field';
|
|
10
7
|
export { DataDirectOwner } from './data-direct-owner';
|
|
11
8
|
export { DataEntityMembership } from './data-entity-membership';
|
|
12
|
-
export { EventTracker } from './event-tracker';
|
|
13
|
-
export { ProcessFileEmbedding } from './data-file-embedding';
|
|
14
|
-
export { LimitEnforceFeature } from './data-feature-flag';
|
|
15
9
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
16
10
|
export { DataId } from './data-id';
|
|
17
|
-
export { ProcessImageEmbedding } from './data-image-embedding';
|
|
18
11
|
export { DataImmutableFields } from './data-immutable-fields';
|
|
19
12
|
export { DataInflection } from './data-inflection';
|
|
20
13
|
export { DataInheritFromParent } from './data-inherit-from-parent';
|
|
21
|
-
export { JobTrigger } from './data-job-trigger';
|
|
22
|
-
export { LimitEnforceCounter } from './data-limit-counter';
|
|
23
|
-
export { LimitEnforceRate } from './data-meter-rate-limit';
|
|
24
|
-
export { LimitWarningCounter } from './limit-warning-counter';
|
|
25
|
-
export { LimitWarningAggregate } from './limit-warning-aggregate';
|
|
26
|
-
export { LimitWarningRate } from './limit-warning-rate';
|
|
27
14
|
export { DataJsonb } from './data-jsonb';
|
|
28
15
|
export { DataOwnedFields } from './data-owned-fields';
|
|
29
|
-
export { ProcessExtraction } from './process-extraction';
|
|
30
|
-
export { ProcessImageVersions } from './process-image-versions';
|
|
31
16
|
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
32
17
|
export { DataPeoplestamps } from './data-peoplestamps';
|
|
33
18
|
export { DataPublishable } from './data-publishable';
|
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.DataRealtime = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.
|
|
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.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataId = exports.DataForceCurrentUser = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = exports.DataBulk = exports.CheckOneOf = exports.CheckNotEqual = exports.CheckLessThan = exports.CheckGreaterThan = void 0;
|
|
4
4
|
var check_greater_than_1 = require("./check-greater-than");
|
|
5
5
|
Object.defineProperty(exports, "CheckGreaterThan", { enumerable: true, get: function () { return check_greater_than_1.CheckGreaterThan; } });
|
|
6
6
|
var check_less_than_1 = require("./check-less-than");
|
|
@@ -9,58 +9,28 @@ var check_not_equal_1 = require("./check-not-equal");
|
|
|
9
9
|
Object.defineProperty(exports, "CheckNotEqual", { enumerable: true, get: function () { return check_not_equal_1.CheckNotEqual; } });
|
|
10
10
|
var check_one_of_1 = require("./check-one-of");
|
|
11
11
|
Object.defineProperty(exports, "CheckOneOf", { enumerable: true, get: function () { return check_one_of_1.CheckOneOf; } });
|
|
12
|
-
var data_aggregate_limit_counter_1 = require("./data-aggregate-limit-counter");
|
|
13
|
-
Object.defineProperty(exports, "LimitEnforceAggregate", { enumerable: true, get: function () { return data_aggregate_limit_counter_1.LimitEnforceAggregate; } });
|
|
14
|
-
var data_billing_meter_1 = require("./data-billing-meter");
|
|
15
|
-
Object.defineProperty(exports, "LimitTrackUsage", { enumerable: true, get: function () { return data_billing_meter_1.LimitTrackUsage; } });
|
|
16
12
|
var data_bulk_1 = require("./data-bulk");
|
|
17
13
|
Object.defineProperty(exports, "DataBulk", { enumerable: true, get: function () { return data_bulk_1.DataBulk; } });
|
|
18
|
-
var data_chunks_1 = require("./data-chunks");
|
|
19
|
-
Object.defineProperty(exports, "ProcessChunks", { enumerable: true, get: function () { return data_chunks_1.ProcessChunks; } });
|
|
20
14
|
var data_composite_field_1 = require("./data-composite-field");
|
|
21
15
|
Object.defineProperty(exports, "DataCompositeField", { enumerable: true, get: function () { return data_composite_field_1.DataCompositeField; } });
|
|
22
16
|
var data_direct_owner_1 = require("./data-direct-owner");
|
|
23
17
|
Object.defineProperty(exports, "DataDirectOwner", { enumerable: true, get: function () { return data_direct_owner_1.DataDirectOwner; } });
|
|
24
18
|
var data_entity_membership_1 = require("./data-entity-membership");
|
|
25
19
|
Object.defineProperty(exports, "DataEntityMembership", { enumerable: true, get: function () { return data_entity_membership_1.DataEntityMembership; } });
|
|
26
|
-
var event_tracker_1 = require("./event-tracker");
|
|
27
|
-
Object.defineProperty(exports, "EventTracker", { enumerable: true, get: function () { return event_tracker_1.EventTracker; } });
|
|
28
|
-
var data_file_embedding_1 = require("./data-file-embedding");
|
|
29
|
-
Object.defineProperty(exports, "ProcessFileEmbedding", { enumerable: true, get: function () { return data_file_embedding_1.ProcessFileEmbedding; } });
|
|
30
|
-
var data_feature_flag_1 = require("./data-feature-flag");
|
|
31
|
-
Object.defineProperty(exports, "LimitEnforceFeature", { enumerable: true, get: function () { return data_feature_flag_1.LimitEnforceFeature; } });
|
|
32
20
|
var data_force_current_user_1 = require("./data-force-current-user");
|
|
33
21
|
Object.defineProperty(exports, "DataForceCurrentUser", { enumerable: true, get: function () { return data_force_current_user_1.DataForceCurrentUser; } });
|
|
34
22
|
var data_id_1 = require("./data-id");
|
|
35
23
|
Object.defineProperty(exports, "DataId", { enumerable: true, get: function () { return data_id_1.DataId; } });
|
|
36
|
-
var data_image_embedding_1 = require("./data-image-embedding");
|
|
37
|
-
Object.defineProperty(exports, "ProcessImageEmbedding", { enumerable: true, get: function () { return data_image_embedding_1.ProcessImageEmbedding; } });
|
|
38
24
|
var data_immutable_fields_1 = require("./data-immutable-fields");
|
|
39
25
|
Object.defineProperty(exports, "DataImmutableFields", { enumerable: true, get: function () { return data_immutable_fields_1.DataImmutableFields; } });
|
|
40
26
|
var data_inflection_1 = require("./data-inflection");
|
|
41
27
|
Object.defineProperty(exports, "DataInflection", { enumerable: true, get: function () { return data_inflection_1.DataInflection; } });
|
|
42
28
|
var data_inherit_from_parent_1 = require("./data-inherit-from-parent");
|
|
43
29
|
Object.defineProperty(exports, "DataInheritFromParent", { enumerable: true, get: function () { return data_inherit_from_parent_1.DataInheritFromParent; } });
|
|
44
|
-
var data_job_trigger_1 = require("./data-job-trigger");
|
|
45
|
-
Object.defineProperty(exports, "JobTrigger", { enumerable: true, get: function () { return data_job_trigger_1.JobTrigger; } });
|
|
46
|
-
var data_limit_counter_1 = require("./data-limit-counter");
|
|
47
|
-
Object.defineProperty(exports, "LimitEnforceCounter", { enumerable: true, get: function () { return data_limit_counter_1.LimitEnforceCounter; } });
|
|
48
|
-
var data_meter_rate_limit_1 = require("./data-meter-rate-limit");
|
|
49
|
-
Object.defineProperty(exports, "LimitEnforceRate", { enumerable: true, get: function () { return data_meter_rate_limit_1.LimitEnforceRate; } });
|
|
50
|
-
var limit_warning_counter_1 = require("./limit-warning-counter");
|
|
51
|
-
Object.defineProperty(exports, "LimitWarningCounter", { enumerable: true, get: function () { return limit_warning_counter_1.LimitWarningCounter; } });
|
|
52
|
-
var limit_warning_aggregate_1 = require("./limit-warning-aggregate");
|
|
53
|
-
Object.defineProperty(exports, "LimitWarningAggregate", { enumerable: true, get: function () { return limit_warning_aggregate_1.LimitWarningAggregate; } });
|
|
54
|
-
var limit_warning_rate_1 = require("./limit-warning-rate");
|
|
55
|
-
Object.defineProperty(exports, "LimitWarningRate", { enumerable: true, get: function () { return limit_warning_rate_1.LimitWarningRate; } });
|
|
56
30
|
var data_jsonb_1 = require("./data-jsonb");
|
|
57
31
|
Object.defineProperty(exports, "DataJsonb", { enumerable: true, get: function () { return data_jsonb_1.DataJsonb; } });
|
|
58
32
|
var data_owned_fields_1 = require("./data-owned-fields");
|
|
59
33
|
Object.defineProperty(exports, "DataOwnedFields", { enumerable: true, get: function () { return data_owned_fields_1.DataOwnedFields; } });
|
|
60
|
-
var process_extraction_1 = require("./process-extraction");
|
|
61
|
-
Object.defineProperty(exports, "ProcessExtraction", { enumerable: true, get: function () { return process_extraction_1.ProcessExtraction; } });
|
|
62
|
-
var process_image_versions_1 = require("./process-image-versions");
|
|
63
|
-
Object.defineProperty(exports, "ProcessImageVersions", { enumerable: true, get: function () { return process_image_versions_1.ProcessImageVersions; } });
|
|
64
34
|
var data_ownership_in_entity_1 = require("./data-ownership-in-entity");
|
|
65
35
|
Object.defineProperty(exports, "DataOwnershipInEntity", { enumerable: true, get: function () { return data_ownership_in_entity_1.DataOwnershipInEntity; } });
|
|
66
36
|
var data_peoplestamps_1 = require("./data-peoplestamps");
|
|
@@ -810,7 +810,9 @@ export interface BlueprintBucketSeed {
|
|
|
810
810
|
}
|
|
811
811
|
/** Storage configuration for an entity type. Seeds initial buckets, overrides module-level settings (expiry times, file size limits, CORS), and provides per-table provisioning overrides via provisions. */
|
|
812
812
|
export interface BlueprintStorageConfig {
|
|
813
|
-
/**
|
|
813
|
+
/** Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case. */
|
|
814
|
+
storage_key?: string;
|
|
815
|
+
/** Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning. */
|
|
814
816
|
buckets?: BlueprintBucketSeed[];
|
|
815
817
|
/** Override for presigned upload URL expiry time in seconds. */
|
|
816
818
|
upload_url_expiry_seconds?: number;
|
|
@@ -901,8 +903,6 @@ export interface BlueprintEntityType {
|
|
|
901
903
|
has_profiles?: boolean;
|
|
902
904
|
/** Whether to provision a levels module for this entity type. Defaults to false. */
|
|
903
905
|
has_levels?: boolean;
|
|
904
|
-
/** Whether to provision a storage module (buckets, files tables) for this entity type. Defaults to false. */
|
|
905
|
-
has_storage?: boolean;
|
|
906
906
|
/** Whether to provision entity-scoped invite tables ({prefix}_invites, {prefix}_claimed_invites) and a submit_{prefix}_invite_code() function. Defaults to false. */
|
|
907
907
|
has_invites?: boolean;
|
|
908
908
|
/** Whether to auto-attach an EventTracker to the claimed_invites table for invite-based achievements. Requires has_invites=true AND has_levels=true. When true, records 'invite_claimed' events credited to the sender (inviter) on each claimed invite. Defaults to false. */
|
|
@@ -911,8 +911,8 @@ export interface BlueprintEntityType {
|
|
|
911
911
|
skip_entity_policies?: boolean;
|
|
912
912
|
/** Override for the entity table. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, its policies[] replaces the five default entity-table policies; is_visible becomes a no-op. When NULL (default), the five default policies are applied (gated by is_visible). */
|
|
913
913
|
table_provision?: BlueprintEntityTableProvision;
|
|
914
|
-
/** Storage configuration.
|
|
915
|
-
storage?: BlueprintStorageConfig;
|
|
914
|
+
/** Storage configuration (array-only). A non-empty array enables storage provisioning. Each entry creates a separate storage module with its own tables ({prefix}_{storage_key}_buckets/files). Controls RLS policies, bucket seeding, and module-level settings. */
|
|
915
|
+
storage?: BlueprintStorageConfig[];
|
|
916
916
|
}
|
|
917
917
|
/** String shorthand -- just the node type name. */
|
|
918
918
|
export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'LimitAggregate' | 'BillingMeter' | 'DataBulk' | 'ProcessChunks' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'ProcessFileEmbedding' | 'LimitFeatureFlag' | 'DataForceCurrentUser' | 'DataId' | 'ProcessImageEmbedding' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'JobTrigger' | 'LimitCounter' | 'DataJsonb' | 'DataOwnedFields' | 'ProcessExtraction' | 'ProcessImageVersions' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings';
|
|
@@ -1177,8 +1177,8 @@ export interface BlueprintDefinition {
|
|
|
1177
1177
|
unique_constraints?: BlueprintUniqueConstraint[];
|
|
1178
1178
|
/** Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security. */
|
|
1179
1179
|
entity_types?: BlueprintEntityType[];
|
|
1180
|
-
/** App-level storage configuration. Creates
|
|
1181
|
-
storage?: BlueprintStorageConfig;
|
|
1180
|
+
/** App-level storage configuration (array-only). Creates storage_module(s) (membership_type = NULL), seeds initial buckets, and overrides module-level settings. Each entry creates a separate storage module. For entity-scoped storage, use entity_types[].storage instead. */
|
|
1181
|
+
storage?: BlueprintStorageConfig[];
|
|
1182
1182
|
/** Achievement definitions. Each entry creates a level with requirements and optional rewards in the events_module. Requires events_module to be provisioned (e.g., via entity_types[].has_levels = true or modules includes events_module). */
|
|
1183
1183
|
achievements?: BlueprintAchievement[];
|
|
1184
1184
|
}
|
|
@@ -480,7 +480,8 @@ function buildBlueprintBucketSeed() {
|
|
|
480
480
|
*/
|
|
481
481
|
function buildBlueprintStorageConfig() {
|
|
482
482
|
return addJSDoc(exportInterface('BlueprintStorageConfig', [
|
|
483
|
-
addJSDoc(optionalProp('
|
|
483
|
+
addJSDoc(optionalProp('storage_key', t.tsStringKeyword()), 'Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case.'),
|
|
484
|
+
addJSDoc(optionalProp('buckets', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintBucketSeed')))), 'Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning.'),
|
|
484
485
|
addJSDoc(optionalProp('upload_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned upload URL expiry time in seconds.'),
|
|
485
486
|
addJSDoc(optionalProp('download_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned download URL expiry time in seconds.'),
|
|
486
487
|
addJSDoc(optionalProp('default_max_file_size', t.tsNumberKeyword()), 'Default maximum file size in bytes for the storage module.'),
|
|
@@ -547,12 +548,11 @@ function buildBlueprintEntityType() {
|
|
|
547
548
|
addJSDoc(optionalProp('has_limits', t.tsBooleanKeyword()), 'Whether to provision a limits module for this entity type. Defaults to false.'),
|
|
548
549
|
addJSDoc(optionalProp('has_profiles', t.tsBooleanKeyword()), 'Whether to provision a profiles module for this entity type. Defaults to false.'),
|
|
549
550
|
addJSDoc(optionalProp('has_levels', t.tsBooleanKeyword()), 'Whether to provision a levels module for this entity type. Defaults to false.'),
|
|
550
|
-
addJSDoc(optionalProp('has_storage', t.tsBooleanKeyword()), 'Whether to provision a storage module (buckets, files tables) for this entity type. Defaults to false.'),
|
|
551
551
|
addJSDoc(optionalProp('has_invites', t.tsBooleanKeyword()), 'Whether to provision entity-scoped invite tables ({prefix}_invites, {prefix}_claimed_invites) and a submit_{prefix}_invite_code() function. Defaults to false.'),
|
|
552
552
|
addJSDoc(optionalProp('has_invite_achievements', t.tsBooleanKeyword()), "Whether to auto-attach an EventTracker to the claimed_invites table for invite-based achievements. Requires has_invites=true AND has_levels=true. When true, records 'invite_claimed' events credited to the sender (inviter) on each claimed invite. Defaults to false."),
|
|
553
553
|
addJSDoc(optionalProp('skip_entity_policies', t.tsBooleanKeyword()), 'Escape hatch: when true AND table_provision is NULL, zero policies are provisioned on the entity table. Defaults to false.'),
|
|
554
554
|
addJSDoc(optionalProp('table_provision', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))), 'Override for the entity table. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, its policies[] replaces the five default entity-table policies; is_visible becomes a no-op. When NULL (default), the five default policies are applied (gated by is_visible).'),
|
|
555
|
-
addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'Storage configuration.
|
|
555
|
+
addJSDoc(optionalProp('storage', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintStorageConfig')))), 'Storage module configuration array. Each entry provisions a separate storage module with its own tables, RLS, and settings. When non-empty, has_storage is derived as true. Each entry may specify a storage_key for multi-module support (defaults to "default").')
|
|
556
556
|
]), 'An entity type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision.');
|
|
557
557
|
}
|
|
558
558
|
function buildBlueprintTable() {
|
|
@@ -580,7 +580,7 @@ function buildBlueprintDefinition() {
|
|
|
580
580
|
addJSDoc(optionalProp('full_text_searches', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintFullTextSearch')))), 'Full-text search configurations.'),
|
|
581
581
|
addJSDoc(optionalProp('unique_constraints', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintUniqueConstraint')))), 'Unique constraints on table columns.'),
|
|
582
582
|
addJSDoc(optionalProp('entity_types', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintEntityType')))), 'Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security.'),
|
|
583
|
-
addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'App-level storage configuration.
|
|
583
|
+
addJSDoc(optionalProp('storage', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintStorageConfig')))), 'App-level storage configuration array. Each entry creates a storage_module (membership_type = NULL) with its own tables and settings. For entity-scoped storage, use entity_types[].storage instead.'),
|
|
584
584
|
addJSDoc(optionalProp('achievements', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintAchievement')))), 'Achievement definitions. Each entry creates a level with requirements and optional rewards in the events_module. Requires events_module to be provisioned (e.g., via entity_types[].has_levels = true or modules includes events_module).')
|
|
585
585
|
]), 'The complete blueprint definition -- the JSONB shape accepted by construct_blueprint().');
|
|
586
586
|
}
|
package/esm/data/index.d.ts
CHANGED
|
@@ -2,32 +2,17 @@ export { CheckGreaterThan } from './check-greater-than';
|
|
|
2
2
|
export { CheckLessThan } from './check-less-than';
|
|
3
3
|
export { CheckNotEqual } from './check-not-equal';
|
|
4
4
|
export { CheckOneOf } from './check-one-of';
|
|
5
|
-
export { LimitEnforceAggregate } from './data-aggregate-limit-counter';
|
|
6
|
-
export { LimitTrackUsage } from './data-billing-meter';
|
|
7
5
|
export { DataBulk } from './data-bulk';
|
|
8
|
-
export { ProcessChunks } from './data-chunks';
|
|
9
6
|
export { DataCompositeField } from './data-composite-field';
|
|
10
7
|
export { DataDirectOwner } from './data-direct-owner';
|
|
11
8
|
export { DataEntityMembership } from './data-entity-membership';
|
|
12
|
-
export { EventTracker } from './event-tracker';
|
|
13
|
-
export { ProcessFileEmbedding } from './data-file-embedding';
|
|
14
|
-
export { LimitEnforceFeature } from './data-feature-flag';
|
|
15
9
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
16
10
|
export { DataId } from './data-id';
|
|
17
|
-
export { ProcessImageEmbedding } from './data-image-embedding';
|
|
18
11
|
export { DataImmutableFields } from './data-immutable-fields';
|
|
19
12
|
export { DataInflection } from './data-inflection';
|
|
20
13
|
export { DataInheritFromParent } from './data-inherit-from-parent';
|
|
21
|
-
export { JobTrigger } from './data-job-trigger';
|
|
22
|
-
export { LimitEnforceCounter } from './data-limit-counter';
|
|
23
|
-
export { LimitEnforceRate } from './data-meter-rate-limit';
|
|
24
|
-
export { LimitWarningCounter } from './limit-warning-counter';
|
|
25
|
-
export { LimitWarningAggregate } from './limit-warning-aggregate';
|
|
26
|
-
export { LimitWarningRate } from './limit-warning-rate';
|
|
27
14
|
export { DataJsonb } from './data-jsonb';
|
|
28
15
|
export { DataOwnedFields } from './data-owned-fields';
|
|
29
|
-
export { ProcessExtraction } from './process-extraction';
|
|
30
|
-
export { ProcessImageVersions } from './process-image-versions';
|
|
31
16
|
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
32
17
|
export { DataPeoplestamps } from './data-peoplestamps';
|
|
33
18
|
export { DataPublishable } from './data-publishable';
|
package/esm/data/index.js
CHANGED
|
@@ -2,32 +2,17 @@ export { CheckGreaterThan } from './check-greater-than';
|
|
|
2
2
|
export { CheckLessThan } from './check-less-than';
|
|
3
3
|
export { CheckNotEqual } from './check-not-equal';
|
|
4
4
|
export { CheckOneOf } from './check-one-of';
|
|
5
|
-
export { LimitEnforceAggregate } from './data-aggregate-limit-counter';
|
|
6
|
-
export { LimitTrackUsage } from './data-billing-meter';
|
|
7
5
|
export { DataBulk } from './data-bulk';
|
|
8
|
-
export { ProcessChunks } from './data-chunks';
|
|
9
6
|
export { DataCompositeField } from './data-composite-field';
|
|
10
7
|
export { DataDirectOwner } from './data-direct-owner';
|
|
11
8
|
export { DataEntityMembership } from './data-entity-membership';
|
|
12
|
-
export { EventTracker } from './event-tracker';
|
|
13
|
-
export { ProcessFileEmbedding } from './data-file-embedding';
|
|
14
|
-
export { LimitEnforceFeature } from './data-feature-flag';
|
|
15
9
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
16
10
|
export { DataId } from './data-id';
|
|
17
|
-
export { ProcessImageEmbedding } from './data-image-embedding';
|
|
18
11
|
export { DataImmutableFields } from './data-immutable-fields';
|
|
19
12
|
export { DataInflection } from './data-inflection';
|
|
20
13
|
export { DataInheritFromParent } from './data-inherit-from-parent';
|
|
21
|
-
export { JobTrigger } from './data-job-trigger';
|
|
22
|
-
export { LimitEnforceCounter } from './data-limit-counter';
|
|
23
|
-
export { LimitEnforceRate } from './data-meter-rate-limit';
|
|
24
|
-
export { LimitWarningCounter } from './limit-warning-counter';
|
|
25
|
-
export { LimitWarningAggregate } from './limit-warning-aggregate';
|
|
26
|
-
export { LimitWarningRate } from './limit-warning-rate';
|
|
27
14
|
export { DataJsonb } from './data-jsonb';
|
|
28
15
|
export { DataOwnedFields } from './data-owned-fields';
|
|
29
|
-
export { ProcessExtraction } from './process-extraction';
|
|
30
|
-
export { ProcessImageVersions } from './process-image-versions';
|
|
31
16
|
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
32
17
|
export { DataPeoplestamps } from './data-peoplestamps';
|
|
33
18
|
export { DataPublishable } from './data-publishable';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { conditionDefs, conditionProperties } from '../conditions';
|
|
2
|
+
export const EventReferral = {
|
|
3
|
+
name: 'EventReferral',
|
|
4
|
+
slug: 'event_referral',
|
|
5
|
+
category: 'event',
|
|
6
|
+
display_name: 'Event Referral',
|
|
7
|
+
description: 'Creates triggers that record events for the referrer (inviter) when their ' +
|
|
8
|
+
'invitees perform actions on a watched table. Resolves the referrer automatically ' +
|
|
9
|
+
'via the invites module\'s claimed_invites table using the membership_type context. ' +
|
|
10
|
+
'Supports the same compound condition system as EventTracker. Use with achievements ' +
|
|
11
|
+
'to unlock levels and grant credits based on invitee activity.',
|
|
12
|
+
parameter_schema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
$defs: conditionDefs,
|
|
15
|
+
properties: {
|
|
16
|
+
event_name: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'Event type name to record for the referrer (e.g., "invitee_uploaded_avatar", "invitee_completed_onboarding")'
|
|
19
|
+
},
|
|
20
|
+
events: {
|
|
21
|
+
type: 'array',
|
|
22
|
+
items: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
enum: [
|
|
25
|
+
'INSERT',
|
|
26
|
+
'UPDATE',
|
|
27
|
+
'DELETE'
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
description: 'DML events that trigger recording',
|
|
31
|
+
default: ['INSERT']
|
|
32
|
+
},
|
|
33
|
+
actor_field: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
format: 'column-ref',
|
|
36
|
+
description: 'Column containing the invitee (actor) ID on the source table — used to look up the referrer via claimed_invites.receiver_id',
|
|
37
|
+
default: 'owner_id'
|
|
38
|
+
},
|
|
39
|
+
entity_field: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
format: 'column-ref',
|
|
42
|
+
description: 'Column containing the entity ID (org/group) for entity-scoped referral events. Omit for user-only events.'
|
|
43
|
+
},
|
|
44
|
+
auto_register_type: {
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
description: 'Automatically register the event_name in event_types during provisioning',
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
...conditionProperties
|
|
50
|
+
},
|
|
51
|
+
required: [
|
|
52
|
+
'event_name'
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
tags: [
|
|
56
|
+
'events',
|
|
57
|
+
'referral',
|
|
58
|
+
'invites',
|
|
59
|
+
'analytics',
|
|
60
|
+
'tracking'
|
|
61
|
+
]
|
|
62
|
+
};
|
package/esm/index.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ export * from './authz';
|
|
|
2
2
|
export * from './blueprint-types.generated';
|
|
3
3
|
export * from './conditions';
|
|
4
4
|
export * from './data';
|
|
5
|
+
export * from './event';
|
|
6
|
+
export * from './job';
|
|
7
|
+
export * from './limit';
|
|
5
8
|
export * from './module-presets';
|
|
9
|
+
export * from './process';
|
|
6
10
|
export * from './relation';
|
|
7
11
|
export type { JSONSchema, NodeTypeDefinition } from './types';
|
|
8
12
|
export * from './view';
|
package/esm/index.js
CHANGED
|
@@ -2,16 +2,28 @@ export * from './authz';
|
|
|
2
2
|
export * from './blueprint-types.generated';
|
|
3
3
|
export * from './conditions';
|
|
4
4
|
export * from './data';
|
|
5
|
+
export * from './event';
|
|
6
|
+
export * from './job';
|
|
7
|
+
export * from './limit';
|
|
5
8
|
export * from './module-presets';
|
|
9
|
+
export * from './process';
|
|
6
10
|
export * from './relation';
|
|
7
11
|
export * from './view';
|
|
8
12
|
import * as authz from './authz';
|
|
9
13
|
import * as data from './data';
|
|
14
|
+
import * as event from './event';
|
|
15
|
+
import * as job from './job';
|
|
16
|
+
import * as limit from './limit';
|
|
17
|
+
import * as process from './process';
|
|
10
18
|
import * as relation from './relation';
|
|
11
19
|
import * as view from './view';
|
|
12
20
|
export const allNodeTypes = [
|
|
13
21
|
...Object.values(authz),
|
|
14
22
|
...Object.values(data),
|
|
23
|
+
...Object.values(event),
|
|
24
|
+
...Object.values(job),
|
|
25
|
+
...Object.values(limit),
|
|
26
|
+
...Object.values(process),
|
|
15
27
|
...Object.values(relation),
|
|
16
28
|
...Object.values(view)
|
|
17
29
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JobTrigger } from './trigger';
|
package/esm/job/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JobTrigger } from './trigger';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { LimitEnforceAggregate } from './enforce-aggregate';
|
|
2
|
+
export { LimitEnforceCounter } from './enforce-counter';
|
|
3
|
+
export { LimitEnforceFeature } from './enforce-feature';
|
|
4
|
+
export { LimitEnforceRate } from './enforce-rate';
|
|
5
|
+
export { LimitTrackUsage } from './track-usage';
|
|
6
|
+
export { LimitWarningAggregate } from './warning-aggregate';
|
|
7
|
+
export { LimitWarningCounter } from './warning-counter';
|
|
8
|
+
export { LimitWarningRate } from './warning-rate';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { LimitEnforceAggregate } from './enforce-aggregate';
|
|
2
|
+
export { LimitEnforceCounter } from './enforce-counter';
|
|
3
|
+
export { LimitEnforceFeature } from './enforce-feature';
|
|
4
|
+
export { LimitEnforceRate } from './enforce-rate';
|
|
5
|
+
export { LimitTrackUsage } from './track-usage';
|
|
6
|
+
export { LimitWarningAggregate } from './warning-aggregate';
|
|
7
|
+
export { LimitWarningCounter } from './warning-counter';
|
|
8
|
+
export { LimitWarningRate } from './warning-rate';
|
|
@@ -38,8 +38,8 @@ export const PresetAuthEmailMagic = {
|
|
|
38
38
|
'levels_module:app',
|
|
39
39
|
'memberships_module:app',
|
|
40
40
|
'sessions_module',
|
|
41
|
-
'
|
|
42
|
-
'
|
|
41
|
+
'user_state_module',
|
|
42
|
+
'config_secrets_user_module',
|
|
43
43
|
'emails_module',
|
|
44
44
|
'rls_module',
|
|
45
45
|
'user_auth_module',
|
|
@@ -23,7 +23,7 @@ export const PresetAuthEmail = {
|
|
|
23
23
|
summary: 'Standard email/password auth flow with app-level permissions. No orgs, no SSO, no MFA.',
|
|
24
24
|
description: 'Installs `user_auth_module` with exactly the table dependencies its insert trigger ' +
|
|
25
25
|
'hard-requires: users, app-scoped memberships (plus their permissions/limits/levels ' +
|
|
26
|
-
'dependencies), emails,
|
|
26
|
+
'dependencies), emails, user state, user secrets, sessions, plus RLS. You get the ' +
|
|
27
27
|
'standard password-based auth procedures (sign_up, sign_in, reset_password, ' +
|
|
28
28
|
"verify_email, delete_account, ...) and that's it. Everything else in the module " +
|
|
29
29
|
'catalog — SSO, passkeys, SMS, rate limits, orgs, invites — is deliberately omitted. ' +
|
|
@@ -49,8 +49,8 @@ export const PresetAuthEmail = {
|
|
|
49
49
|
'levels_module:app',
|
|
50
50
|
'memberships_module:app',
|
|
51
51
|
'sessions_module',
|
|
52
|
-
'
|
|
53
|
-
'
|
|
52
|
+
'user_state_module',
|
|
53
|
+
'config_secrets_user_module',
|
|
54
54
|
'emails_module',
|
|
55
55
|
'rls_module',
|
|
56
56
|
'user_auth_module'
|
|
@@ -62,8 +62,8 @@ export const PresetAuthEmail = {
|
|
|
62
62
|
'limits_module:app': 'Required by `memberships_module:app`: NOT NULL FK to caps table.',
|
|
63
63
|
'levels_module:app': 'Required by `memberships_module:app`: NOT NULL FK to levels table.',
|
|
64
64
|
emails_module: 'Required by the `user_auth_module` insert trigger (`RAISE EXCEPTION REQUIRES emails_module`).',
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
config_secrets_user_module: 'Required for password hashing; referenced by `set_password`, `verify_password`, and reset flows.',
|
|
66
|
+
user_state_module: 'API-key storage (`create_api_key`, `revoke_api_key`, `my_api_keys`).'
|
|
67
67
|
},
|
|
68
68
|
omits_notes: {
|
|
69
69
|
rate_limits_module: 'Omitted intentionally; throttle_* helpers are null-safe and the auth procs compile without it. Add later via `auth:hardened`.',
|
|
@@ -35,8 +35,8 @@ export const PresetAuthHardened = {
|
|
|
35
35
|
'levels_module:app',
|
|
36
36
|
'memberships_module:app',
|
|
37
37
|
'sessions_module',
|
|
38
|
-
'
|
|
39
|
-
'
|
|
38
|
+
'user_state_module',
|
|
39
|
+
'config_secrets_user_module',
|
|
40
40
|
'emails_module',
|
|
41
41
|
'rls_module',
|
|
42
42
|
'user_auth_module',
|
|
@@ -36,8 +36,8 @@ export const PresetAuthPasskey = {
|
|
|
36
36
|
'levels_module:app',
|
|
37
37
|
'memberships_module:app',
|
|
38
38
|
'sessions_module',
|
|
39
|
-
'
|
|
40
|
-
'
|
|
39
|
+
'user_state_module',
|
|
40
|
+
'config_secrets_user_module',
|
|
41
41
|
'emails_module',
|
|
42
42
|
'rls_module',
|
|
43
43
|
'user_auth_module',
|
|
@@ -6,7 +6,7 @@ import type { ModulePreset } from './types';
|
|
|
6
6
|
* `(provider, external_id)`) and `identity_providers_module` (the provider
|
|
7
7
|
* config: URLs, client_id, encrypted client_secret, scopes, PKCE/nonce
|
|
8
8
|
* knobs). The generator then emits `sign_in_identity` / `sign_up_identity`
|
|
9
|
-
* procedures which rely on `
|
|
9
|
+
* procedures which rely on `config_secrets_user_module` to decrypt the client
|
|
10
10
|
* secret at auth time.
|
|
11
11
|
*
|
|
12
12
|
* Password fallback stays on by default (break-glass for admins); flip the
|