node-type-registry 0.2.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/LICENSE +23 -0
- package/README.md +87 -0
- package/authz/authz-allow-all.d.ts +2 -0
- package/authz/authz-allow-all.js +15 -0
- package/authz/authz-composite.d.ts +2 -0
- package/authz/authz-composite.js +39 -0
- package/authz/authz-deny-all.d.ts +2 -0
- package/authz/authz-deny-all.js +15 -0
- package/authz/authz-direct-owner-any.d.ts +2 -0
- package/authz/authz-direct-owner-any.js +26 -0
- package/authz/authz-direct-owner.d.ts +2 -0
- package/authz/authz-direct-owner.js +23 -0
- package/authz/authz-entity-membership.d.ts +2 -0
- package/authz/authz-entity-membership.js +49 -0
- package/authz/authz-member-list.d.ts +2 -0
- package/authz/authz-member-list.js +23 -0
- package/authz/authz-membership-check.d.ts +2 -0
- package/authz/authz-membership-check.js +45 -0
- package/authz/authz-org-hierarchy.d.ts +2 -0
- package/authz/authz-org-hierarchy.js +41 -0
- package/authz/authz-peer-ownership.d.ts +2 -0
- package/authz/authz-peer-ownership.js +49 -0
- package/authz/authz-publishable.d.ts +2 -0
- package/authz/authz-publishable.js +31 -0
- package/authz/authz-related-entity-membership.d.ts +2 -0
- package/authz/authz-related-entity-membership.js +71 -0
- package/authz/authz-related-member-list.d.ts +2 -0
- package/authz/authz-related-member-list.js +43 -0
- package/authz/authz-related-peer-ownership.d.ts +2 -0
- package/authz/authz-related-peer-ownership.js +75 -0
- package/authz/authz-temporal.d.ts +2 -0
- package/authz/authz-temporal.js +46 -0
- package/authz/index.d.ts +15 -0
- package/authz/index.js +33 -0
- package/codegen/generate-seed.d.ts +23 -0
- package/codegen/generate-seed.js +155 -0
- package/data/data-bm25.d.ts +2 -0
- package/data/data-bm25.js +43 -0
- package/data/data-direct-owner.d.ts +2 -0
- package/data/data-direct-owner.js +31 -0
- package/data/data-embedding.d.ts +2 -0
- package/data/data-embedding.js +82 -0
- package/data/data-entity-membership.d.ts +2 -0
- package/data/data-entity-membership.js +31 -0
- package/data/data-full-text-search.d.ts +2 -0
- package/data/data-full-text-search.js +61 -0
- package/data/data-id.d.ts +2 -0
- package/data/data-id.js +21 -0
- package/data/data-job-trigger.d.ts +2 -0
- package/data/data-job-trigger.js +111 -0
- package/data/data-jsonb.d.ts +2 -0
- package/data/data-jsonb.js +35 -0
- package/data/data-ownership-in-entity.d.ts +2 -0
- package/data/data-ownership-in-entity.js +26 -0
- package/data/data-peoplestamps.d.ts +2 -0
- package/data/data-peoplestamps.js +26 -0
- package/data/data-postgis-aggregate.d.ts +2 -0
- package/data/data-postgis-aggregate.js +94 -0
- package/data/data-postgis.d.ts +2 -0
- package/data/data-postgis.js +65 -0
- package/data/data-publishable.d.ts +2 -0
- package/data/data-publishable.js +21 -0
- package/data/data-search.d.ts +2 -0
- package/data/data-search.js +158 -0
- package/data/data-soft-delete.d.ts +2 -0
- package/data/data-soft-delete.js +21 -0
- package/data/data-status-field.d.ts +2 -0
- package/data/data-status-field.js +42 -0
- package/data/data-tags.d.ts +2 -0
- package/data/data-tags.js +30 -0
- package/data/data-timestamps.d.ts +2 -0
- package/data/data-timestamps.js +21 -0
- package/data/data-trgm.d.ts +2 -0
- package/data/data-trgm.js +26 -0
- package/data/index.d.ts +19 -0
- package/data/index.js +41 -0
- package/esm/authz/authz-allow-all.d.ts +2 -0
- package/esm/authz/authz-allow-all.js +12 -0
- package/esm/authz/authz-composite.d.ts +2 -0
- package/esm/authz/authz-composite.js +36 -0
- package/esm/authz/authz-deny-all.d.ts +2 -0
- package/esm/authz/authz-deny-all.js +12 -0
- package/esm/authz/authz-direct-owner-any.d.ts +2 -0
- package/esm/authz/authz-direct-owner-any.js +23 -0
- package/esm/authz/authz-direct-owner.d.ts +2 -0
- package/esm/authz/authz-direct-owner.js +20 -0
- package/esm/authz/authz-entity-membership.d.ts +2 -0
- package/esm/authz/authz-entity-membership.js +46 -0
- package/esm/authz/authz-member-list.d.ts +2 -0
- package/esm/authz/authz-member-list.js +20 -0
- package/esm/authz/authz-membership-check.d.ts +2 -0
- package/esm/authz/authz-membership-check.js +42 -0
- package/esm/authz/authz-org-hierarchy.d.ts +2 -0
- package/esm/authz/authz-org-hierarchy.js +38 -0
- package/esm/authz/authz-peer-ownership.d.ts +2 -0
- package/esm/authz/authz-peer-ownership.js +46 -0
- package/esm/authz/authz-publishable.d.ts +2 -0
- package/esm/authz/authz-publishable.js +28 -0
- package/esm/authz/authz-related-entity-membership.d.ts +2 -0
- package/esm/authz/authz-related-entity-membership.js +68 -0
- package/esm/authz/authz-related-member-list.d.ts +2 -0
- package/esm/authz/authz-related-member-list.js +40 -0
- package/esm/authz/authz-related-peer-ownership.d.ts +2 -0
- package/esm/authz/authz-related-peer-ownership.js +72 -0
- package/esm/authz/authz-temporal.d.ts +2 -0
- package/esm/authz/authz-temporal.js +43 -0
- package/esm/authz/index.d.ts +15 -0
- package/esm/authz/index.js +15 -0
- package/esm/codegen/generate-seed.d.ts +23 -0
- package/esm/codegen/generate-seed.js +153 -0
- package/esm/data/data-bm25.d.ts +2 -0
- package/esm/data/data-bm25.js +40 -0
- package/esm/data/data-direct-owner.d.ts +2 -0
- package/esm/data/data-direct-owner.js +28 -0
- package/esm/data/data-embedding.d.ts +2 -0
- package/esm/data/data-embedding.js +79 -0
- package/esm/data/data-entity-membership.d.ts +2 -0
- package/esm/data/data-entity-membership.js +28 -0
- package/esm/data/data-full-text-search.d.ts +2 -0
- package/esm/data/data-full-text-search.js +58 -0
- package/esm/data/data-id.d.ts +2 -0
- package/esm/data/data-id.js +18 -0
- package/esm/data/data-job-trigger.d.ts +2 -0
- package/esm/data/data-job-trigger.js +108 -0
- package/esm/data/data-jsonb.d.ts +2 -0
- package/esm/data/data-jsonb.js +32 -0
- package/esm/data/data-ownership-in-entity.d.ts +2 -0
- package/esm/data/data-ownership-in-entity.js +23 -0
- package/esm/data/data-peoplestamps.d.ts +2 -0
- package/esm/data/data-peoplestamps.js +23 -0
- package/esm/data/data-postgis-aggregate.d.ts +2 -0
- package/esm/data/data-postgis-aggregate.js +91 -0
- package/esm/data/data-postgis.d.ts +2 -0
- package/esm/data/data-postgis.js +62 -0
- package/esm/data/data-publishable.d.ts +2 -0
- package/esm/data/data-publishable.js +18 -0
- package/esm/data/data-search.d.ts +2 -0
- package/esm/data/data-search.js +155 -0
- package/esm/data/data-soft-delete.d.ts +2 -0
- package/esm/data/data-soft-delete.js +18 -0
- package/esm/data/data-status-field.d.ts +2 -0
- package/esm/data/data-status-field.js +39 -0
- package/esm/data/data-tags.d.ts +2 -0
- package/esm/data/data-tags.js +27 -0
- package/esm/data/data-timestamps.d.ts +2 -0
- package/esm/data/data-timestamps.js +18 -0
- package/esm/data/data-trgm.d.ts +2 -0
- package/esm/data/data-trgm.js +23 -0
- package/esm/data/index.d.ts +19 -0
- package/esm/data/index.js +19 -0
- package/esm/field/field-immutable.d.ts +2 -0
- package/esm/field/field-immutable.js +21 -0
- package/esm/field/field-inflection.d.ts +2 -0
- package/esm/field/field-inflection.js +29 -0
- package/esm/field/field-owned.d.ts +2 -0
- package/esm/field/field-owned.js +36 -0
- package/esm/field/field-slug.d.ts +2 -0
- package/esm/field/field-slug.js +26 -0
- package/esm/field/index.d.ts +4 -0
- package/esm/field/index.js +4 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.js +21 -0
- package/esm/preset.d.ts +23 -0
- package/esm/preset.js +5 -0
- package/esm/relation/index.d.ts +4 -0
- package/esm/relation/index.js +4 -0
- package/esm/relation/relation-belongs-to.d.ts +2 -0
- package/esm/relation/relation-belongs-to.js +48 -0
- package/esm/relation/relation-has-many.d.ts +2 -0
- package/esm/relation/relation-has-many.js +48 -0
- package/esm/relation/relation-has-one.d.ts +2 -0
- package/esm/relation/relation-has-one.js +48 -0
- package/esm/relation/relation-many-to-many.d.ts +2 -0
- package/esm/relation/relation-many-to-many.js +92 -0
- package/esm/table/index.d.ts +3 -0
- package/esm/table/index.js +3 -0
- package/esm/table/table-organization-settings.d.ts +2 -0
- package/esm/table/table-organization-settings.js +12 -0
- package/esm/table/table-user-profiles.d.ts +2 -0
- package/esm/table/table-user-profiles.js +12 -0
- package/esm/table/table-user-settings.d.ts +2 -0
- package/esm/table/table-user-settings.js +12 -0
- package/esm/types.d.ts +61 -0
- package/esm/types.js +1 -0
- package/esm/view/index.d.ts +5 -0
- package/esm/view/index.js +5 -0
- package/esm/view/view-aggregated.d.ts +2 -0
- package/esm/view/view-aggregated.js +61 -0
- package/esm/view/view-composite.d.ts +2 -0
- package/esm/view/view-composite.js +20 -0
- package/esm/view/view-filtered-table.d.ts +2 -0
- package/esm/view/view-filtered-table.js +45 -0
- package/esm/view/view-joined-tables.d.ts +2 -0
- package/esm/view/view-joined-tables.js +80 -0
- package/esm/view/view-table-projection.d.ts +2 -0
- package/esm/view/view-table-projection.js +36 -0
- package/field/field-immutable.d.ts +2 -0
- package/field/field-immutable.js +24 -0
- package/field/field-inflection.d.ts +2 -0
- package/field/field-inflection.js +32 -0
- package/field/field-owned.d.ts +2 -0
- package/field/field-owned.js +39 -0
- package/field/field-slug.d.ts +2 -0
- package/field/field-slug.js +29 -0
- package/field/index.d.ts +4 -0
- package/field/index.js +11 -0
- package/index.d.ts +9 -0
- package/index.js +60 -0
- package/package.json +49 -0
- package/preset.d.ts +23 -0
- package/preset.js +8 -0
- package/relation/index.d.ts +4 -0
- package/relation/index.js +11 -0
- package/relation/relation-belongs-to.d.ts +2 -0
- package/relation/relation-belongs-to.js +51 -0
- package/relation/relation-has-many.d.ts +2 -0
- package/relation/relation-has-many.js +51 -0
- package/relation/relation-has-one.d.ts +2 -0
- package/relation/relation-has-one.js +51 -0
- package/relation/relation-many-to-many.d.ts +2 -0
- package/relation/relation-many-to-many.js +95 -0
- package/table/index.d.ts +3 -0
- package/table/index.js +9 -0
- package/table/table-organization-settings.d.ts +2 -0
- package/table/table-organization-settings.js +15 -0
- package/table/table-user-profiles.d.ts +2 -0
- package/table/table-user-profiles.js +15 -0
- package/table/table-user-settings.d.ts +2 -0
- package/table/table-user-settings.js +15 -0
- package/types.d.ts +61 -0
- package/types.js +2 -0
- package/view/index.d.ts +5 -0
- package/view/index.js +13 -0
- package/view/view-aggregated.d.ts +2 -0
- package/view/view-aggregated.js +64 -0
- package/view/view-composite.d.ts +2 -0
- package/view/view-composite.js +23 -0
- package/view/view-filtered-table.d.ts +2 -0
- package/view/view-filtered-table.js +48 -0
- package/view/view-joined-tables.d.ts +2 -0
- package/view/view-joined-tables.js +83 -0
- package/view/view-table-projection.d.ts +2 -0
- package/view/view-table-projection.js +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dan Lynch <pyramation@gmail.com>
|
|
4
|
+
Copyright (c) 2025 Constructive <developers@constructive.io>
|
|
5
|
+
Copyright (c) 2020-present, Interweb, Inc.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# node-type-registry
|
|
2
|
+
|
|
3
|
+
Node type definitions for the Constructive blueprint system. Single source of truth for all Authz*, Data*, Field*, Relation*, View*, and Table* node types.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { allNodeTypes, AuthzDirectOwner, DataId } from 'node-type-registry';
|
|
9
|
+
|
|
10
|
+
// Access individual node types
|
|
11
|
+
console.log(AuthzDirectOwner.parameter_schema);
|
|
12
|
+
|
|
13
|
+
// Get all node types as a flat array
|
|
14
|
+
console.log(allNodeTypes.length); // 50
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Preset (opt-in blueprint types)
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { NodeTypeRegistryPreset } from 'node-type-registry/preset';
|
|
21
|
+
|
|
22
|
+
const sdl = await buildSchemaSDL({
|
|
23
|
+
database: dbConfig.database,
|
|
24
|
+
schemas,
|
|
25
|
+
graphile: { extends: [NodeTypeRegistryPreset] },
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This preset generates `@oneOf` typed GraphQL input types (`BlueprintDefinitionInput`, etc.) from the TS node type definitions. It is **not** included in `ConstructivePreset` — it must be explicitly added by consumers that need blueprint types.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Education and Tutorials
|
|
34
|
+
|
|
35
|
+
1. 🚀 [Quickstart: Getting Up and Running](https://constructive.io/learn/quickstart)
|
|
36
|
+
Get started with modular databases in minutes. Install prerequisites and deploy your first module.
|
|
37
|
+
|
|
38
|
+
2. 📦 [Modular PostgreSQL Development with Database Packages](https://constructive.io/learn/modular-postgres)
|
|
39
|
+
Learn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.
|
|
40
|
+
|
|
41
|
+
3. ✏️ [Authoring Database Changes](https://constructive.io/learn/authoring-database-changes)
|
|
42
|
+
Master the workflow for adding, organizing, and managing database changes with pgpm.
|
|
43
|
+
|
|
44
|
+
4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://constructive.io/learn/e2e-postgres-testing)
|
|
45
|
+
Master end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.
|
|
46
|
+
|
|
47
|
+
5. ⚡ [Supabase Testing](https://constructive.io/learn/supabase)
|
|
48
|
+
Use TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.
|
|
49
|
+
|
|
50
|
+
6. 💧 [Drizzle ORM Testing](https://constructive.io/learn/drizzle-testing)
|
|
51
|
+
Run full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.
|
|
52
|
+
|
|
53
|
+
7. 🔧 [Troubleshooting](https://constructive.io/learn/troubleshooting)
|
|
54
|
+
Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
55
|
+
|
|
56
|
+
## Related Constructive Tooling
|
|
57
|
+
|
|
58
|
+
### 📦 Package Management
|
|
59
|
+
|
|
60
|
+
* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
|
|
61
|
+
|
|
62
|
+
### 🧪 Testing
|
|
63
|
+
|
|
64
|
+
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
|
|
65
|
+
* [pgsql-seed](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-seed): **🌱 PostgreSQL seeding utilities** for CSV, JSON, SQL data loading, and pgpm deployment.
|
|
66
|
+
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
|
|
67
|
+
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
|
|
68
|
+
* [pg-query-context](https://github.com/constructive-io/constructive/tree/main/postgres/pg-query-context): **🔒 Session context injection** to add session-local context (e.g., `SET LOCAL`) into queries—ideal for setting `role`, `jwt.claims`, and other session settings.
|
|
69
|
+
|
|
70
|
+
### 🧠 Parsing & AST
|
|
71
|
+
|
|
72
|
+
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
|
|
73
|
+
* [libpg-query-node](https://www.npmjs.com/package/libpg-query): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
|
|
74
|
+
* [pg-proto-parser](https://www.npmjs.com/package/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
|
|
75
|
+
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
|
|
76
|
+
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
|
|
77
|
+
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
|
|
78
|
+
|
|
79
|
+
## Credits
|
|
80
|
+
|
|
81
|
+
**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
|
|
82
|
+
|
|
83
|
+
## Disclaimer
|
|
84
|
+
|
|
85
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
86
|
+
|
|
87
|
+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzAllowAll = void 0;
|
|
4
|
+
exports.AuthzAllowAll = {
|
|
5
|
+
name: 'AuthzAllowAll',
|
|
6
|
+
slug: 'authz_allow_all',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Public Access',
|
|
9
|
+
description: 'Allows all access. Generates TRUE expression.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {}
|
|
13
|
+
},
|
|
14
|
+
tags: ['authz'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzComposite = void 0;
|
|
4
|
+
exports.AuthzComposite = {
|
|
5
|
+
name: 'AuthzComposite',
|
|
6
|
+
slug: 'authz_composite',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Composite Policy',
|
|
9
|
+
description: 'Composite authorization policy that combines multiple authorization nodes using boolean logic (AND/OR). The data field contains a JSONB AST with nested authorization nodes.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"description": "A composite policy containing nested authorization nodes combined with boolean logic",
|
|
13
|
+
"properties": {
|
|
14
|
+
"BoolExpr": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"description": "Boolean expression combining multiple authorization nodes",
|
|
17
|
+
"properties": {
|
|
18
|
+
"boolop": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": [
|
|
21
|
+
"AND_EXPR",
|
|
22
|
+
"OR_EXPR",
|
|
23
|
+
"NOT_EXPR"
|
|
24
|
+
],
|
|
25
|
+
"description": "Boolean operator: AND_EXPR, OR_EXPR, or NOT_EXPR"
|
|
26
|
+
},
|
|
27
|
+
"args": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"description": "Array of authorization nodes to combine",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "object"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
tags: ['composite', 'authz'],
|
|
39
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzDenyAll = void 0;
|
|
4
|
+
exports.AuthzDenyAll = {
|
|
5
|
+
name: 'AuthzDenyAll',
|
|
6
|
+
slug: 'authz_deny_all',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'No Access',
|
|
9
|
+
description: 'Denies all access. Generates FALSE expression.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {}
|
|
13
|
+
},
|
|
14
|
+
tags: ['authz'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzDirectOwnerAny = void 0;
|
|
4
|
+
exports.AuthzDirectOwnerAny = {
|
|
5
|
+
name: 'AuthzDirectOwnerAny',
|
|
6
|
+
slug: 'authz_direct_owner_any',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Multi-Owner Access',
|
|
9
|
+
description: 'OR logic for multiple ownership fields. Checks if current user matches any of the specified fields.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"entity_fields": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"description": "Array of column names to check for ownership"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"entity_fields"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
tags: ['ownership', 'authz'],
|
|
26
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzDirectOwner = void 0;
|
|
4
|
+
exports.AuthzDirectOwner = {
|
|
5
|
+
name: 'AuthzDirectOwner',
|
|
6
|
+
slug: 'authz_direct_owner',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Direct Ownership',
|
|
9
|
+
description: 'Direct equality comparison between a table column and the current user ID. Simplest authorization pattern with no subqueries.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"entity_field": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Column name containing the owner user ID (e.g., owner_id)"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"entity_field"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
tags: ['ownership', 'authz'],
|
|
23
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzEntityMembership = void 0;
|
|
4
|
+
exports.AuthzEntityMembership = {
|
|
5
|
+
name: 'AuthzEntityMembership',
|
|
6
|
+
slug: 'authz_entity_membership',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Entity Membership',
|
|
9
|
+
description: 'Membership check scoped by a field on the row through the SPRT table. Verifies user has membership in the entity referenced by the row.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"entity_field": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Column name referencing the entity (e.g., entity_id, org_id)"
|
|
16
|
+
},
|
|
17
|
+
"membership_type": {
|
|
18
|
+
"type": [
|
|
19
|
+
"integer",
|
|
20
|
+
"string"
|
|
21
|
+
],
|
|
22
|
+
"description": "Scope: 1=app, 2=org, 3=group (or string name resolved via membership_types_module)"
|
|
23
|
+
},
|
|
24
|
+
"permission": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Single permission name to check (resolved to bitstring mask)"
|
|
27
|
+
},
|
|
28
|
+
"permissions": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"description": "Multiple permission names to check (ORed together into mask)"
|
|
34
|
+
},
|
|
35
|
+
"is_admin": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "If true, require is_admin flag"
|
|
38
|
+
},
|
|
39
|
+
"is_owner": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"description": "If true, require is_owner flag"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": [
|
|
45
|
+
"entity_field"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
tags: ['membership', 'authz'],
|
|
49
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzMemberList = void 0;
|
|
4
|
+
exports.AuthzMemberList = {
|
|
5
|
+
name: 'AuthzMemberList',
|
|
6
|
+
slug: 'authz_member_list',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Member List',
|
|
9
|
+
description: 'Check if current user is in an array column on the same row.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"array_field": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Column name containing the array of user IDs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"array_field"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
tags: ['ownership', 'authz'],
|
|
23
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzMembership = void 0;
|
|
4
|
+
exports.AuthzMembership = {
|
|
5
|
+
name: 'AuthzMembership',
|
|
6
|
+
slug: 'authz_membership_check',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Membership Check',
|
|
9
|
+
description: 'Membership check that verifies the user has membership (optionally with specific permission) without binding to any entity from the row. Uses EXISTS subquery against SPRT table.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"membership_type": {
|
|
14
|
+
"type": [
|
|
15
|
+
"integer",
|
|
16
|
+
"string"
|
|
17
|
+
],
|
|
18
|
+
"description": "Scope: 1=app, 2=org, 3=group (or string name resolved via membership_types_module)"
|
|
19
|
+
},
|
|
20
|
+
"permission": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Single permission name to check (resolved to bitstring mask)"
|
|
23
|
+
},
|
|
24
|
+
"permissions": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"description": "Multiple permission names to check (ORed together into mask)"
|
|
30
|
+
},
|
|
31
|
+
"is_admin": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": "If true, require is_admin flag"
|
|
34
|
+
},
|
|
35
|
+
"is_owner": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "If true, require is_owner flag"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": [
|
|
41
|
+
"membership_type"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
tags: ['membership', 'authz'],
|
|
45
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzOrgHierarchy = void 0;
|
|
4
|
+
exports.AuthzOrgHierarchy = {
|
|
5
|
+
name: 'AuthzOrgHierarchy',
|
|
6
|
+
slug: 'authz_org_hierarchy',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Org Hierarchy',
|
|
9
|
+
description: 'Organizational hierarchy visibility using closure table. Managers can see subordinate data or subordinates can see manager data.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"direction": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": [
|
|
16
|
+
"up",
|
|
17
|
+
"down"
|
|
18
|
+
],
|
|
19
|
+
"description": "down=manager sees subordinates, up=subordinate sees managers"
|
|
20
|
+
},
|
|
21
|
+
"entity_field": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Field referencing the org entity",
|
|
24
|
+
"default": "entity_id"
|
|
25
|
+
},
|
|
26
|
+
"anchor_field": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Field referencing the user (e.g., owner_id)"
|
|
29
|
+
},
|
|
30
|
+
"max_depth": {
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"description": "Optional max depth to limit visibility"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": [
|
|
36
|
+
"direction",
|
|
37
|
+
"anchor_field"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
tags: ['membership', 'hierarchy', 'authz'],
|
|
41
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzPeerOwnership = void 0;
|
|
4
|
+
exports.AuthzPeerOwnership = {
|
|
5
|
+
name: 'AuthzPeerOwnership',
|
|
6
|
+
slug: 'authz_peer_ownership',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Peer Ownership',
|
|
9
|
+
description: 'Peer visibility through shared entity membership. Authorizes access to user-owned rows when the owner and current user are both members of the same entity. Self-joins the SPRT table to find peers.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"owner_field": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Column name on protected table referencing the owning user (e.g., owner_id)"
|
|
16
|
+
},
|
|
17
|
+
"membership_type": {
|
|
18
|
+
"type": [
|
|
19
|
+
"integer",
|
|
20
|
+
"string"
|
|
21
|
+
],
|
|
22
|
+
"description": "Scope: 1=app, 2=org, 3=group (or string name resolved via membership_types_module)"
|
|
23
|
+
},
|
|
24
|
+
"permission": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Single permission name to check on the current user membership (resolved to bitstring mask)"
|
|
27
|
+
},
|
|
28
|
+
"permissions": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"description": "Multiple permission names to check on the current user membership (ORed together into mask)"
|
|
34
|
+
},
|
|
35
|
+
"is_admin": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "If true, require is_admin flag on current user membership"
|
|
38
|
+
},
|
|
39
|
+
"is_owner": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"description": "If true, require is_owner flag on current user membership"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": [
|
|
45
|
+
"owner_field"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
tags: ['membership', 'peer', 'authz'],
|
|
49
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzPublishable = void 0;
|
|
4
|
+
exports.AuthzPublishable = {
|
|
5
|
+
name: 'AuthzPublishable',
|
|
6
|
+
slug: 'authz_publishable',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Published Content',
|
|
9
|
+
description: 'Published state access control. Restricts access to records that are published.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"is_published_field": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Boolean field indicating published state",
|
|
16
|
+
"default": "is_published"
|
|
17
|
+
},
|
|
18
|
+
"published_at_field": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Timestamp field for publish time",
|
|
21
|
+
"default": "published_at"
|
|
22
|
+
},
|
|
23
|
+
"require_published_at": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"description": "Require published_at to be non-null and <= now()",
|
|
26
|
+
"default": true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
tags: ['temporal', 'publishing', 'authz'],
|
|
31
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzRelatedEntityMembership = void 0;
|
|
4
|
+
exports.AuthzRelatedEntityMembership = {
|
|
5
|
+
name: 'AuthzRelatedEntityMembership',
|
|
6
|
+
slug: 'authz_related_entity_membership',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Related Entity Membership',
|
|
9
|
+
description: 'JOIN-based membership verification through related tables. Joins SPRT table with another table to verify membership.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"entity_field": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Column name on protected table referencing the join table"
|
|
16
|
+
},
|
|
17
|
+
"membership_type": {
|
|
18
|
+
"type": [
|
|
19
|
+
"integer",
|
|
20
|
+
"string"
|
|
21
|
+
],
|
|
22
|
+
"description": "Scope: 1=app, 2=org, 3=group (or string name resolved via membership_types_module)"
|
|
23
|
+
},
|
|
24
|
+
"obj_table_id": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"format": "uuid",
|
|
27
|
+
"description": "UUID of the join table (alternative to obj_schema/obj_table)"
|
|
28
|
+
},
|
|
29
|
+
"obj_schema": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Schema of the join table (or use obj_table_id)"
|
|
32
|
+
},
|
|
33
|
+
"obj_table": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Name of the join table (or use obj_table_id)"
|
|
36
|
+
},
|
|
37
|
+
"obj_field_id": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"format": "uuid",
|
|
40
|
+
"description": "UUID of field on join table (alternative to obj_field)"
|
|
41
|
+
},
|
|
42
|
+
"obj_field": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "Field name on join table to match against SPRT entity_id"
|
|
45
|
+
},
|
|
46
|
+
"permission": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Single permission name to check (resolved to bitstring mask)"
|
|
49
|
+
},
|
|
50
|
+
"permissions": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"description": "Multiple permission names to check (ORed together into mask)"
|
|
56
|
+
},
|
|
57
|
+
"is_admin": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"description": "If true, require is_admin flag"
|
|
60
|
+
},
|
|
61
|
+
"is_owner": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"description": "If true, require is_owner flag"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": [
|
|
67
|
+
"entity_field"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
tags: ['membership', 'authz'],
|
|
71
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzRelatedMemberList = void 0;
|
|
4
|
+
exports.AuthzRelatedMemberList = {
|
|
5
|
+
name: 'AuthzRelatedMemberList',
|
|
6
|
+
slug: 'authz_related_member_list',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'Related Member List',
|
|
9
|
+
description: 'Array membership check in a related table.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"owned_schema": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Schema of the related table"
|
|
16
|
+
},
|
|
17
|
+
"owned_table": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Name of the related table"
|
|
20
|
+
},
|
|
21
|
+
"owned_table_key": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Array column in related table"
|
|
24
|
+
},
|
|
25
|
+
"owned_table_ref_key": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "FK column in related table"
|
|
28
|
+
},
|
|
29
|
+
"this_object_key": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "PK column in protected table"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": [
|
|
35
|
+
"owned_schema",
|
|
36
|
+
"owned_table",
|
|
37
|
+
"owned_table_key",
|
|
38
|
+
"owned_table_ref_key",
|
|
39
|
+
"this_object_key"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
tags: ['ownership', 'authz'],
|
|
43
|
+
};
|