diff --git a/.agents/skills/cli-admin/SKILL.md b/.agents/skills/cli-admin/SKILL.md index 236500827..6605508df 100644 --- a/.agents/skills/cli-admin/SKILL.md +++ b/.agents/skills/cli-admin/SKILL.md @@ -70,8 +70,8 @@ See the `references/` directory for detailed per-entity API documentation: - [org-limit-default](references/org-limit-default.md) - [org-admin-grant](references/org-admin-grant.md) - [org-owner-grant](references/org-owner-grant.md) -- [membership-type](references/membership-type.md) - [app-limit](references/app-limit.md) +- [membership-type](references/membership-type.md) - [app-achievement](references/app-achievement.md) - [app-step](references/app-step.md) - [app-claimed-invite](references/app-claimed-invite.md) diff --git a/.agents/skills/cli-admin/references/membership-type.md b/.agents/skills/cli-admin/references/membership-type.md index 657508364..278e9bd01 100644 --- a/.agents/skills/cli-admin/references/membership-type.md +++ b/.agents/skills/cli-admin/references/membership-type.md @@ -12,8 +12,8 @@ csdk membership-type list --where.. --orderBy csdk membership-type list --limit 10 --after csdk membership-type find-first --where.. csdk membership-type get --id -csdk membership-type create --name --description --prefix -csdk membership-type update --id [--name ] [--description ] [--prefix ] +csdk membership-type create --name --description --prefix [--hasUsersTableEntry ] +csdk membership-type update --id [--name ] [--description ] [--prefix ] [--hasUsersTableEntry ] csdk membership-type delete --id ``` @@ -58,7 +58,7 @@ csdk membership-type list --where.id.equalTo --orderBy ID_ASC ### Create a membershipType ```bash -csdk membership-type create --name --description --prefix +csdk membership-type create --name --description --prefix [--hasUsersTableEntry ] ``` ### Get a membershipType by id diff --git a/.agents/skills/cli-public/SKILL.md b/.agents/skills/cli-public/SKILL.md index 4fb3d06fb..ae3a2e9c1 100644 --- a/.agents/skills/cli-public/SKILL.md +++ b/.agents/skills/cli-public/SKILL.md @@ -1,13 +1,13 @@ --- name: cli-public -description: CLI tool (csdk) for the public API — provides CRUD commands for 109 tables and 64 custom operations +description: CLI tool (csdk) for the public API — provides CRUD commands for 110 tables and 64 custom operations --- # cli-public -CLI tool (csdk) for the public API — provides CRUD commands for 109 tables and 64 custom operations +CLI tool (csdk) for the public API — provides CRUD commands for 110 tables and 64 custom operations ## Usage @@ -154,6 +154,7 @@ See the `references/` directory for detailed per-entity API documentation: - [migrate-file](references/migrate-file.md) - [app-limit-default](references/app-limit-default.md) - [org-limit-default](references/org-limit-default.md) +- [devices-module](references/devices-module.md) - [membership-type](references/membership-type.md) - [app-membership-default](references/app-membership-default.md) - [commit](references/commit.md) diff --git a/.agents/skills/cli-public/references/devices-module.md b/.agents/skills/cli-public/references/devices-module.md new file mode 100644 index 000000000..9054cca04 --- /dev/null +++ b/.agents/skills/cli-public/references/devices-module.md @@ -0,0 +1,68 @@ +# devicesModule + + + +CRUD operations for DevicesModule records via csdk CLI + +## Usage + +```bash +csdk devices-module list +csdk devices-module list --where.. --orderBy +csdk devices-module list --limit 10 --after +csdk devices-module find-first --where.. +csdk devices-module get --id +csdk devices-module create --databaseId [--schemaId ] [--userDevicesTableId ] [--deviceSettingsTableId ] [--userDevicesTable ] [--deviceSettingsTable ] +csdk devices-module update --id [--databaseId ] [--schemaId ] [--userDevicesTableId ] [--deviceSettingsTableId ] [--userDevicesTable ] [--deviceSettingsTable ] +csdk devices-module delete --id +``` + +## Examples + +### List devicesModule records + +```bash +csdk devices-module list +``` + +### List devicesModule records with pagination + +```bash +csdk devices-module list --limit 10 --offset 0 +``` + +### List devicesModule records with cursor pagination + +```bash +csdk devices-module list --limit 10 --after +``` + +### Find first matching devicesModule + +```bash +csdk devices-module find-first --where.id.equalTo +``` + +### List devicesModule records with field selection + +```bash +csdk devices-module list --select id,id +``` + +### List devicesModule records with filtering and ordering + +```bash +csdk devices-module list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a devicesModule + +```bash +csdk devices-module create --databaseId [--schemaId ] [--userDevicesTableId ] [--deviceSettingsTableId ] [--userDevicesTable ] [--deviceSettingsTable ] +``` + +### Get a devicesModule by id + +```bash +csdk devices-module get --id +``` diff --git a/.agents/skills/cli-public/references/membership-type.md b/.agents/skills/cli-public/references/membership-type.md index 657508364..278e9bd01 100644 --- a/.agents/skills/cli-public/references/membership-type.md +++ b/.agents/skills/cli-public/references/membership-type.md @@ -12,8 +12,8 @@ csdk membership-type list --where.. --orderBy csdk membership-type list --limit 10 --after csdk membership-type find-first --where.. csdk membership-type get --id -csdk membership-type create --name --description --prefix -csdk membership-type update --id [--name ] [--description ] [--prefix ] +csdk membership-type create --name --description --prefix [--hasUsersTableEntry ] +csdk membership-type update --id [--name ] [--description ] [--prefix ] [--hasUsersTableEntry ] csdk membership-type delete --id ``` @@ -58,7 +58,7 @@ csdk membership-type list --where.id.equalTo --orderBy ID_ASC ### Create a membershipType ```bash -csdk membership-type create --name --description --prefix +csdk membership-type create --name --description --prefix [--hasUsersTableEntry ] ``` ### Get a membershipType by id diff --git a/.agents/skills/hooks-admin/SKILL.md b/.agents/skills/hooks-admin/SKILL.md index 99d150876..85726a2e5 100644 --- a/.agents/skills/hooks-admin/SKILL.md +++ b/.agents/skills/hooks-admin/SKILL.md @@ -51,8 +51,8 @@ See the `references/` directory for detailed per-entity API documentation: - [org-limit-default](references/org-limit-default.md) - [org-admin-grant](references/org-admin-grant.md) - [org-owner-grant](references/org-owner-grant.md) -- [membership-type](references/membership-type.md) - [app-limit](references/app-limit.md) +- [membership-type](references/membership-type.md) - [app-achievement](references/app-achievement.md) - [app-step](references/app-step.md) - [app-claimed-invite](references/app-claimed-invite.md) diff --git a/.agents/skills/hooks-admin/references/membership-type.md b/.agents/skills/hooks-admin/references/membership-type.md index 8d627c5cc..1e80ce3e2 100644 --- a/.agents/skills/hooks-admin/references/membership-type.md +++ b/.agents/skills/hooks-admin/references/membership-type.md @@ -7,8 +7,8 @@ Defines the different scopes of membership (e.g. App Member, Organization Member ## Usage ```typescript -useMembershipTypesQuery({ selection: { fields: { id: true, name: true, description: true, prefix: true } } }) -useMembershipTypeQuery({ id: '', selection: { fields: { id: true, name: true, description: true, prefix: true } } }) +useMembershipTypesQuery({ selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } } }) +useMembershipTypeQuery({ id: '', selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } } }) useCreateMembershipTypeMutation({ selection: { fields: { id: true } } }) useUpdateMembershipTypeMutation({ selection: { fields: { id: true } } }) useDeleteMembershipTypeMutation({}) @@ -20,7 +20,7 @@ useDeleteMembershipTypeMutation({}) ```typescript const { data, isLoading } = useMembershipTypesQuery({ - selection: { fields: { id: true, name: true, description: true, prefix: true } }, + selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useMembershipTypesQuery({ const { mutate } = useCreateMembershipTypeMutation({ selection: { fields: { id: true } }, }); -mutate({ name: '', description: '', prefix: '' }); +mutate({ name: '', description: '', prefix: '', hasUsersTableEntry: '' }); ``` diff --git a/.agents/skills/hooks-public/SKILL.md b/.agents/skills/hooks-public/SKILL.md index 1a11cf467..e78488dd8 100644 --- a/.agents/skills/hooks-public/SKILL.md +++ b/.agents/skills/hooks-public/SKILL.md @@ -1,13 +1,13 @@ --- name: hooks-public -description: React Query hooks for the public API — provides typed query and mutation hooks for 109 tables and 64 custom operations +description: React Query hooks for the public API — provides typed query and mutation hooks for 110 tables and 64 custom operations --- # hooks-public -React Query hooks for the public API — provides typed query and mutation hooks for 109 tables and 64 custom operations +React Query hooks for the public API — provides typed query and mutation hooks for 110 tables and 64 custom operations ## Usage @@ -135,6 +135,7 @@ See the `references/` directory for detailed per-entity API documentation: - [migrate-file](references/migrate-file.md) - [app-limit-default](references/app-limit-default.md) - [org-limit-default](references/org-limit-default.md) +- [devices-module](references/devices-module.md) - [membership-type](references/membership-type.md) - [app-membership-default](references/app-membership-default.md) - [commit](references/commit.md) diff --git a/.agents/skills/hooks-public/references/devices-module.md b/.agents/skills/hooks-public/references/devices-module.md new file mode 100644 index 000000000..d1c5489cd --- /dev/null +++ b/.agents/skills/hooks-public/references/devices-module.md @@ -0,0 +1,34 @@ +# devicesModule + + + +React Query hooks for DevicesModule data operations + +## Usage + +```typescript +useDevicesModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } } }) +useDevicesModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } } }) +useCreateDevicesModuleMutation({ selection: { fields: { id: true } } }) +useUpdateDevicesModuleMutation({ selection: { fields: { id: true } } }) +useDeleteDevicesModuleMutation({}) +``` + +## Examples + +### List all devicesModules + +```typescript +const { data, isLoading } = useDevicesModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }, +}); +``` + +### Create a devicesModule + +```typescript +const { mutate } = useCreateDevicesModuleMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }); +``` diff --git a/.agents/skills/hooks-public/references/membership-type.md b/.agents/skills/hooks-public/references/membership-type.md index 8d627c5cc..1e80ce3e2 100644 --- a/.agents/skills/hooks-public/references/membership-type.md +++ b/.agents/skills/hooks-public/references/membership-type.md @@ -7,8 +7,8 @@ Defines the different scopes of membership (e.g. App Member, Organization Member ## Usage ```typescript -useMembershipTypesQuery({ selection: { fields: { id: true, name: true, description: true, prefix: true } } }) -useMembershipTypeQuery({ id: '', selection: { fields: { id: true, name: true, description: true, prefix: true } } }) +useMembershipTypesQuery({ selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } } }) +useMembershipTypeQuery({ id: '', selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } } }) useCreateMembershipTypeMutation({ selection: { fields: { id: true } } }) useUpdateMembershipTypeMutation({ selection: { fields: { id: true } } }) useDeleteMembershipTypeMutation({}) @@ -20,7 +20,7 @@ useDeleteMembershipTypeMutation({}) ```typescript const { data, isLoading } = useMembershipTypesQuery({ - selection: { fields: { id: true, name: true, description: true, prefix: true } }, + selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useMembershipTypesQuery({ const { mutate } = useCreateMembershipTypeMutation({ selection: { fields: { id: true } }, }); -mutate({ name: '', description: '', prefix: '' }); +mutate({ name: '', description: '', prefix: '', hasUsersTableEntry: '' }); ``` diff --git a/.agents/skills/orm-admin/SKILL.md b/.agents/skills/orm-admin/SKILL.md index d6101ffbd..a4c18aab6 100644 --- a/.agents/skills/orm-admin/SKILL.md +++ b/.agents/skills/orm-admin/SKILL.md @@ -51,8 +51,8 @@ See the `references/` directory for detailed per-entity API documentation: - [org-limit-default](references/org-limit-default.md) - [org-admin-grant](references/org-admin-grant.md) - [org-owner-grant](references/org-owner-grant.md) -- [membership-type](references/membership-type.md) - [app-limit](references/app-limit.md) +- [membership-type](references/membership-type.md) - [app-achievement](references/app-achievement.md) - [app-step](references/app-step.md) - [app-claimed-invite](references/app-claimed-invite.md) diff --git a/.agents/skills/orm-admin/references/membership-type.md b/.agents/skills/orm-admin/references/membership-type.md index 7712dd2ca..59172f5da 100644 --- a/.agents/skills/orm-admin/references/membership-type.md +++ b/.agents/skills/orm-admin/references/membership-type.md @@ -9,7 +9,7 @@ Defines the different scopes of membership (e.g. App Member, Organization Member ```typescript db.membershipType.findMany({ select: { id: true } }).execute() db.membershipType.findOne({ id: '', select: { id: true } }).execute() -db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute() +db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute() db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute() db.membershipType.delete({ where: { id: '' } }).execute() ``` @@ -28,7 +28,7 @@ const items = await db.membershipType.findMany({ ```typescript const item = await db.membershipType.create({ - data: { name: '', description: '', prefix: '' }, + data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); ``` diff --git a/.agents/skills/orm-public/SKILL.md b/.agents/skills/orm-public/SKILL.md index 188a1660d..fd6968cf0 100644 --- a/.agents/skills/orm-public/SKILL.md +++ b/.agents/skills/orm-public/SKILL.md @@ -1,13 +1,13 @@ --- name: orm-public -description: ORM client for the public API — provides typed CRUD operations for 109 tables and 64 custom operations +description: ORM client for the public API — provides typed CRUD operations for 110 tables and 64 custom operations --- # orm-public -ORM client for the public API — provides typed CRUD operations for 109 tables and 64 custom operations +ORM client for the public API — provides typed CRUD operations for 110 tables and 64 custom operations ## Usage @@ -135,6 +135,7 @@ See the `references/` directory for detailed per-entity API documentation: - [migrate-file](references/migrate-file.md) - [app-limit-default](references/app-limit-default.md) - [org-limit-default](references/org-limit-default.md) +- [devices-module](references/devices-module.md) - [membership-type](references/membership-type.md) - [app-membership-default](references/app-membership-default.md) - [commit](references/commit.md) diff --git a/.agents/skills/orm-public/references/devices-module.md b/.agents/skills/orm-public/references/devices-module.md new file mode 100644 index 000000000..b66b4c858 --- /dev/null +++ b/.agents/skills/orm-public/references/devices-module.md @@ -0,0 +1,34 @@ +# devicesModule + + + +ORM operations for DevicesModule records + +## Usage + +```typescript +db.devicesModule.findMany({ select: { id: true } }).execute() +db.devicesModule.findOne({ id: '', select: { id: true } }).execute() +db.devicesModule.create({ data: { databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }, select: { id: true } }).execute() +db.devicesModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.devicesModule.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all devicesModule records + +```typescript +const items = await db.devicesModule.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a devicesModule + +```typescript +const item = await db.devicesModule.create({ + data: { databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-public/references/membership-type.md b/.agents/skills/orm-public/references/membership-type.md index 7712dd2ca..59172f5da 100644 --- a/.agents/skills/orm-public/references/membership-type.md +++ b/.agents/skills/orm-public/references/membership-type.md @@ -9,7 +9,7 @@ Defines the different scopes of membership (e.g. App Member, Organization Member ```typescript db.membershipType.findMany({ select: { id: true } }).execute() db.membershipType.findOne({ id: '', select: { id: true } }).execute() -db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute() +db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute() db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute() db.membershipType.delete({ where: { id: '' } }).execute() ``` @@ -28,7 +28,7 @@ const items = await db.membershipType.findMany({ ```typescript const item = await db.membershipType.create({ - data: { name: '', description: '', prefix: '' }, + data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); ``` diff --git a/sdk/constructive-cli/src/admin/cli/README.md b/sdk/constructive-cli/src/admin/cli/README.md index ec8617219..c686da15f 100644 --- a/sdk/constructive-cli/src/admin/cli/README.md +++ b/sdk/constructive-cli/src/admin/cli/README.md @@ -40,8 +40,8 @@ csdk auth set-token | `org-limit-default` | orgLimitDefault CRUD operations | | `org-admin-grant` | orgAdminGrant CRUD operations | | `org-owner-grant` | orgOwnerGrant CRUD operations | -| `membership-type` | membershipType CRUD operations | | `app-limit` | appLimit CRUD operations | +| `membership-type` | membershipType CRUD operations | | `app-achievement` | appAchievement CRUD operations | | `app-step` | appStep CRUD operations | | `app-claimed-invite` | appClaimedInvite CRUD operations | @@ -476,30 +476,6 @@ CRUD operations for OrgOwnerGrant records. **Required create fields:** `actorId`, `entityId` **Optional create fields (backend defaults):** `isGrant`, `grantorId` -### `membership-type` - -CRUD operations for MembershipType records. - -| Subcommand | Description | -|------------|-------------| -| `list` | List all membershipType records | -| `find-first` | Find first matching membershipType record | -| `get` | Get a membershipType by id | -| `create` | Create a new membershipType | -| `update` | Update an existing membershipType | -| `delete` | Delete a membershipType | - -**Fields:** - -| Field | Type | -|-------|------| -| `id` | Int | -| `name` | String | -| `description` | String | -| `prefix` | String | - -**Required create fields:** `name`, `description`, `prefix` - ### `app-limit` CRUD operations for AppLimit records. @@ -526,6 +502,32 @@ CRUD operations for AppLimit records. **Required create fields:** `actorId` **Optional create fields (backend defaults):** `name`, `num`, `max` +### `membership-type` + +CRUD operations for MembershipType records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all membershipType records | +| `find-first` | Find first matching membershipType record | +| `get` | Get a membershipType by id | +| `create` | Create a new membershipType | +| `update` | Update an existing membershipType | +| `delete` | Delete a membershipType | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | Int | +| `name` | String | +| `description` | String | +| `prefix` | String | +| `hasUsersTableEntry` | Boolean | + +**Required create fields:** `name`, `description`, `prefix` +**Optional create fields (backend defaults):** `hasUsersTableEntry` + ### `app-achievement` CRUD operations for AppAchievement records. diff --git a/sdk/constructive-cli/src/admin/cli/commands.ts b/sdk/constructive-cli/src/admin/cli/commands.ts index 59925517d..2c9cc8446 100644 --- a/sdk/constructive-cli/src/admin/cli/commands.ts +++ b/sdk/constructive-cli/src/admin/cli/commands.ts @@ -20,8 +20,8 @@ import appLimitDefaultCmd from './commands/app-limit-default'; import orgLimitDefaultCmd from './commands/org-limit-default'; import orgAdminGrantCmd from './commands/org-admin-grant'; import orgOwnerGrantCmd from './commands/org-owner-grant'; -import membershipTypeCmd from './commands/membership-type'; import appLimitCmd from './commands/app-limit'; +import membershipTypeCmd from './commands/membership-type'; import appAchievementCmd from './commands/app-achievement'; import appStepCmd from './commands/app-step'; import appClaimedInviteCmd from './commands/app-claimed-invite'; @@ -78,8 +78,8 @@ const createCommandMap: () => Record< 'org-limit-default': orgLimitDefaultCmd, 'org-admin-grant': orgAdminGrantCmd, 'org-owner-grant': orgOwnerGrantCmd, - 'membership-type': membershipTypeCmd, 'app-limit': appLimitCmd, + 'membership-type': membershipTypeCmd, 'app-achievement': appAchievementCmd, 'app-step': appStepCmd, 'app-claimed-invite': appClaimedInviteCmd, @@ -114,7 +114,7 @@ const createCommandMap: () => Record< 'provision-bucket': provisionBucketCmd, }); const usage = - "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n org-member orgMember CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n membership-type membershipType CRUD operations\n app-limit appLimit CRUD operations\n app-achievement appAchievement CRUD operations\n app-step appStep CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-limit orgLimit CRUD operations\n app-grant appGrant CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n app-level appLevel CRUD operations\n app-invite appInvite CRUD operations\n app-membership appMembership CRUD operations\n org-membership orgMembership CRUD operations\n org-invite orgInvite CRUD operations\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n steps-achieved stepsAchieved\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; + "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n org-member orgMember CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n app-limit appLimit CRUD operations\n membership-type membershipType CRUD operations\n app-achievement appAchievement CRUD operations\n app-step appStep CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-limit orgLimit CRUD operations\n app-grant appGrant CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n app-level appLevel CRUD operations\n app-invite appInvite CRUD operations\n app-membership appMembership CRUD operations\n org-membership orgMembership CRUD operations\n org-invite orgInvite CRUD operations\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n steps-achieved stepsAchieved\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; export const commands = async ( argv: Partial>, prompter: Inquirerer, diff --git a/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts b/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts index 91dc29236..7e529c255 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts @@ -20,6 +20,7 @@ const fieldSchema: FieldSchema = { name: 'string', description: 'string', prefix: 'string', + hasUsersTableEntry: 'boolean', }; const usage = '\nmembership-type \n\nCommands:\n list List membershipType records\n find-first Find first matching membershipType record\n get Get a membershipType by ID\n create Create a new membershipType\n update Update an existing membershipType\n delete Delete a membershipType\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n\n --help, -h Show this help message\n'; @@ -76,6 +77,7 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, description: true, prefix: true, + hasUsersTableEntry: true, }; const findManyArgs = parseFindManyArgs< FindManyArgs & { @@ -100,6 +102,7 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, description: true, prefix: true, + hasUsersTableEntry: true, }; const findFirstArgs = parseFindFirstArgs< FindFirstArgs & { @@ -136,6 +139,7 @@ async function handleGet(argv: Partial>, prompter: Inqui name: true, description: true, prefix: true, + hasUsersTableEntry: true, }, }) .execute(); @@ -169,6 +173,13 @@ async function handleCreate(argv: Partial>, prompter: In message: 'prefix', required: true, }, + { + type: 'boolean', + name: 'hasUsersTableEntry', + message: 'hasUsersTableEntry', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined( @@ -182,12 +193,14 @@ async function handleCreate(argv: Partial>, prompter: In name: cleanedData.name, description: cleanedData.description, prefix: cleanedData.prefix, + hasUsersTableEntry: cleanedData.hasUsersTableEntry, }, select: { id: true, name: true, description: true, prefix: true, + hasUsersTableEntry: true, }, }) .execute(); @@ -227,6 +240,13 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'prefix', required: false, }, + { + type: 'boolean', + name: 'hasUsersTableEntry', + message: 'hasUsersTableEntry', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MembershipTypePatch; @@ -240,12 +260,14 @@ async function handleUpdate(argv: Partial>, prompter: In name: cleanedData.name, description: cleanedData.description, prefix: cleanedData.prefix, + hasUsersTableEntry: cleanedData.hasUsersTableEntry, }, select: { id: true, name: true, description: true, prefix: true, + hasUsersTableEntry: true, }, }) .execute(); diff --git a/sdk/constructive-cli/src/admin/orm/README.md b/sdk/constructive-cli/src/admin/orm/README.md index bb7c574ae..98a72fe8b 100644 --- a/sdk/constructive-cli/src/admin/orm/README.md +++ b/sdk/constructive-cli/src/admin/orm/README.md @@ -35,8 +35,8 @@ const db = createClient({ | `orgLimitDefault` | findMany, findOne, create, update, delete | | `orgAdminGrant` | findMany, findOne, create, update, delete | | `orgOwnerGrant` | findMany, findOne, create, update, delete | -| `membershipType` | findMany, findOne, create, update, delete | | `appLimit` | findMany, findOne, create, update, delete | +| `membershipType` | findMany, findOne, create, update, delete | | `appAchievement` | findMany, findOne, create, update, delete | | `appStep` | findMany, findOne, create, update, delete | | `appClaimedInvite` | findMany, findOne, create, update, delete | @@ -511,69 +511,70 @@ const updated = await db.orgOwnerGrant.update({ where: { id: '' }, data: { const deleted = await db.orgOwnerGrant.delete({ where: { id: '' } }).execute(); ``` -### `db.membershipType` +### `db.appLimit` -CRUD operations for MembershipType records. +CRUD operations for AppLimit records. **Fields:** | Field | Type | Editable | |-------|------|----------| -| `id` | Int | No | +| `id` | UUID | No | | `name` | String | Yes | -| `description` | String | Yes | -| `prefix` | String | Yes | +| `actorId` | UUID | Yes | +| `num` | Int | Yes | +| `max` | Int | Yes | **Operations:** ```typescript -// List all membershipType records -const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true } }).execute(); +// List all appLimit records +const items = await db.appLimit.findMany({ select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); // Get one by id -const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true } }).execute(); +const item = await db.appLimit.findOne({ id: '', select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); // Create -const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute(); +const created = await db.appLimit.create({ data: { name: '', actorId: '', num: '', max: '' }, select: { id: true } }).execute(); // Update -const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); +const updated = await db.appLimit.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.membershipType.delete({ where: { id: '' } }).execute(); +const deleted = await db.appLimit.delete({ where: { id: '' } }).execute(); ``` -### `db.appLimit` +### `db.membershipType` -CRUD operations for AppLimit records. +CRUD operations for MembershipType records. **Fields:** | Field | Type | Editable | |-------|------|----------| -| `id` | UUID | No | +| `id` | Int | No | | `name` | String | Yes | -| `actorId` | UUID | Yes | -| `num` | Int | Yes | -| `max` | Int | Yes | +| `description` | String | Yes | +| `prefix` | String | Yes | +| `hasUsersTableEntry` | Boolean | Yes | **Operations:** ```typescript -// List all appLimit records -const items = await db.appLimit.findMany({ select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); +// List all membershipType records +const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Get one by id -const item = await db.appLimit.findOne({ id: '', select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); +const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Create -const created = await db.appLimit.create({ data: { name: '', actorId: '', num: '', max: '' }, select: { id: true } }).execute(); +const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); // Update -const updated = await db.appLimit.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); +const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.appLimit.delete({ where: { id: '' } }).execute(); +const deleted = await db.membershipType.delete({ where: { id: '' } }).execute(); ``` ### `db.appAchievement` diff --git a/sdk/constructive-cli/src/admin/orm/index.ts b/sdk/constructive-cli/src/admin/orm/index.ts index b32258228..4adc3236a 100644 --- a/sdk/constructive-cli/src/admin/orm/index.ts +++ b/sdk/constructive-cli/src/admin/orm/index.ts @@ -19,8 +19,8 @@ import { AppLimitDefaultModel } from './models/appLimitDefault'; import { OrgLimitDefaultModel } from './models/orgLimitDefault'; import { OrgAdminGrantModel } from './models/orgAdminGrant'; import { OrgOwnerGrantModel } from './models/orgOwnerGrant'; -import { MembershipTypeModel } from './models/membershipType'; import { AppLimitModel } from './models/appLimit'; +import { MembershipTypeModel } from './models/membershipType'; import { AppAchievementModel } from './models/appAchievement'; import { AppStepModel } from './models/appStep'; import { AppClaimedInviteModel } from './models/appClaimedInvite'; @@ -87,8 +87,8 @@ export function createClient(config: OrmClientConfig) { orgLimitDefault: new OrgLimitDefaultModel(client), orgAdminGrant: new OrgAdminGrantModel(client), orgOwnerGrant: new OrgOwnerGrantModel(client), - membershipType: new MembershipTypeModel(client), appLimit: new AppLimitModel(client), + membershipType: new MembershipTypeModel(client), appAchievement: new AppAchievementModel(client), appStep: new AppStepModel(client), appClaimedInvite: new AppClaimedInviteModel(client), diff --git a/sdk/constructive-cli/src/admin/orm/input-types.ts b/sdk/constructive-cli/src/admin/orm/input-types.ts index 66dd2861c..5ff064f0c 100644 --- a/sdk/constructive-cli/src/admin/orm/input-types.ts +++ b/sdk/constructive-cli/src/admin/orm/input-types.ts @@ -370,17 +370,6 @@ export interface OrgOwnerGrant { createdAt?: string | null; updatedAt?: string | null; } -/** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ -export interface MembershipType { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** Human-readable name of the membership type */ - name?: string | null; - /** Description of what this membership type represents */ - description?: string | null; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix?: string | null; -} /** Tracks per-actor usage counts against configurable maximum limits */ export interface AppLimit { id: string; @@ -393,6 +382,19 @@ export interface AppLimit { /** Maximum allowed usage; NULL means use the default limit value */ max?: number | null; } +/** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ +export interface MembershipType { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** Human-readable name of the membership type */ + name?: string | null; + /** Description of what this membership type represents */ + description?: string | null; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix?: string | null; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean | null; +} /** Aggregated user progress for level requirements, tallying the total count; updated via triggers and should not be modified manually */ export interface AppAchievement { id: string; @@ -695,8 +697,8 @@ export interface AppLimitDefaultRelations {} export interface OrgLimitDefaultRelations {} export interface OrgAdminGrantRelations {} export interface OrgOwnerGrantRelations {} -export interface MembershipTypeRelations {} export interface AppLimitRelations {} +export interface MembershipTypeRelations {} export interface AppAchievementRelations {} export interface AppStepRelations {} export interface AppClaimedInviteRelations {} @@ -732,8 +734,8 @@ export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRela export type OrgLimitDefaultWithRelations = OrgLimitDefault & OrgLimitDefaultRelations; export type OrgAdminGrantWithRelations = OrgAdminGrant & OrgAdminGrantRelations; export type OrgOwnerGrantWithRelations = OrgOwnerGrant & OrgOwnerGrantRelations; -export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppLimitWithRelations = AppLimit & AppLimitRelations; +export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppAchievementWithRelations = AppAchievement & AppAchievementRelations; export type AppStepWithRelations = AppStep & AppStepRelations; export type AppClaimedInviteWithRelations = AppClaimedInvite & AppClaimedInviteRelations; @@ -844,12 +846,6 @@ export type OrgOwnerGrantSelect = { createdAt?: boolean; updatedAt?: boolean; }; -export type MembershipTypeSelect = { - id?: boolean; - name?: boolean; - description?: boolean; - prefix?: boolean; -}; export type AppLimitSelect = { id?: boolean; name?: boolean; @@ -857,6 +853,13 @@ export type AppLimitSelect = { num?: boolean; max?: boolean; }; +export type MembershipTypeSelect = { + id?: boolean; + name?: boolean; + description?: boolean; + prefix?: boolean; + hasUsersTableEntry?: boolean; +}; export type AppAchievementSelect = { id?: boolean; actorId?: boolean; @@ -1262,22 +1265,6 @@ export interface OrgOwnerGrantFilter { /** Negates the expression. */ not?: OrgOwnerGrantFilter; } -export interface MembershipTypeFilter { - /** Filter by the object’s `id` field. */ - id?: IntFilter; - /** Filter by the object’s `name` field. */ - name?: StringFilter; - /** Filter by the object’s `description` field. */ - description?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Checks for all expressions in this list. */ - and?: MembershipTypeFilter[]; - /** Checks for any expressions in this list. */ - or?: MembershipTypeFilter[]; - /** Negates the expression. */ - not?: MembershipTypeFilter; -} export interface AppLimitFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -1296,6 +1283,24 @@ export interface AppLimitFilter { /** Negates the expression. */ not?: AppLimitFilter; } +export interface MembershipTypeFilter { + /** Filter by the object’s `id` field. */ + id?: IntFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: MembershipTypeFilter[]; + /** Checks for any expressions in this list. */ + or?: MembershipTypeFilter[]; + /** Negates the expression. */ + not?: MembershipTypeFilter; +} export interface AppAchievementFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -1887,18 +1892,6 @@ export type OrgOwnerGrantOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; -export type MembershipTypeOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'NAME_ASC' - | 'NAME_DESC' - | 'DESCRIPTION_ASC' - | 'DESCRIPTION_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC'; export type AppLimitOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -1913,6 +1906,20 @@ export type AppLimitOrderBy = | 'NUM_DESC' | 'MAX_ASC' | 'MAX_DESC'; +export type MembershipTypeOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; export type AppAchievementOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -2572,28 +2579,6 @@ export interface DeleteOrgOwnerGrantInput { clientMutationId?: string; id: string; } -export interface CreateMembershipTypeInput { - clientMutationId?: string; - membershipType: { - name: string; - description: string; - prefix: string; - }; -} -export interface MembershipTypePatch { - name?: string | null; - description?: string | null; - prefix?: string | null; -} -export interface UpdateMembershipTypeInput { - clientMutationId?: string; - id: number; - membershipTypePatch: MembershipTypePatch; -} -export interface DeleteMembershipTypeInput { - clientMutationId?: string; - id: number; -} export interface CreateAppLimitInput { clientMutationId?: string; appLimit: { @@ -2618,6 +2603,30 @@ export interface DeleteAppLimitInput { clientMutationId?: string; id: string; } +export interface CreateMembershipTypeInput { + clientMutationId?: string; + membershipType: { + name: string; + description: string; + prefix: string; + hasUsersTableEntry?: boolean; + }; +} +export interface MembershipTypePatch { + name?: string | null; + description?: string | null; + prefix?: string | null; + hasUsersTableEntry?: boolean | null; +} +export interface UpdateMembershipTypeInput { + clientMutationId?: string; + id: number; + membershipTypePatch: MembershipTypePatch; +} +export interface DeleteMembershipTypeInput { + clientMutationId?: string; + id: number; +} export interface CreateAppAchievementInput { clientMutationId?: string; appAchievement: { @@ -3884,51 +3893,6 @@ export type DeleteOrgOwnerGrantPayloadSelect = { select: OrgOwnerGrantEdgeSelect; }; }; -export interface CreateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was created by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type CreateMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; -export interface UpdateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was updated by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type UpdateMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; -export interface DeleteMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was deleted by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type DeleteMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; export interface CreateAppLimitPayload { clientMutationId?: string | null; /** The `AppLimit` that was created by this mutation. */ @@ -3974,6 +3938,51 @@ export type DeleteAppLimitPayloadSelect = { select: AppLimitEdgeSelect; }; }; +export interface CreateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was created by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type CreateMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; +export interface UpdateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was updated by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type UpdateMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; +export interface DeleteMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was deleted by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type DeleteMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; export interface CreateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was created by this mutation. */ @@ -4855,18 +4864,6 @@ export type OrgOwnerGrantEdgeSelect = { select: OrgOwnerGrantSelect; }; }; -/** A `MembershipType` edge in the connection. */ -export interface MembershipTypeEdge { - cursor?: string | null; - /** The `MembershipType` at the end of the edge. */ - node?: MembershipType | null; -} -export type MembershipTypeEdgeSelect = { - cursor?: boolean; - node?: { - select: MembershipTypeSelect; - }; -}; /** A `AppLimit` edge in the connection. */ export interface AppLimitEdge { cursor?: string | null; @@ -4879,6 +4876,18 @@ export type AppLimitEdgeSelect = { select: AppLimitSelect; }; }; +/** A `MembershipType` edge in the connection. */ +export interface MembershipTypeEdge { + cursor?: string | null; + /** The `MembershipType` at the end of the edge. */ + node?: MembershipType | null; +} +export type MembershipTypeEdgeSelect = { + cursor?: boolean; + node?: { + select: MembershipTypeSelect; + }; +}; /** A `AppAchievement` edge in the connection. */ export interface AppAchievementEdge { cursor?: string | null; diff --git a/sdk/constructive-cli/src/admin/orm/models/index.ts b/sdk/constructive-cli/src/admin/orm/models/index.ts index 91876b01c..a4bd7a8ee 100644 --- a/sdk/constructive-cli/src/admin/orm/models/index.ts +++ b/sdk/constructive-cli/src/admin/orm/models/index.ts @@ -17,8 +17,8 @@ export { AppLimitDefaultModel } from './appLimitDefault'; export { OrgLimitDefaultModel } from './orgLimitDefault'; export { OrgAdminGrantModel } from './orgAdminGrant'; export { OrgOwnerGrantModel } from './orgOwnerGrant'; -export { MembershipTypeModel } from './membershipType'; export { AppLimitModel } from './appLimit'; +export { MembershipTypeModel } from './membershipType'; export { AppAchievementModel } from './appAchievement'; export { AppStepModel } from './appStep'; export { AppClaimedInviteModel } from './appClaimedInvite'; diff --git a/sdk/constructive-cli/src/public/README.md b/sdk/constructive-cli/src/public/README.md index 92faa481f..a3d07ec54 100644 --- a/sdk/constructive-cli/src/public/README.md +++ b/sdk/constructive-cli/src/public/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 109 +- **Tables:** 110 - **Custom queries:** 20 - **Custom mutations:** 44 diff --git a/sdk/constructive-cli/src/public/cli/README.md b/sdk/constructive-cli/src/public/cli/README.md index 1c4d734ba..a590a6687 100644 --- a/sdk/constructive-cli/src/public/cli/README.md +++ b/sdk/constructive-cli/src/public/cli/README.md @@ -124,6 +124,7 @@ csdk auth set-token | `migrate-file` | migrateFile CRUD operations | | `app-limit-default` | appLimitDefault CRUD operations | | `org-limit-default` | orgLimitDefault CRUD operations | +| `devices-module` | devicesModule CRUD operations | | `membership-type` | membershipType CRUD operations | | `app-membership-default` | appMembershipDefault CRUD operations | | `commit` | commit CRUD operations | @@ -3265,6 +3266,34 @@ CRUD operations for OrgLimitDefault records. **Required create fields:** `name` **Optional create fields (backend defaults):** `max` +### `devices-module` + +CRUD operations for DevicesModule records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all devicesModule records | +| `find-first` | Find first matching devicesModule record | +| `get` | Get a devicesModule by id | +| `create` | Create a new devicesModule | +| `update` | Update an existing devicesModule | +| `delete` | Delete a devicesModule | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `schemaId` | UUID | +| `userDevicesTableId` | UUID | +| `deviceSettingsTableId` | UUID | +| `userDevicesTable` | String | +| `deviceSettingsTable` | String | + +**Required create fields:** `databaseId` +**Optional create fields (backend defaults):** `schemaId`, `userDevicesTableId`, `deviceSettingsTableId`, `userDevicesTable`, `deviceSettingsTable` + ### `membership-type` CRUD operations for MembershipType records. @@ -3286,8 +3315,10 @@ CRUD operations for MembershipType records. | `name` | String | | `description` | String | | `prefix` | String | +| `hasUsersTableEntry` | Boolean | **Required create fields:** `name`, `description`, `prefix` +**Optional create fields (backend defaults):** `hasUsersTableEntry` ### `app-membership-default` diff --git a/sdk/constructive-cli/src/public/cli/commands.ts b/sdk/constructive-cli/src/public/cli/commands.ts index 220c646f7..0c9ac7c2d 100644 --- a/sdk/constructive-cli/src/public/cli/commands.ts +++ b/sdk/constructive-cli/src/public/cli/commands.ts @@ -104,6 +104,7 @@ import roleTypeCmd from './commands/role-type'; import migrateFileCmd from './commands/migrate-file'; import appLimitDefaultCmd from './commands/app-limit-default'; import orgLimitDefaultCmd from './commands/org-limit-default'; +import devicesModuleCmd from './commands/devices-module'; import membershipTypeCmd from './commands/membership-type'; import appMembershipDefaultCmd from './commands/app-membership-default'; import commitCmd from './commands/commit'; @@ -287,6 +288,7 @@ const createCommandMap: () => Record< 'migrate-file': migrateFileCmd, 'app-limit-default': appLimitDefaultCmd, 'org-limit-default': orgLimitDefaultCmd, + 'devices-module': devicesModuleCmd, 'membership-type': membershipTypeCmd, 'app-membership-default': appMembershipDefaultCmd, commit: commitCmd, @@ -364,7 +366,7 @@ const createCommandMap: () => Record< 'provision-bucket': provisionBucketCmd, }); const usage = - "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n org-limit orgLimit CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n connected-account connectedAccount CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Five phases: (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints are deferred), (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-one-time-token signInOneTimeToken\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; + "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n org-limit orgLimit CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n connected-account connectedAccount CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n devices-module devicesModule CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Five phases: (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints are deferred), (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-one-time-token signInOneTimeToken\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; export const commands = async ( argv: Partial>, prompter: Inquirerer, diff --git a/sdk/constructive-cli/src/public/cli/commands/devices-module.ts b/sdk/constructive-cli/src/public/cli/commands/devices-module.ts new file mode 100644 index 000000000..a8f42cbe1 --- /dev/null +++ b/sdk/constructive-cli/src/public/cli/commands/devices-module.ts @@ -0,0 +1,361 @@ +/** + * CLI commands for DevicesModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDevicesModuleInput, + DevicesModulePatch, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + databaseId: 'uuid', + schemaId: 'uuid', + userDevicesTableId: 'uuid', + deviceSettingsTableId: 'uuid', + userDevicesTable: 'string', + deviceSettingsTable: 'string', +}; +const usage = + '\ndevices-module \n\nCommands:\n list List devicesModule records\n find-first Find first matching devicesModule record\n get Get a devicesModule by ID\n create Create a new devicesModule\n update Update an existing devicesModule\n delete Delete a devicesModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + schemaId: true, + userDevicesTableId: true, + deviceSettingsTableId: true, + userDevicesTable: true, + deviceSettingsTable: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DevicesModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.devicesModule.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + schemaId: true, + userDevicesTableId: true, + deviceSettingsTableId: true, + userDevicesTable: true, + deviceSettingsTable: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DevicesModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.devicesModule.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.devicesModule + .findOne({ + id: answers.id as string, + select: { + id: true, + databaseId: true, + schemaId: true, + userDevicesTableId: true, + deviceSettingsTableId: true, + userDevicesTable: true, + deviceSettingsTable: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTableId', + message: 'userDevicesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deviceSettingsTableId', + message: 'deviceSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTable', + message: 'userDevicesTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deviceSettingsTable', + message: 'deviceSettingsTable', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDevicesModuleInput['devicesModule']; + const client = getClient(); + const result = await client.devicesModule + .create({ + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + userDevicesTableId: cleanedData.userDevicesTableId, + deviceSettingsTableId: cleanedData.deviceSettingsTableId, + userDevicesTable: cleanedData.userDevicesTable, + deviceSettingsTable: cleanedData.deviceSettingsTable, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + userDevicesTableId: true, + deviceSettingsTableId: true, + userDevicesTable: true, + deviceSettingsTable: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTableId', + message: 'userDevicesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deviceSettingsTableId', + message: 'deviceSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTable', + message: 'userDevicesTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deviceSettingsTable', + message: 'deviceSettingsTable', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as DevicesModulePatch; + const client = getClient(); + const result = await client.devicesModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + userDevicesTableId: cleanedData.userDevicesTableId, + deviceSettingsTableId: cleanedData.deviceSettingsTableId, + userDevicesTable: cleanedData.userDevicesTable, + deviceSettingsTable: cleanedData.deviceSettingsTable, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + userDevicesTableId: true, + deviceSettingsTableId: true, + userDevicesTable: true, + deviceSettingsTable: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.devicesModule + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/public/cli/commands/membership-type.ts b/sdk/constructive-cli/src/public/cli/commands/membership-type.ts index 91dc29236..7e529c255 100644 --- a/sdk/constructive-cli/src/public/cli/commands/membership-type.ts +++ b/sdk/constructive-cli/src/public/cli/commands/membership-type.ts @@ -20,6 +20,7 @@ const fieldSchema: FieldSchema = { name: 'string', description: 'string', prefix: 'string', + hasUsersTableEntry: 'boolean', }; const usage = '\nmembership-type \n\nCommands:\n list List membershipType records\n find-first Find first matching membershipType record\n get Get a membershipType by ID\n create Create a new membershipType\n update Update an existing membershipType\n delete Delete a membershipType\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n\n --help, -h Show this help message\n'; @@ -76,6 +77,7 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, description: true, prefix: true, + hasUsersTableEntry: true, }; const findManyArgs = parseFindManyArgs< FindManyArgs & { @@ -100,6 +102,7 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, description: true, prefix: true, + hasUsersTableEntry: true, }; const findFirstArgs = parseFindFirstArgs< FindFirstArgs & { @@ -136,6 +139,7 @@ async function handleGet(argv: Partial>, prompter: Inqui name: true, description: true, prefix: true, + hasUsersTableEntry: true, }, }) .execute(); @@ -169,6 +173,13 @@ async function handleCreate(argv: Partial>, prompter: In message: 'prefix', required: true, }, + { + type: 'boolean', + name: 'hasUsersTableEntry', + message: 'hasUsersTableEntry', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined( @@ -182,12 +193,14 @@ async function handleCreate(argv: Partial>, prompter: In name: cleanedData.name, description: cleanedData.description, prefix: cleanedData.prefix, + hasUsersTableEntry: cleanedData.hasUsersTableEntry, }, select: { id: true, name: true, description: true, prefix: true, + hasUsersTableEntry: true, }, }) .execute(); @@ -227,6 +240,13 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'prefix', required: false, }, + { + type: 'boolean', + name: 'hasUsersTableEntry', + message: 'hasUsersTableEntry', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MembershipTypePatch; @@ -240,12 +260,14 @@ async function handleUpdate(argv: Partial>, prompter: In name: cleanedData.name, description: cleanedData.description, prefix: cleanedData.prefix, + hasUsersTableEntry: cleanedData.hasUsersTableEntry, }, select: { id: true, name: true, description: true, prefix: true, + hasUsersTableEntry: true, }, }) .execute(); diff --git a/sdk/constructive-cli/src/public/orm/README.md b/sdk/constructive-cli/src/public/orm/README.md index 9129a2618..2ac3c9bce 100644 --- a/sdk/constructive-cli/src/public/orm/README.md +++ b/sdk/constructive-cli/src/public/orm/README.md @@ -119,6 +119,7 @@ const db = createClient({ | `migrateFile` | findMany, findOne, create, update, delete | | `appLimitDefault` | findMany, findOne, create, update, delete | | `orgLimitDefault` | findMany, findOne, create, update, delete | +| `devicesModule` | findMany, findOne, create, update, delete | | `membershipType` | findMany, findOne, create, update, delete | | `appMembershipDefault` | findMany, findOne, create, update, delete | | `commit` | findMany, findOne, create, update, delete | @@ -3835,6 +3836,41 @@ const updated = await db.orgLimitDefault.update({ where: { id: '' }, data: const deleted = await db.orgLimitDefault.delete({ where: { id: '' } }).execute(); ``` +### `db.devicesModule` + +CRUD operations for DevicesModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `userDevicesTableId` | UUID | Yes | +| `deviceSettingsTableId` | UUID | Yes | +| `userDevicesTable` | String | Yes | +| `deviceSettingsTable` | String | Yes | + +**Operations:** + +```typescript +// List all devicesModule records +const items = await db.devicesModule.findMany({ select: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }).execute(); + +// Get one by id +const item = await db.devicesModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }).execute(); + +// Create +const created = await db.devicesModule.create({ data: { databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.devicesModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.devicesModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.membershipType` CRUD operations for MembershipType records. @@ -3847,18 +3883,19 @@ CRUD operations for MembershipType records. | `name` | String | Yes | | `description` | String | Yes | | `prefix` | String | Yes | +| `hasUsersTableEntry` | Boolean | Yes | **Operations:** ```typescript // List all membershipType records -const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true } }).execute(); +const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Get one by id -const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true } }).execute(); +const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Create -const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute(); +const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); // Update const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); diff --git a/sdk/constructive-cli/src/public/orm/index.ts b/sdk/constructive-cli/src/public/orm/index.ts index 7d317c0a2..003d87225 100644 --- a/sdk/constructive-cli/src/public/orm/index.ts +++ b/sdk/constructive-cli/src/public/orm/index.ts @@ -103,6 +103,7 @@ import { RoleTypeModel } from './models/roleType'; import { MigrateFileModel } from './models/migrateFile'; import { AppLimitDefaultModel } from './models/appLimitDefault'; import { OrgLimitDefaultModel } from './models/orgLimitDefault'; +import { DevicesModuleModel } from './models/devicesModule'; import { MembershipTypeModel } from './models/membershipType'; import { AppMembershipDefaultModel } from './models/appMembershipDefault'; import { CommitModel } from './models/commit'; @@ -248,6 +249,7 @@ export function createClient(config: OrmClientConfig) { migrateFile: new MigrateFileModel(client), appLimitDefault: new AppLimitDefaultModel(client), orgLimitDefault: new OrgLimitDefaultModel(client), + devicesModule: new DevicesModuleModel(client), membershipType: new MembershipTypeModel(client), appMembershipDefault: new AppMembershipDefaultModel(client), commit: new CommitModel(client), diff --git a/sdk/constructive-cli/src/public/orm/input-types.ts b/sdk/constructive-cli/src/public/orm/input-types.ts index 60b4df70c..1d3e435ae 100644 --- a/sdk/constructive-cli/src/public/orm/input-types.ts +++ b/sdk/constructive-cli/src/public/orm/input-types.ts @@ -1821,6 +1821,15 @@ export interface OrgLimitDefault { /** Default maximum usage allowed for this limit */ max?: number | null; } +export interface DevicesModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + userDevicesTableId?: string | null; + deviceSettingsTableId?: string | null; + userDevicesTable?: string | null; + deviceSettingsTable?: string | null; +} /** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ export interface MembershipType { /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ @@ -1831,6 +1840,8 @@ export interface MembershipType { description?: string | null; /** Short prefix used to namespace tables and functions for this membership scope */ prefix?: string | null; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean | null; } /** Default membership settings per entity, controlling initial approval and verification state for new members */ export interface AppMembershipDefault { @@ -2025,6 +2036,7 @@ export interface DatabaseRelations { rlsModule?: RlsModule | null; hierarchyModule?: HierarchyModule | null; rateLimitsModule?: RateLimitsModule | null; + devicesModule?: DevicesModule | null; schemas?: ConnectionResult; tables?: ConnectionResult; checkConstraints?: ConnectionResult; @@ -2548,6 +2560,12 @@ export interface RoleTypeRelations {} export interface MigrateFileRelations {} export interface AppLimitDefaultRelations {} export interface OrgLimitDefaultRelations {} +export interface DevicesModuleRelations { + database?: Database | null; + deviceSettingsTableByDeviceSettingsTableId?: Table | null; + schema?: Schema | null; + userDevicesTableByUserDevicesTableId?: Table | null; +} export interface MembershipTypeRelations {} export interface AppMembershipDefaultRelations {} export interface CommitRelations {} @@ -2750,6 +2768,7 @@ export type RoleTypeWithRelations = RoleType & RoleTypeRelations; export type MigrateFileWithRelations = MigrateFile & MigrateFileRelations; export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRelations; export type OrgLimitDefaultWithRelations = OrgLimitDefault & OrgLimitDefaultRelations; +export type DevicesModuleWithRelations = DevicesModule & DevicesModuleRelations; export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations; @@ -2831,6 +2850,9 @@ export type DatabaseSelect = { rateLimitsModule?: { select: RateLimitsModuleSelect; }; + devicesModule?: { + select: DevicesModuleSelect; + }; schemas?: { select: SchemaSelect; first?: number; @@ -5265,11 +5287,33 @@ export type OrgLimitDefaultSelect = { name?: boolean; max?: boolean; }; +export type DevicesModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + userDevicesTableId?: boolean; + deviceSettingsTableId?: boolean; + userDevicesTable?: boolean; + deviceSettingsTable?: boolean; + database?: { + select: DatabaseSelect; + }; + deviceSettingsTableByDeviceSettingsTableId?: { + select: TableSelect; + }; + schema?: { + select: SchemaSelect; + }; + userDevicesTableByUserDevicesTableId?: { + select: TableSelect; + }; +}; export type MembershipTypeSelect = { id?: boolean; name?: boolean; description?: boolean; prefix?: boolean; + hasUsersTableEntry?: boolean; }; export type AppMembershipDefaultSelect = { id?: boolean; @@ -6132,6 +6176,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -9417,6 +9465,36 @@ export interface OrgLimitDefaultFilter { /** Negates the expression. */ not?: OrgLimitDefaultFilter; } +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} export interface MembershipTypeFilter { /** Filter by the object’s `id` field. */ id?: IntFilter; @@ -9426,6 +9504,8 @@ export interface MembershipTypeFilter { description?: StringFilter; /** Filter by the object’s `prefix` field. */ prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; /** Checks for all expressions in this list. */ and?: MembershipTypeFilter[]; /** Checks for any expressions in this list. */ @@ -12301,6 +12381,24 @@ export type OrgLimitDefaultOrderBy = | 'NAME_DESC' | 'MAX_ASC' | 'MAX_DESC'; +export type DevicesModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_ASC' + | 'USER_DEVICES_TABLE_DESC' + | 'DEVICE_SETTINGS_TABLE_ASC' + | 'DEVICE_SETTINGS_TABLE_DESC'; export type MembershipTypeOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -12312,7 +12410,9 @@ export type MembershipTypeOrderBy = | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'PREFIX_ASC' - | 'PREFIX_DESC'; + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; export type AppMembershipDefaultOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -15713,18 +15813,48 @@ export interface DeleteOrgLimitDefaultInput { clientMutationId?: string; id: string; } +export interface CreateDevicesModuleInput { + clientMutationId?: string; + devicesModule: { + databaseId: string; + schemaId?: string; + userDevicesTableId?: string; + deviceSettingsTableId?: string; + userDevicesTable?: string; + deviceSettingsTable?: string; + }; +} +export interface DevicesModulePatch { + databaseId?: string | null; + schemaId?: string | null; + userDevicesTableId?: string | null; + deviceSettingsTableId?: string | null; + userDevicesTable?: string | null; + deviceSettingsTable?: string | null; +} +export interface UpdateDevicesModuleInput { + clientMutationId?: string; + id: string; + devicesModulePatch: DevicesModulePatch; +} +export interface DeleteDevicesModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateMembershipTypeInput { clientMutationId?: string; membershipType: { name: string; description: string; prefix: string; + hasUsersTableEntry?: boolean; }; } export interface MembershipTypePatch { name?: string | null; description?: string | null; prefix?: string | null; + hasUsersTableEntry?: boolean | null; } export interface UpdateMembershipTypeInput { clientMutationId?: string; @@ -21053,6 +21183,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -22500,6 +22634,37 @@ export interface RateLimitsModuleFilter { /** Filter by the object’s `schema` relation. */ schema?: SchemaFilter; } +/** A filter to be used against `DevicesModule` object types. All fields are combined with a logical ‘and.’ */ +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} /** A filter to be used against BitString fields. All fields are combined with a logical ‘and.’ */ export interface BitStringFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -27364,6 +27529,51 @@ export type DeleteOrgLimitDefaultPayloadSelect = { select: OrgLimitDefaultEdgeSelect; }; }; +export interface CreateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was created by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type CreateDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; +export interface UpdateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was updated by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type UpdateDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; +export interface DeleteDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was deleted by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type DeleteDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; export interface CreateMembershipTypePayload { clientMutationId?: string | null; /** The `MembershipType` that was created by this mutation. */ @@ -29042,6 +29252,18 @@ export type OrgLimitDefaultEdgeSelect = { select: OrgLimitDefaultSelect; }; }; +/** A `DevicesModule` edge in the connection. */ +export interface DevicesModuleEdge { + cursor?: string | null; + /** The `DevicesModule` at the end of the edge. */ + node?: DevicesModule | null; +} +export type DevicesModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: DevicesModuleSelect; + }; +}; /** A `MembershipType` edge in the connection. */ export interface MembershipTypeEdge { cursor?: string | null; diff --git a/sdk/constructive-cli/src/public/orm/models/devicesModule.ts b/sdk/constructive-cli/src/public/orm/models/devicesModule.ts new file mode 100644 index 000000000..11386e4fe --- /dev/null +++ b/sdk/constructive-cli/src/public/orm/models/devicesModule.ts @@ -0,0 +1,237 @@ +/** + * DevicesModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + DevicesModule, + DevicesModuleWithRelations, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, + CreateDevicesModuleInput, + UpdateDevicesModuleInput, + DevicesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class DevicesModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModules: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModules: { + nodes: InferSelectResult[]; + }; + }> { + const { document, variables } = buildFindFirstDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + }, + 'DevicesModuleFilter', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', + document, + variables, + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', + document, + variables, + transform: (data: { + devicesModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'DevicesModule', + 'createDevicesModule', + 'devicesModule', + args.select, + args.data, + 'CreateDevicesModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'createDevicesModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + DevicesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'DevicesModule', + 'updateDevicesModule', + 'devicesModule', + args.select, + args.where.id, + args.data, + 'UpdateDevicesModuleInput', + 'id', + 'devicesModulePatch', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'updateDevicesModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'DevicesModule', + 'deleteDevicesModule', + 'devicesModule', + { + id: args.where.id, + }, + 'DeleteDevicesModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'deleteDevicesModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/public/orm/models/index.ts b/sdk/constructive-cli/src/public/orm/models/index.ts index 0eacaeee7..19ede4ef0 100644 --- a/sdk/constructive-cli/src/public/orm/models/index.ts +++ b/sdk/constructive-cli/src/public/orm/models/index.ts @@ -101,6 +101,7 @@ export { RoleTypeModel } from './roleType'; export { MigrateFileModel } from './migrateFile'; export { AppLimitDefaultModel } from './appLimitDefault'; export { OrgLimitDefaultModel } from './orgLimitDefault'; +export { DevicesModuleModel } from './devicesModule'; export { MembershipTypeModel } from './membershipType'; export { AppMembershipDefaultModel } from './appMembershipDefault'; export { CommitModel } from './commit'; diff --git a/sdk/constructive-react/src/admin/hooks/README.md b/sdk/constructive-react/src/admin/hooks/README.md index 4805f0461..dd903038e 100644 --- a/sdk/constructive-react/src/admin/hooks/README.md +++ b/sdk/constructive-react/src/admin/hooks/README.md @@ -96,16 +96,16 @@ function App() { | `useCreateOrgOwnerGrantMutation` | Mutation | Records of ownership transfers and grants between members | | `useUpdateOrgOwnerGrantMutation` | Mutation | Records of ownership transfers and grants between members | | `useDeleteOrgOwnerGrantMutation` | Mutation | Records of ownership transfers and grants between members | -| `useMembershipTypesQuery` | Query | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | -| `useMembershipTypeQuery` | Query | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | -| `useCreateMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | -| `useUpdateMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | -| `useDeleteMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | | `useAppLimitsQuery` | Query | Tracks per-actor usage counts against configurable maximum limits | | `useAppLimitQuery` | Query | Tracks per-actor usage counts against configurable maximum limits | | `useCreateAppLimitMutation` | Mutation | Tracks per-actor usage counts against configurable maximum limits | | `useUpdateAppLimitMutation` | Mutation | Tracks per-actor usage counts against configurable maximum limits | | `useDeleteAppLimitMutation` | Mutation | Tracks per-actor usage counts against configurable maximum limits | +| `useMembershipTypesQuery` | Query | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | +| `useMembershipTypeQuery` | Query | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | +| `useCreateMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | +| `useUpdateMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | +| `useDeleteMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | | `useAppAchievementsQuery` | Query | Aggregated user progress for level requirements, tallying the total count; updated via triggers and should not be modified manually | | `useAppAchievementQuery` | Query | Aggregated user progress for level requirements, tallying the total count; updated via triggers and should not be modified manually | | `useCreateAppAchievementMutation` | Mutation | Aggregated user progress for level requirements, tallying the total count; updated via triggers and should not be modified manually | @@ -495,27 +495,6 @@ const { mutate: create } = useCreateOrgOwnerGrantMutation({ create({ isGrant: '', actorId: '', entityId: '', grantorId: '' }); ``` -### MembershipType - -```typescript -// List all membershipTypes -const { data, isLoading } = useMembershipTypesQuery({ - selection: { fields: { id: true, name: true, description: true, prefix: true } }, -}); - -// Get one membershipType -const { data: item } = useMembershipTypeQuery({ - id: '', - selection: { fields: { id: true, name: true, description: true, prefix: true } }, -}); - -// Create a membershipType -const { mutate: create } = useCreateMembershipTypeMutation({ - selection: { fields: { id: true } }, -}); -create({ name: '', description: '', prefix: '' }); -``` - ### AppLimit ```typescript @@ -537,6 +516,27 @@ const { mutate: create } = useCreateAppLimitMutation({ create({ name: '', actorId: '', num: '', max: '' }); ``` +### MembershipType + +```typescript +// List all membershipTypes +const { data, isLoading } = useMembershipTypesQuery({ + selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }, +}); + +// Get one membershipType +const { data: item } = useMembershipTypeQuery({ + id: '', + selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }, +}); + +// Create a membershipType +const { mutate: create } = useCreateMembershipTypeMutation({ + selection: { fields: { id: true } }, +}); +create({ name: '', description: '', prefix: '', hasUsersTableEntry: '' }); +``` + ### AppAchievement ```typescript diff --git a/sdk/constructive-react/src/admin/hooks/index.ts b/sdk/constructive-react/src/admin/hooks/index.ts index ae021934e..4e10e79e1 100644 --- a/sdk/constructive-react/src/admin/hooks/index.ts +++ b/sdk/constructive-react/src/admin/hooks/index.ts @@ -2,7 +2,7 @@ * GraphQL SDK * @generated by @constructive-io/graphql-codegen * - * Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, AppPermission, OrgPermission, AppLevelRequirement, OrgMember, AppPermissionDefault, OrgPermissionDefault, AppAdminGrant, AppOwnerGrant, AppLimitDefault, OrgLimitDefault, OrgAdminGrant, OrgOwnerGrant, MembershipType, AppLimit, AppAchievement, AppStep, AppClaimedInvite, OrgChartEdgeGrant, OrgLimit, AppGrant, AppMembershipDefault, OrgClaimedInvite, OrgGrant, OrgChartEdge, OrgMembershipDefault, AppLevel, AppInvite, AppMembership, OrgMembership, OrgInvite + * Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, AppPermission, OrgPermission, AppLevelRequirement, OrgMember, AppPermissionDefault, OrgPermissionDefault, AppAdminGrant, AppOwnerGrant, AppLimitDefault, OrgLimitDefault, OrgAdminGrant, OrgOwnerGrant, AppLimit, MembershipType, AppAchievement, AppStep, AppClaimedInvite, OrgChartEdgeGrant, OrgLimit, AppGrant, AppMembershipDefault, OrgClaimedInvite, OrgGrant, OrgChartEdge, OrgMembershipDefault, AppLevel, AppInvite, AppMembership, OrgMembership, OrgInvite * * Usage: * diff --git a/sdk/constructive-react/src/admin/hooks/invalidation.ts b/sdk/constructive-react/src/admin/hooks/invalidation.ts index 4d923823f..f9011aa76 100644 --- a/sdk/constructive-react/src/admin/hooks/invalidation.ts +++ b/sdk/constructive-react/src/admin/hooks/invalidation.ts @@ -29,8 +29,8 @@ import { orgLimitDefaultKeys, orgAdminGrantKeys, orgOwnerGrantKeys, - membershipTypeKeys, appLimitKeys, + membershipTypeKeys, appAchievementKeys, appStepKeys, appClaimedInviteKeys, @@ -306,6 +306,20 @@ export const invalidate = { queryKey: orgOwnerGrantKeys.detail(id), }), }, + /** Invalidate appLimit queries */ appLimit: { + /** Invalidate all appLimit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitKeys.all, + }), + /** Invalidate appLimit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitKeys.lists(), + }), + /** Invalidate a specific appLimit */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: appLimitKeys.detail(id), + }), + }, /** Invalidate membershipType queries */ membershipType: { /** Invalidate all membershipType queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -323,20 +337,6 @@ export const invalidate = { queryKey: membershipTypeKeys.detail(id), }), }, - /** Invalidate appLimit queries */ appLimit: { - /** Invalidate all appLimit queries */ all: (queryClient: QueryClient) => - queryClient.invalidateQueries({ - queryKey: appLimitKeys.all, - }), - /** Invalidate appLimit list queries */ lists: (queryClient: QueryClient) => - queryClient.invalidateQueries({ - queryKey: appLimitKeys.lists(), - }), - /** Invalidate a specific appLimit */ detail: (queryClient: QueryClient, id: string | number) => - queryClient.invalidateQueries({ - queryKey: appLimitKeys.detail(id), - }), - }, /** Invalidate appAchievement queries */ appAchievement: { /** Invalidate all appAchievement queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -716,6 +716,11 @@ export const remove = { queryKey: orgOwnerGrantKeys.detail(id), }); }, + /** Remove appLimit from cache */ appLimit: (queryClient: QueryClient, id: string | number) => { + queryClient.removeQueries({ + queryKey: appLimitKeys.detail(id), + }); + }, /** Remove membershipType from cache */ membershipType: ( queryClient: QueryClient, id: string | number @@ -724,11 +729,6 @@ export const remove = { queryKey: membershipTypeKeys.detail(id), }); }, - /** Remove appLimit from cache */ appLimit: (queryClient: QueryClient, id: string | number) => { - queryClient.removeQueries({ - queryKey: appLimitKeys.detail(id), - }); - }, /** Remove appAchievement from cache */ appAchievement: ( queryClient: QueryClient, id: string | number diff --git a/sdk/constructive-react/src/admin/hooks/mutation-keys.ts b/sdk/constructive-react/src/admin/hooks/mutation-keys.ts index de8189800..85c648ec4 100644 --- a/sdk/constructive-react/src/admin/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/admin/hooks/mutation-keys.ts @@ -146,6 +146,14 @@ export const orgOwnerGrantMutationKeys = { /** Delete orgOwnerGrant mutation key */ delete: (id: string | number) => ['mutation', 'orgownergrant', 'delete', id] as const, } as const; +export const appLimitMutationKeys = { + /** All appLimit mutation keys */ all: ['mutation', 'applimit'] as const, + /** Create appLimit mutation key */ create: () => ['mutation', 'applimit', 'create'] as const, + /** Update appLimit mutation key */ update: (id: string | number) => + ['mutation', 'applimit', 'update', id] as const, + /** Delete appLimit mutation key */ delete: (id: string | number) => + ['mutation', 'applimit', 'delete', id] as const, +} as const; export const membershipTypeMutationKeys = { /** All membershipType mutation keys */ all: ['mutation', 'membershiptype'] as const, /** Create membershipType mutation key */ create: () => @@ -155,14 +163,6 @@ export const membershipTypeMutationKeys = { /** Delete membershipType mutation key */ delete: (id: string | number) => ['mutation', 'membershiptype', 'delete', id] as const, } as const; -export const appLimitMutationKeys = { - /** All appLimit mutation keys */ all: ['mutation', 'applimit'] as const, - /** Create appLimit mutation key */ create: () => ['mutation', 'applimit', 'create'] as const, - /** Update appLimit mutation key */ update: (id: string | number) => - ['mutation', 'applimit', 'update', id] as const, - /** Delete appLimit mutation key */ delete: (id: string | number) => - ['mutation', 'applimit', 'delete', id] as const, -} as const; export const appAchievementMutationKeys = { /** All appAchievement mutation keys */ all: ['mutation', 'appachievement'] as const, /** Create appAchievement mutation key */ create: () => @@ -364,8 +364,8 @@ export const mutationKeys = { orgLimitDefault: orgLimitDefaultMutationKeys, orgAdminGrant: orgAdminGrantMutationKeys, orgOwnerGrant: orgOwnerGrantMutationKeys, - membershipType: membershipTypeMutationKeys, appLimit: appLimitMutationKeys, + membershipType: membershipTypeMutationKeys, appAchievement: appAchievementMutationKeys, appStep: appStepMutationKeys, appClaimedInvite: appClaimedInviteMutationKeys, diff --git a/sdk/constructive-react/src/admin/hooks/mutations/index.ts b/sdk/constructive-react/src/admin/hooks/mutations/index.ts index 1b1176d1f..378790ecb 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/index.ts @@ -41,12 +41,12 @@ export * from './useDeleteOrgAdminGrantMutation'; export * from './useCreateOrgOwnerGrantMutation'; export * from './useUpdateOrgOwnerGrantMutation'; export * from './useDeleteOrgOwnerGrantMutation'; -export * from './useCreateMembershipTypeMutation'; -export * from './useUpdateMembershipTypeMutation'; -export * from './useDeleteMembershipTypeMutation'; export * from './useCreateAppLimitMutation'; export * from './useUpdateAppLimitMutation'; export * from './useDeleteAppLimitMutation'; +export * from './useCreateMembershipTypeMutation'; +export * from './useUpdateMembershipTypeMutation'; +export * from './useDeleteMembershipTypeMutation'; export * from './useCreateAppAchievementMutation'; export * from './useUpdateAppAchievementMutation'; export * from './useDeleteAppAchievementMutation'; diff --git a/sdk/constructive-react/src/admin/hooks/queries/index.ts b/sdk/constructive-react/src/admin/hooks/queries/index.ts index bbcf1abe0..411e6941a 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/index.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/index.ts @@ -29,10 +29,10 @@ export * from './useOrgAdminGrantsQuery'; export * from './useOrgAdminGrantQuery'; export * from './useOrgOwnerGrantsQuery'; export * from './useOrgOwnerGrantQuery'; -export * from './useMembershipTypesQuery'; -export * from './useMembershipTypeQuery'; export * from './useAppLimitsQuery'; export * from './useAppLimitQuery'; +export * from './useMembershipTypesQuery'; +export * from './useMembershipTypeQuery'; export * from './useAppAchievementsQuery'; export * from './useAppAchievementQuery'; export * from './useAppStepsQuery'; diff --git a/sdk/constructive-react/src/admin/hooks/query-keys.ts b/sdk/constructive-react/src/admin/hooks/query-keys.ts index 45af02360..518df200e 100644 --- a/sdk/constructive-react/src/admin/hooks/query-keys.ts +++ b/sdk/constructive-react/src/admin/hooks/query-keys.ts @@ -145,15 +145,6 @@ export const orgOwnerGrantKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...orgOwnerGrantKeys.details(), id] as const, } as const; -export const membershipTypeKeys = { - /** All membershipType queries */ all: ['membershiptype'] as const, - /** List query keys */ lists: () => [...membershipTypeKeys.all, 'list'] as const, - /** List query key with variables */ list: (variables?: object) => - [...membershipTypeKeys.lists(), variables] as const, - /** Detail query keys */ details: () => [...membershipTypeKeys.all, 'detail'] as const, - /** Detail query key for specific item */ detail: (id: string | number) => - [...membershipTypeKeys.details(), id] as const, -} as const; export const appLimitKeys = { /** All appLimit queries */ all: ['applimit'] as const, /** List query keys */ lists: () => [...appLimitKeys.all, 'list'] as const, @@ -163,6 +154,15 @@ export const appLimitKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...appLimitKeys.details(), id] as const, } as const; +export const membershipTypeKeys = { + /** All membershipType queries */ all: ['membershiptype'] as const, + /** List query keys */ lists: () => [...membershipTypeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...membershipTypeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...membershipTypeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...membershipTypeKeys.details(), id] as const, +} as const; export const appAchievementKeys = { /** All appAchievement queries */ all: ['appachievement'] as const, /** List query keys */ lists: () => [...appAchievementKeys.all, 'list'] as const, @@ -377,8 +377,8 @@ export const queryKeys = { orgLimitDefault: orgLimitDefaultKeys, orgAdminGrant: orgAdminGrantKeys, orgOwnerGrant: orgOwnerGrantKeys, - membershipType: membershipTypeKeys, appLimit: appLimitKeys, + membershipType: membershipTypeKeys, appAchievement: appAchievementKeys, appStep: appStepKeys, appClaimedInvite: appClaimedInviteKeys, diff --git a/sdk/constructive-react/src/admin/orm/README.md b/sdk/constructive-react/src/admin/orm/README.md index bb7c574ae..98a72fe8b 100644 --- a/sdk/constructive-react/src/admin/orm/README.md +++ b/sdk/constructive-react/src/admin/orm/README.md @@ -35,8 +35,8 @@ const db = createClient({ | `orgLimitDefault` | findMany, findOne, create, update, delete | | `orgAdminGrant` | findMany, findOne, create, update, delete | | `orgOwnerGrant` | findMany, findOne, create, update, delete | -| `membershipType` | findMany, findOne, create, update, delete | | `appLimit` | findMany, findOne, create, update, delete | +| `membershipType` | findMany, findOne, create, update, delete | | `appAchievement` | findMany, findOne, create, update, delete | | `appStep` | findMany, findOne, create, update, delete | | `appClaimedInvite` | findMany, findOne, create, update, delete | @@ -511,69 +511,70 @@ const updated = await db.orgOwnerGrant.update({ where: { id: '' }, data: { const deleted = await db.orgOwnerGrant.delete({ where: { id: '' } }).execute(); ``` -### `db.membershipType` +### `db.appLimit` -CRUD operations for MembershipType records. +CRUD operations for AppLimit records. **Fields:** | Field | Type | Editable | |-------|------|----------| -| `id` | Int | No | +| `id` | UUID | No | | `name` | String | Yes | -| `description` | String | Yes | -| `prefix` | String | Yes | +| `actorId` | UUID | Yes | +| `num` | Int | Yes | +| `max` | Int | Yes | **Operations:** ```typescript -// List all membershipType records -const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true } }).execute(); +// List all appLimit records +const items = await db.appLimit.findMany({ select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); // Get one by id -const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true } }).execute(); +const item = await db.appLimit.findOne({ id: '', select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); // Create -const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute(); +const created = await db.appLimit.create({ data: { name: '', actorId: '', num: '', max: '' }, select: { id: true } }).execute(); // Update -const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); +const updated = await db.appLimit.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.membershipType.delete({ where: { id: '' } }).execute(); +const deleted = await db.appLimit.delete({ where: { id: '' } }).execute(); ``` -### `db.appLimit` +### `db.membershipType` -CRUD operations for AppLimit records. +CRUD operations for MembershipType records. **Fields:** | Field | Type | Editable | |-------|------|----------| -| `id` | UUID | No | +| `id` | Int | No | | `name` | String | Yes | -| `actorId` | UUID | Yes | -| `num` | Int | Yes | -| `max` | Int | Yes | +| `description` | String | Yes | +| `prefix` | String | Yes | +| `hasUsersTableEntry` | Boolean | Yes | **Operations:** ```typescript -// List all appLimit records -const items = await db.appLimit.findMany({ select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); +// List all membershipType records +const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Get one by id -const item = await db.appLimit.findOne({ id: '', select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); +const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Create -const created = await db.appLimit.create({ data: { name: '', actorId: '', num: '', max: '' }, select: { id: true } }).execute(); +const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); // Update -const updated = await db.appLimit.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); +const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.appLimit.delete({ where: { id: '' } }).execute(); +const deleted = await db.membershipType.delete({ where: { id: '' } }).execute(); ``` ### `db.appAchievement` diff --git a/sdk/constructive-react/src/admin/orm/index.ts b/sdk/constructive-react/src/admin/orm/index.ts index becae9d2a..76969882b 100644 --- a/sdk/constructive-react/src/admin/orm/index.ts +++ b/sdk/constructive-react/src/admin/orm/index.ts @@ -19,8 +19,8 @@ import { AppLimitDefaultModel } from './models/appLimitDefault'; import { OrgLimitDefaultModel } from './models/orgLimitDefault'; import { OrgAdminGrantModel } from './models/orgAdminGrant'; import { OrgOwnerGrantModel } from './models/orgOwnerGrant'; -import { MembershipTypeModel } from './models/membershipType'; import { AppLimitModel } from './models/appLimit'; +import { MembershipTypeModel } from './models/membershipType'; import { AppAchievementModel } from './models/appAchievement'; import { AppStepModel } from './models/appStep'; import { AppClaimedInviteModel } from './models/appClaimedInvite'; @@ -86,8 +86,8 @@ export function createClient(config: OrmClientConfig) { orgLimitDefault: new OrgLimitDefaultModel(client), orgAdminGrant: new OrgAdminGrantModel(client), orgOwnerGrant: new OrgOwnerGrantModel(client), - membershipType: new MembershipTypeModel(client), appLimit: new AppLimitModel(client), + membershipType: new MembershipTypeModel(client), appAchievement: new AppAchievementModel(client), appStep: new AppStepModel(client), appClaimedInvite: new AppClaimedInviteModel(client), diff --git a/sdk/constructive-react/src/admin/orm/input-types.ts b/sdk/constructive-react/src/admin/orm/input-types.ts index 66dd2861c..5ff064f0c 100644 --- a/sdk/constructive-react/src/admin/orm/input-types.ts +++ b/sdk/constructive-react/src/admin/orm/input-types.ts @@ -370,17 +370,6 @@ export interface OrgOwnerGrant { createdAt?: string | null; updatedAt?: string | null; } -/** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ -export interface MembershipType { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** Human-readable name of the membership type */ - name?: string | null; - /** Description of what this membership type represents */ - description?: string | null; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix?: string | null; -} /** Tracks per-actor usage counts against configurable maximum limits */ export interface AppLimit { id: string; @@ -393,6 +382,19 @@ export interface AppLimit { /** Maximum allowed usage; NULL means use the default limit value */ max?: number | null; } +/** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ +export interface MembershipType { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** Human-readable name of the membership type */ + name?: string | null; + /** Description of what this membership type represents */ + description?: string | null; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix?: string | null; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean | null; +} /** Aggregated user progress for level requirements, tallying the total count; updated via triggers and should not be modified manually */ export interface AppAchievement { id: string; @@ -695,8 +697,8 @@ export interface AppLimitDefaultRelations {} export interface OrgLimitDefaultRelations {} export interface OrgAdminGrantRelations {} export interface OrgOwnerGrantRelations {} -export interface MembershipTypeRelations {} export interface AppLimitRelations {} +export interface MembershipTypeRelations {} export interface AppAchievementRelations {} export interface AppStepRelations {} export interface AppClaimedInviteRelations {} @@ -732,8 +734,8 @@ export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRela export type OrgLimitDefaultWithRelations = OrgLimitDefault & OrgLimitDefaultRelations; export type OrgAdminGrantWithRelations = OrgAdminGrant & OrgAdminGrantRelations; export type OrgOwnerGrantWithRelations = OrgOwnerGrant & OrgOwnerGrantRelations; -export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppLimitWithRelations = AppLimit & AppLimitRelations; +export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppAchievementWithRelations = AppAchievement & AppAchievementRelations; export type AppStepWithRelations = AppStep & AppStepRelations; export type AppClaimedInviteWithRelations = AppClaimedInvite & AppClaimedInviteRelations; @@ -844,12 +846,6 @@ export type OrgOwnerGrantSelect = { createdAt?: boolean; updatedAt?: boolean; }; -export type MembershipTypeSelect = { - id?: boolean; - name?: boolean; - description?: boolean; - prefix?: boolean; -}; export type AppLimitSelect = { id?: boolean; name?: boolean; @@ -857,6 +853,13 @@ export type AppLimitSelect = { num?: boolean; max?: boolean; }; +export type MembershipTypeSelect = { + id?: boolean; + name?: boolean; + description?: boolean; + prefix?: boolean; + hasUsersTableEntry?: boolean; +}; export type AppAchievementSelect = { id?: boolean; actorId?: boolean; @@ -1262,22 +1265,6 @@ export interface OrgOwnerGrantFilter { /** Negates the expression. */ not?: OrgOwnerGrantFilter; } -export interface MembershipTypeFilter { - /** Filter by the object’s `id` field. */ - id?: IntFilter; - /** Filter by the object’s `name` field. */ - name?: StringFilter; - /** Filter by the object’s `description` field. */ - description?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Checks for all expressions in this list. */ - and?: MembershipTypeFilter[]; - /** Checks for any expressions in this list. */ - or?: MembershipTypeFilter[]; - /** Negates the expression. */ - not?: MembershipTypeFilter; -} export interface AppLimitFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -1296,6 +1283,24 @@ export interface AppLimitFilter { /** Negates the expression. */ not?: AppLimitFilter; } +export interface MembershipTypeFilter { + /** Filter by the object’s `id` field. */ + id?: IntFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: MembershipTypeFilter[]; + /** Checks for any expressions in this list. */ + or?: MembershipTypeFilter[]; + /** Negates the expression. */ + not?: MembershipTypeFilter; +} export interface AppAchievementFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -1887,18 +1892,6 @@ export type OrgOwnerGrantOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; -export type MembershipTypeOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'NAME_ASC' - | 'NAME_DESC' - | 'DESCRIPTION_ASC' - | 'DESCRIPTION_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC'; export type AppLimitOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -1913,6 +1906,20 @@ export type AppLimitOrderBy = | 'NUM_DESC' | 'MAX_ASC' | 'MAX_DESC'; +export type MembershipTypeOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; export type AppAchievementOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -2572,28 +2579,6 @@ export interface DeleteOrgOwnerGrantInput { clientMutationId?: string; id: string; } -export interface CreateMembershipTypeInput { - clientMutationId?: string; - membershipType: { - name: string; - description: string; - prefix: string; - }; -} -export interface MembershipTypePatch { - name?: string | null; - description?: string | null; - prefix?: string | null; -} -export interface UpdateMembershipTypeInput { - clientMutationId?: string; - id: number; - membershipTypePatch: MembershipTypePatch; -} -export interface DeleteMembershipTypeInput { - clientMutationId?: string; - id: number; -} export interface CreateAppLimitInput { clientMutationId?: string; appLimit: { @@ -2618,6 +2603,30 @@ export interface DeleteAppLimitInput { clientMutationId?: string; id: string; } +export interface CreateMembershipTypeInput { + clientMutationId?: string; + membershipType: { + name: string; + description: string; + prefix: string; + hasUsersTableEntry?: boolean; + }; +} +export interface MembershipTypePatch { + name?: string | null; + description?: string | null; + prefix?: string | null; + hasUsersTableEntry?: boolean | null; +} +export interface UpdateMembershipTypeInput { + clientMutationId?: string; + id: number; + membershipTypePatch: MembershipTypePatch; +} +export interface DeleteMembershipTypeInput { + clientMutationId?: string; + id: number; +} export interface CreateAppAchievementInput { clientMutationId?: string; appAchievement: { @@ -3884,51 +3893,6 @@ export type DeleteOrgOwnerGrantPayloadSelect = { select: OrgOwnerGrantEdgeSelect; }; }; -export interface CreateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was created by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type CreateMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; -export interface UpdateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was updated by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type UpdateMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; -export interface DeleteMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was deleted by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type DeleteMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; export interface CreateAppLimitPayload { clientMutationId?: string | null; /** The `AppLimit` that was created by this mutation. */ @@ -3974,6 +3938,51 @@ export type DeleteAppLimitPayloadSelect = { select: AppLimitEdgeSelect; }; }; +export interface CreateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was created by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type CreateMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; +export interface UpdateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was updated by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type UpdateMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; +export interface DeleteMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was deleted by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type DeleteMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; export interface CreateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was created by this mutation. */ @@ -4855,18 +4864,6 @@ export type OrgOwnerGrantEdgeSelect = { select: OrgOwnerGrantSelect; }; }; -/** A `MembershipType` edge in the connection. */ -export interface MembershipTypeEdge { - cursor?: string | null; - /** The `MembershipType` at the end of the edge. */ - node?: MembershipType | null; -} -export type MembershipTypeEdgeSelect = { - cursor?: boolean; - node?: { - select: MembershipTypeSelect; - }; -}; /** A `AppLimit` edge in the connection. */ export interface AppLimitEdge { cursor?: string | null; @@ -4879,6 +4876,18 @@ export type AppLimitEdgeSelect = { select: AppLimitSelect; }; }; +/** A `MembershipType` edge in the connection. */ +export interface MembershipTypeEdge { + cursor?: string | null; + /** The `MembershipType` at the end of the edge. */ + node?: MembershipType | null; +} +export type MembershipTypeEdgeSelect = { + cursor?: boolean; + node?: { + select: MembershipTypeSelect; + }; +}; /** A `AppAchievement` edge in the connection. */ export interface AppAchievementEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/admin/orm/models/index.ts b/sdk/constructive-react/src/admin/orm/models/index.ts index 91876b01c..a4bd7a8ee 100644 --- a/sdk/constructive-react/src/admin/orm/models/index.ts +++ b/sdk/constructive-react/src/admin/orm/models/index.ts @@ -17,8 +17,8 @@ export { AppLimitDefaultModel } from './appLimitDefault'; export { OrgLimitDefaultModel } from './orgLimitDefault'; export { OrgAdminGrantModel } from './orgAdminGrant'; export { OrgOwnerGrantModel } from './orgOwnerGrant'; -export { MembershipTypeModel } from './membershipType'; export { AppLimitModel } from './appLimit'; +export { MembershipTypeModel } from './membershipType'; export { AppAchievementModel } from './appAchievement'; export { AppStepModel } from './appStep'; export { AppClaimedInviteModel } from './appClaimedInvite'; diff --git a/sdk/constructive-react/src/admin/schema-types.ts b/sdk/constructive-react/src/admin/schema-types.ts index fedc7b465..15b2c8160 100644 --- a/sdk/constructive-react/src/admin/schema-types.ts +++ b/sdk/constructive-react/src/admin/schema-types.ts @@ -184,19 +184,6 @@ export type OrgOwnerGrantOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; -/** Methods to use when ordering `MembershipType`. */ -export type MembershipTypeOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'NAME_ASC' - | 'NAME_DESC' - | 'DESCRIPTION_ASC' - | 'DESCRIPTION_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC'; /** Methods to use when ordering `AppPermission`. */ export type AppPermissionOrderBy = | 'NATURAL' @@ -242,6 +229,21 @@ export type AppLimitOrderBy = | 'NUM_DESC' | 'MAX_ASC' | 'MAX_DESC'; +/** Methods to use when ordering `MembershipType`. */ +export type MembershipTypeOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; /** Methods to use when ordering `AppAchievement`. */ export type AppAchievementOrderBy = | 'NATURAL' @@ -794,23 +796,6 @@ export interface OrgOwnerGrantFilter { /** Negates the expression. */ not?: OrgOwnerGrantFilter; } -/** A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ */ -export interface MembershipTypeFilter { - /** Filter by the object’s `id` field. */ - id?: IntFilter; - /** Filter by the object’s `name` field. */ - name?: StringFilter; - /** Filter by the object’s `description` field. */ - description?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Checks for all expressions in this list. */ - and?: MembershipTypeFilter[]; - /** Checks for any expressions in this list. */ - or?: MembershipTypeFilter[]; - /** Negates the expression. */ - not?: MembershipTypeFilter; -} /** A filter to be used against `AppPermission` object types. All fields are combined with a logical ‘and.’ */ export interface AppPermissionFilter { /** Filter by the object’s `id` field. */ @@ -868,6 +853,25 @@ export interface AppLimitFilter { /** Negates the expression. */ not?: AppLimitFilter; } +/** A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ */ +export interface MembershipTypeFilter { + /** Filter by the object’s `id` field. */ + id?: IntFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: MembershipTypeFilter[]; + /** Checks for any expressions in this list. */ + or?: MembershipTypeFilter[]; + /** Negates the expression. */ + not?: MembershipTypeFilter; +} /** A filter to be used against `AppAchievement` object types. All fields are combined with a logical ‘and.’ */ export interface AppAchievementFilter { /** Filter by the object’s `id` field. */ @@ -1570,22 +1574,6 @@ export interface OrgOwnerGrantInput { createdAt?: string; updatedAt?: string; } -export interface CreateMembershipTypeInput { - clientMutationId?: string; - /** The `MembershipType` to be created by this mutation. */ - membershipType: MembershipTypeInput; -} -/** An input for mutations affecting `MembershipType` */ -export interface MembershipTypeInput { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** Human-readable name of the membership type */ - name: string; - /** Description of what this membership type represents */ - description: string; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix: string; -} export interface CreateAppPermissionInput { clientMutationId?: string; /** The `AppPermission` to be created by this mutation. */ @@ -1637,6 +1625,24 @@ export interface AppLimitInput { /** Maximum allowed usage; NULL means use the default limit value */ max?: number; } +export interface CreateMembershipTypeInput { + clientMutationId?: string; + /** The `MembershipType` to be created by this mutation. */ + membershipType: MembershipTypeInput; +} +/** An input for mutations affecting `MembershipType` */ +export interface MembershipTypeInput { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** Human-readable name of the membership type */ + name: string; + /** Description of what this membership type represents */ + description: string; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix: string; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean; +} export interface CreateAppAchievementInput { clientMutationId?: string; /** The `AppAchievement` to be created by this mutation. */ @@ -2155,24 +2161,6 @@ export interface OrgOwnerGrantPatch { createdAt?: string; updatedAt?: string; } -export interface UpdateMembershipTypeInput { - clientMutationId?: string; - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** An object where the defined keys will be set on the `MembershipType` being updated. */ - membershipTypePatch: MembershipTypePatch; -} -/** Represents an update to a `MembershipType`. Fields that are set will be updated. */ -export interface MembershipTypePatch { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id?: number; - /** Human-readable name of the membership type */ - name?: string; - /** Description of what this membership type represents */ - description?: string; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix?: string; -} export interface UpdateAppPermissionInput { clientMutationId?: string; id: string; @@ -2227,6 +2215,26 @@ export interface AppLimitPatch { /** Maximum allowed usage; NULL means use the default limit value */ max?: number; } +export interface UpdateMembershipTypeInput { + clientMutationId?: string; + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** An object where the defined keys will be set on the `MembershipType` being updated. */ + membershipTypePatch: MembershipTypePatch; +} +/** Represents an update to a `MembershipType`. Fields that are set will be updated. */ +export interface MembershipTypePatch { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id?: number; + /** Human-readable name of the membership type */ + name?: string; + /** Description of what this membership type represents */ + description?: string; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix?: string; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean; +} export interface UpdateAppAchievementInput { clientMutationId?: string; id: string; @@ -2658,11 +2666,6 @@ export interface DeleteOrgOwnerGrantInput { clientMutationId?: string; id: string; } -export interface DeleteMembershipTypeInput { - clientMutationId?: string; - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; -} export interface DeleteAppPermissionInput { clientMutationId?: string; id: string; @@ -2675,6 +2678,11 @@ export interface DeleteAppLimitInput { clientMutationId?: string; id: string; } +export interface DeleteMembershipTypeInput { + clientMutationId?: string; + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; +} export interface DeleteAppAchievementInput { clientMutationId?: string; id: string; @@ -2861,13 +2869,6 @@ export interface OrgOwnerGrantConnection { pageInfo: PageInfo; totalCount: number; } -/** A connection to a list of `MembershipType` values. */ -export interface MembershipTypeConnection { - nodes: MembershipType[]; - edges: MembershipTypeEdge[]; - pageInfo: PageInfo; - totalCount: number; -} /** A connection to a list of `AppLimit` values. */ export interface AppLimitConnection { nodes: AppLimit[]; @@ -2875,6 +2876,13 @@ export interface AppLimitConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `MembershipType` values. */ +export interface MembershipTypeConnection { + nodes: MembershipType[]; + edges: MembershipTypeEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `AppAchievement` values. */ export interface AppAchievementConnection { nodes: AppAchievement[]; @@ -3053,12 +3061,6 @@ export interface CreateOrgOwnerGrantPayload { orgOwnerGrant?: OrgOwnerGrant | null; orgOwnerGrantEdge?: OrgOwnerGrantEdge | null; } -export interface CreateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was created by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} export interface CreateAppPermissionPayload { clientMutationId?: string | null; /** The `AppPermission` that was created by this mutation. */ @@ -3077,6 +3079,12 @@ export interface CreateAppLimitPayload { appLimit?: AppLimit | null; appLimitEdge?: AppLimitEdge | null; } +export interface CreateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was created by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} export interface CreateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was created by this mutation. */ @@ -3233,12 +3241,6 @@ export interface UpdateOrgOwnerGrantPayload { orgOwnerGrant?: OrgOwnerGrant | null; orgOwnerGrantEdge?: OrgOwnerGrantEdge | null; } -export interface UpdateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was updated by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} export interface UpdateAppPermissionPayload { clientMutationId?: string | null; /** The `AppPermission` that was updated by this mutation. */ @@ -3257,6 +3259,12 @@ export interface UpdateAppLimitPayload { appLimit?: AppLimit | null; appLimitEdge?: AppLimitEdge | null; } +export interface UpdateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was updated by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} export interface UpdateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was updated by this mutation. */ @@ -3413,12 +3421,6 @@ export interface DeleteOrgOwnerGrantPayload { orgOwnerGrant?: OrgOwnerGrant | null; orgOwnerGrantEdge?: OrgOwnerGrantEdge | null; } -export interface DeleteMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was deleted by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} export interface DeleteAppPermissionPayload { clientMutationId?: string | null; /** The `AppPermission` that was deleted by this mutation. */ @@ -3437,6 +3439,12 @@ export interface DeleteAppLimitPayload { appLimit?: AppLimit | null; appLimitEdge?: AppLimitEdge | null; } +export interface DeleteMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was deleted by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} export interface DeleteAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was deleted by this mutation. */ @@ -3668,18 +3676,18 @@ export interface OrgOwnerGrantEdge { /** The `OrgOwnerGrant` at the end of the edge. */ node?: OrgOwnerGrant | null; } -/** A `MembershipType` edge in the connection. */ -export interface MembershipTypeEdge { - cursor?: string | null; - /** The `MembershipType` at the end of the edge. */ - node?: MembershipType | null; -} /** A `AppLimit` edge in the connection. */ export interface AppLimitEdge { cursor?: string | null; /** The `AppLimit` at the end of the edge. */ node?: AppLimit | null; } +/** A `MembershipType` edge in the connection. */ +export interface MembershipTypeEdge { + cursor?: string | null; + /** The `MembershipType` at the end of the edge. */ + node?: MembershipType | null; +} /** A `AppAchievement` edge in the connection. */ export interface AppAchievementEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/admin/types.ts b/sdk/constructive-react/src/admin/types.ts index 3f07dc0f4..415bc28c2 100644 --- a/sdk/constructive-react/src/admin/types.ts +++ b/sdk/constructive-react/src/admin/types.ts @@ -96,12 +96,6 @@ export interface OrgOwnerGrant { createdAt: string | null; updatedAt: string | null; } -export interface MembershipType { - id: number | null; - name: string | null; - description: string | null; - prefix: string | null; -} export interface AppLimit { id: string | null; name: string | null; @@ -109,6 +103,13 @@ export interface AppLimit { num: number | null; max: number | null; } +export interface MembershipType { + id: number | null; + name: string | null; + description: string | null; + prefix: string | null; + hasUsersTableEntry: boolean | null; +} export interface AppAchievement { id: string | null; actorId: string | null; diff --git a/sdk/constructive-react/src/public/README.md b/sdk/constructive-react/src/public/README.md index a8654f857..9f696430d 100644 --- a/sdk/constructive-react/src/public/README.md +++ b/sdk/constructive-react/src/public/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 109 +- **Tables:** 110 - **Custom queries:** 20 - **Custom mutations:** 44 diff --git a/sdk/constructive-react/src/public/hooks/README.md b/sdk/constructive-react/src/public/hooks/README.md index 4d479e832..8c4f40f5f 100644 --- a/sdk/constructive-react/src/public/hooks/README.md +++ b/sdk/constructive-react/src/public/hooks/README.md @@ -548,6 +548,11 @@ function App() { | `useCreateOrgLimitDefaultMutation` | Mutation | Default maximum values for each named limit, applied when no per-actor override exists | | `useUpdateOrgLimitDefaultMutation` | Mutation | Default maximum values for each named limit, applied when no per-actor override exists | | `useDeleteOrgLimitDefaultMutation` | Mutation | Default maximum values for each named limit, applied when no per-actor override exists | +| `useDevicesModulesQuery` | Query | List all devicesModules | +| `useDevicesModuleQuery` | Query | Get one devicesModule | +| `useCreateDevicesModuleMutation` | Mutation | Create a devicesModule | +| `useUpdateDevicesModuleMutation` | Mutation | Update a devicesModule | +| `useDeleteDevicesModuleMutation` | Mutation | Delete a devicesModule | | `useMembershipTypesQuery` | Query | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | | `useMembershipTypeQuery` | Query | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | | `useCreateMembershipTypeMutation` | Mutation | Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) | @@ -2734,25 +2739,46 @@ const { mutate: create } = useCreateOrgLimitDefaultMutation({ create({ name: '', max: '' }); ``` +### DevicesModule + +```typescript +// List all devicesModules +const { data, isLoading } = useDevicesModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }, +}); + +// Get one devicesModule +const { data: item } = useDevicesModuleQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }, +}); + +// Create a devicesModule +const { mutate: create } = useCreateDevicesModuleMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }); +``` + ### MembershipType ```typescript // List all membershipTypes const { data, isLoading } = useMembershipTypesQuery({ - selection: { fields: { id: true, name: true, description: true, prefix: true } }, + selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }, }); // Get one membershipType const { data: item } = useMembershipTypeQuery({ id: '', - selection: { fields: { id: true, name: true, description: true, prefix: true } }, + selection: { fields: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }, }); // Create a membershipType const { mutate: create } = useCreateMembershipTypeMutation({ selection: { fields: { id: true } }, }); -create({ name: '', description: '', prefix: '' }); +create({ name: '', description: '', prefix: '', hasUsersTableEntry: '' }); ``` ### AppMembershipDefault diff --git a/sdk/constructive-react/src/public/hooks/index.ts b/sdk/constructive-react/src/public/hooks/index.ts index 511194e1f..ae22b8eee 100644 --- a/sdk/constructive-react/src/public/hooks/index.ts +++ b/sdk/constructive-react/src/public/hooks/index.ts @@ -2,7 +2,7 @@ * GraphQL SDK * @generated by @constructive-io/graphql-codegen * - * Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, GetAllRecord, Object, AppPermission, OrgPermission, AppLevelRequirement, Database, Schema, Table, CheckConstraint, Field, ForeignKeyConstraint, FullTextSearch, Index, Policy, PrimaryKeyConstraint, TableGrant, Trigger, UniqueConstraint, View, ViewTable, ViewGrant, ViewRule, EmbeddingChunk, TableTemplateModule, SecureTableProvision, RelationProvision, SchemaGrant, DefaultPrivilege, Enum, ApiSchema, ApiModule, Domain, SiteMetadatum, SiteModule, SiteTheme, TriggerFunction, DatabaseTransfer, Api, Site, App, ConnectedAccountsModule, CryptoAddressesModule, CryptoAuthModule, DefaultIdsModule, DenormalizedTableField, EmailsModule, EncryptedSecretsModule, InvitesModule, LevelsModule, LimitsModule, MembershipTypesModule, MembershipsModule, PermissionsModule, PhoneNumbersModule, ProfilesModule, SecretsModule, SessionsModule, UserAuthModule, UsersModule, Blueprint, BlueprintTemplate, BlueprintConstruction, StorageModule, DatabaseProvisionModule, AppAdminGrant, AppOwnerGrant, AppGrant, OrgMembership, OrgMember, OrgAdminGrant, OrgOwnerGrant, OrgGrant, OrgChartEdge, OrgChartEdgeGrant, OrgPermissionDefault, AppLimit, OrgLimit, AppStep, AppAchievement, AppLevel, Email, PhoneNumber, CryptoAddress, ConnectedAccount, AppInvite, AppClaimedInvite, OrgInvite, OrgClaimedInvite, AuditLog, AppPermissionDefault, Ref, Store, RoleType, MigrateFile, AppLimitDefault, OrgLimitDefault, MembershipType, AppMembershipDefault, Commit, RateLimitsModule, OrgMembershipDefault, RlsModule, SqlAction, User, AstMigration, AppMembership, HierarchyModule + * Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, GetAllRecord, Object, AppPermission, OrgPermission, AppLevelRequirement, Database, Schema, Table, CheckConstraint, Field, ForeignKeyConstraint, FullTextSearch, Index, Policy, PrimaryKeyConstraint, TableGrant, Trigger, UniqueConstraint, View, ViewTable, ViewGrant, ViewRule, EmbeddingChunk, TableTemplateModule, SecureTableProvision, RelationProvision, SchemaGrant, DefaultPrivilege, Enum, ApiSchema, ApiModule, Domain, SiteMetadatum, SiteModule, SiteTheme, TriggerFunction, DatabaseTransfer, Api, Site, App, ConnectedAccountsModule, CryptoAddressesModule, CryptoAuthModule, DefaultIdsModule, DenormalizedTableField, EmailsModule, EncryptedSecretsModule, InvitesModule, LevelsModule, LimitsModule, MembershipTypesModule, MembershipsModule, PermissionsModule, PhoneNumbersModule, ProfilesModule, SecretsModule, SessionsModule, UserAuthModule, UsersModule, Blueprint, BlueprintTemplate, BlueprintConstruction, StorageModule, DatabaseProvisionModule, AppAdminGrant, AppOwnerGrant, AppGrant, OrgMembership, OrgMember, OrgAdminGrant, OrgOwnerGrant, OrgGrant, OrgChartEdge, OrgChartEdgeGrant, OrgPermissionDefault, AppLimit, OrgLimit, AppStep, AppAchievement, AppLevel, Email, PhoneNumber, CryptoAddress, ConnectedAccount, AppInvite, AppClaimedInvite, OrgInvite, OrgClaimedInvite, AuditLog, AppPermissionDefault, Ref, Store, RoleType, MigrateFile, AppLimitDefault, OrgLimitDefault, DevicesModule, MembershipType, AppMembershipDefault, Commit, RateLimitsModule, OrgMembershipDefault, RlsModule, SqlAction, User, AstMigration, AppMembership, HierarchyModule * * Usage: * diff --git a/sdk/constructive-react/src/public/hooks/invalidation.ts b/sdk/constructive-react/src/public/hooks/invalidation.ts index 2c0040972..dc7cca23b 100644 --- a/sdk/constructive-react/src/public/hooks/invalidation.ts +++ b/sdk/constructive-react/src/public/hooks/invalidation.ts @@ -113,6 +113,7 @@ import { migrateFileKeys, appLimitDefaultKeys, orgLimitDefaultKeys, + devicesModuleKeys, membershipTypeKeys, appMembershipDefaultKeys, commitKeys, @@ -1733,6 +1734,23 @@ export const invalidate = { queryKey: orgLimitDefaultKeys.detail(id), }), }, + /** Invalidate devicesModule queries */ devicesModule: { + /** Invalidate all devicesModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.all, + }), + /** Invalidate devicesModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.lists(), + }), + /** Invalidate a specific devicesModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.detail(id), + }), + }, /** Invalidate membershipType queries */ membershipType: { /** Invalidate all membershipType queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -2606,6 +2624,14 @@ export const remove = { queryKey: orgLimitDefaultKeys.detail(id), }); }, + /** Remove devicesModule from cache */ devicesModule: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: devicesModuleKeys.detail(id), + }); + }, /** Remove membershipType from cache */ membershipType: ( queryClient: QueryClient, id: string | number diff --git a/sdk/constructive-react/src/public/hooks/mutation-keys.ts b/sdk/constructive-react/src/public/hooks/mutation-keys.ts index 6c7f8bf4e..3004bd37b 100644 --- a/sdk/constructive-react/src/public/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/public/hooks/mutation-keys.ts @@ -887,6 +887,15 @@ export const orgLimitDefaultMutationKeys = { /** Delete orgLimitDefault mutation key */ delete: (id: string | number) => ['mutation', 'orglimitdefault', 'delete', id] as const, } as const; +export const devicesModuleMutationKeys = { + /** All devicesModule mutation keys */ all: ['mutation', 'devicesmodule'] as const, + /** Create devicesModule mutation key */ create: () => + ['mutation', 'devicesmodule', 'create'] as const, + /** Update devicesModule mutation key */ update: (id: string | number) => + ['mutation', 'devicesmodule', 'update', id] as const, + /** Delete devicesModule mutation key */ delete: (id: string | number) => + ['mutation', 'devicesmodule', 'delete', id] as const, +} as const; export const membershipTypeMutationKeys = { /** All membershipType mutation keys */ all: ['mutation', 'membershiptype'] as const, /** Create membershipType mutation key */ create: () => @@ -1288,6 +1297,7 @@ export const mutationKeys = { migrateFile: migrateFileMutationKeys, appLimitDefault: appLimitDefaultMutationKeys, orgLimitDefault: orgLimitDefaultMutationKeys, + devicesModule: devicesModuleMutationKeys, membershipType: membershipTypeMutationKeys, appMembershipDefault: appMembershipDefaultMutationKeys, commit: commitMutationKeys, diff --git a/sdk/constructive-react/src/public/hooks/mutations/index.ts b/sdk/constructive-react/src/public/hooks/mutations/index.ts index 5208ff2b8..58755237e 100644 --- a/sdk/constructive-react/src/public/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/public/hooks/mutations/index.ts @@ -289,6 +289,9 @@ export * from './useDeleteAppLimitDefaultMutation'; export * from './useCreateOrgLimitDefaultMutation'; export * from './useUpdateOrgLimitDefaultMutation'; export * from './useDeleteOrgLimitDefaultMutation'; +export * from './useCreateDevicesModuleMutation'; +export * from './useUpdateDevicesModuleMutation'; +export * from './useDeleteDevicesModuleMutation'; export * from './useCreateMembershipTypeMutation'; export * from './useUpdateMembershipTypeMutation'; export * from './useDeleteMembershipTypeMutation'; diff --git a/sdk/constructive-react/src/public/hooks/mutations/useCreateDevicesModuleMutation.ts b/sdk/constructive-react/src/public/hooks/mutations/useCreateDevicesModuleMutation.ts new file mode 100644 index 000000000..b78a87493 --- /dev/null +++ b/sdk/constructive-react/src/public/hooks/mutations/useCreateDevicesModuleMutation.ts @@ -0,0 +1,88 @@ +/** + * Create mutation hook for DevicesModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { devicesModuleKeys } from '../query-keys'; +import { devicesModuleMutationKeys } from '../mutation-keys'; +import type { + DevicesModuleSelect, + DevicesModuleWithRelations, + CreateDevicesModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DevicesModuleSelect, + DevicesModuleWithRelations, + CreateDevicesModuleInput, +} from '../../orm/input-types'; +/** + * Mutation hook for creating a DevicesModule + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateDevicesModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateDevicesModuleMutation( + params: { + selection: { + fields: S & DevicesModuleSelect; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + CreateDevicesModuleInput['devicesModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + CreateDevicesModuleInput['devicesModule'] +>; +export function useCreateDevicesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: devicesModuleMutationKeys.create(), + mutationFn: (data: CreateDevicesModuleInput['devicesModule']) => + getClient() + .devicesModule.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/public/hooks/mutations/useDeleteDevicesModuleMutation.ts b/sdk/constructive-react/src/public/hooks/mutations/useDeleteDevicesModuleMutation.ts new file mode 100644 index 000000000..873b82119 --- /dev/null +++ b/sdk/constructive-react/src/public/hooks/mutations/useDeleteDevicesModuleMutation.ts @@ -0,0 +1,98 @@ +/** + * Delete mutation hook for DevicesModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { devicesModuleKeys } from '../query-keys'; +import { devicesModuleMutationKeys } from '../mutation-keys'; +import type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; +/** + * Mutation hook for deleting a DevicesModule with typed selection + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteDevicesModuleMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteDevicesModuleMutation( + params: { + selection: { + fields: S & DevicesModuleSelect; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDevicesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: devicesModuleMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .devicesModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: devicesModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/public/hooks/mutations/useUpdateDevicesModuleMutation.ts b/sdk/constructive-react/src/public/hooks/mutations/useUpdateDevicesModuleMutation.ts new file mode 100644 index 000000000..adf244360 --- /dev/null +++ b/sdk/constructive-react/src/public/hooks/mutations/useUpdateDevicesModuleMutation.ts @@ -0,0 +1,116 @@ +/** + * Update mutation hook for DevicesModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { devicesModuleKeys } from '../query-keys'; +import { devicesModuleMutationKeys } from '../mutation-keys'; +import type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModulePatch, +} from '../../orm/input-types'; +/** + * Mutation hook for updating a DevicesModule + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateDevicesModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', devicesModulePatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateDevicesModuleMutation( + params: { + selection: { + fields: S & DevicesModuleSelect; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + devicesModulePatch: DevicesModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + devicesModulePatch: DevicesModulePatch; + } +>; +export function useUpdateDevicesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + devicesModulePatch: DevicesModulePatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: devicesModuleMutationKeys.all, + mutationFn: ({ + id, + devicesModulePatch, + }: { + id: string; + devicesModulePatch: DevicesModulePatch; + }) => + getClient() + .devicesModule.update({ + where: { + id, + }, + data: devicesModulePatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/public/hooks/queries/index.ts b/sdk/constructive-react/src/public/hooks/queries/index.ts index 3804f4a0b..3f6ac6661 100644 --- a/sdk/constructive-react/src/public/hooks/queries/index.ts +++ b/sdk/constructive-react/src/public/hooks/queries/index.ts @@ -196,6 +196,8 @@ export * from './useAppLimitDefaultsQuery'; export * from './useAppLimitDefaultQuery'; export * from './useOrgLimitDefaultsQuery'; export * from './useOrgLimitDefaultQuery'; +export * from './useDevicesModulesQuery'; +export * from './useDevicesModuleQuery'; export * from './useMembershipTypesQuery'; export * from './useMembershipTypeQuery'; export * from './useAppMembershipDefaultsQuery'; diff --git a/sdk/constructive-react/src/public/hooks/queries/useDevicesModuleQuery.ts b/sdk/constructive-react/src/public/hooks/queries/useDevicesModuleQuery.ts new file mode 100644 index 000000000..a33999871 --- /dev/null +++ b/sdk/constructive-react/src/public/hooks/queries/useDevicesModuleQuery.ts @@ -0,0 +1,138 @@ +/** + * Single item query hook for DevicesModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { devicesModuleKeys } from '../query-keys'; +import type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const devicesModuleQueryKey = devicesModuleKeys.detail; +/** + * Query hook for fetching a single DevicesModule + * + * @example + * ```tsx + * const { data, isLoading } = useDevicesModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useDevicesModuleQuery< + S extends DevicesModuleSelect, + TData = { + devicesModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseQueryOptions< + { + devicesModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDevicesModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: devicesModuleKeys.detail(params.id), + queryFn: () => + getClient() + .devicesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Fetch a single DevicesModule without React hooks + * + * @example + * ```ts + * const data = await fetchDevicesModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchDevicesModuleQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DevicesModuleSelect>; +}): Promise<{ + devicesModule: InferSelectResult | null; +}>; +export async function fetchDevicesModuleQuery(params: { + id: string; + selection: SelectionConfig; +}) { + const args = buildSelectionArgs(params.selection); + return getClient() + .devicesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Prefetch a single DevicesModule for SSR or cache warming + * + * @example + * ```ts + * await prefetchDevicesModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchDevicesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DevicesModuleSelect>; + } +): Promise; +export async function prefetchDevicesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: devicesModuleKeys.detail(params.id), + queryFn: () => + getClient() + .devicesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/public/hooks/queries/useDevicesModulesQuery.ts b/sdk/constructive-react/src/public/hooks/queries/useDevicesModulesQuery.ts new file mode 100644 index 000000000..91ea254fa --- /dev/null +++ b/sdk/constructive-react/src/public/hooks/queries/useDevicesModulesQuery.ts @@ -0,0 +1,151 @@ +/** + * List query hook for DevicesModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { devicesModuleKeys } from '../query-keys'; +import type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModuleFilter, + DevicesModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModuleFilter, + DevicesModuleOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const devicesModulesQueryKey = devicesModuleKeys.list; +/** + * Query hook for fetching DevicesModule list + * + * @example + * ```tsx + * const { data, isLoading } = useDevicesModulesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useDevicesModulesQuery< + S extends DevicesModuleSelect, + TData = { + devicesModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseQueryOptions< + { + devicesModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDevicesModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: devicesModuleKeys.list(args), + queryFn: () => getClient().devicesModule.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Fetch DevicesModule list without React hooks + * + * @example + * ```ts + * const data = await fetchDevicesModulesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchDevicesModulesQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DevicesModuleSelect>; +}): Promise<{ + devicesModules: ConnectionResult>; +}>; +export async function fetchDevicesModulesQuery(params: { + selection: ListSelectionConfig; +}) { + const args = buildListSelectionArgs< + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy + >(params.selection); + return getClient().devicesModule.findMany(args).unwrap(); +} +/** + * Prefetch DevicesModule list for SSR or cache warming + * + * @example + * ```ts + * await prefetchDevicesModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchDevicesModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DevicesModuleSelect>; + } +): Promise; +export async function prefetchDevicesModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: devicesModuleKeys.list(args), + queryFn: () => getClient().devicesModule.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/public/hooks/query-keys.ts b/sdk/constructive-react/src/public/hooks/query-keys.ts index ddb21326f..cd2b0c826 100644 --- a/sdk/constructive-react/src/public/hooks/query-keys.ts +++ b/sdk/constructive-react/src/public/hooks/query-keys.ts @@ -901,6 +901,15 @@ export const orgLimitDefaultKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...orgLimitDefaultKeys.details(), id] as const, } as const; +export const devicesModuleKeys = { + /** All devicesModule queries */ all: ['devicesmodule'] as const, + /** List query keys */ lists: () => [...devicesModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...devicesModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...devicesModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...devicesModuleKeys.details(), id] as const, +} as const; export const membershipTypeKeys = { /** All membershipType queries */ all: ['membershiptype'] as const, /** List query keys */ lists: () => [...membershipTypeKeys.all, 'list'] as const, @@ -1167,6 +1176,7 @@ export const queryKeys = { migrateFile: migrateFileKeys, appLimitDefault: appLimitDefaultKeys, orgLimitDefault: orgLimitDefaultKeys, + devicesModule: devicesModuleKeys, membershipType: membershipTypeKeys, appMembershipDefault: appMembershipDefaultKeys, commit: commitKeys, diff --git a/sdk/constructive-react/src/public/orm/README.md b/sdk/constructive-react/src/public/orm/README.md index 9129a2618..2ac3c9bce 100644 --- a/sdk/constructive-react/src/public/orm/README.md +++ b/sdk/constructive-react/src/public/orm/README.md @@ -119,6 +119,7 @@ const db = createClient({ | `migrateFile` | findMany, findOne, create, update, delete | | `appLimitDefault` | findMany, findOne, create, update, delete | | `orgLimitDefault` | findMany, findOne, create, update, delete | +| `devicesModule` | findMany, findOne, create, update, delete | | `membershipType` | findMany, findOne, create, update, delete | | `appMembershipDefault` | findMany, findOne, create, update, delete | | `commit` | findMany, findOne, create, update, delete | @@ -3835,6 +3836,41 @@ const updated = await db.orgLimitDefault.update({ where: { id: '' }, data: const deleted = await db.orgLimitDefault.delete({ where: { id: '' } }).execute(); ``` +### `db.devicesModule` + +CRUD operations for DevicesModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `userDevicesTableId` | UUID | Yes | +| `deviceSettingsTableId` | UUID | Yes | +| `userDevicesTable` | String | Yes | +| `deviceSettingsTable` | String | Yes | + +**Operations:** + +```typescript +// List all devicesModule records +const items = await db.devicesModule.findMany({ select: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }).execute(); + +// Get one by id +const item = await db.devicesModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }).execute(); + +// Create +const created = await db.devicesModule.create({ data: { databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.devicesModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.devicesModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.membershipType` CRUD operations for MembershipType records. @@ -3847,18 +3883,19 @@ CRUD operations for MembershipType records. | `name` | String | Yes | | `description` | String | Yes | | `prefix` | String | Yes | +| `hasUsersTableEntry` | Boolean | Yes | **Operations:** ```typescript // List all membershipType records -const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true } }).execute(); +const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Get one by id -const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true } }).execute(); +const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Create -const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute(); +const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); // Update const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); diff --git a/sdk/constructive-react/src/public/orm/index.ts b/sdk/constructive-react/src/public/orm/index.ts index 0d921879c..951a0775b 100644 --- a/sdk/constructive-react/src/public/orm/index.ts +++ b/sdk/constructive-react/src/public/orm/index.ts @@ -103,6 +103,7 @@ import { RoleTypeModel } from './models/roleType'; import { MigrateFileModel } from './models/migrateFile'; import { AppLimitDefaultModel } from './models/appLimitDefault'; import { OrgLimitDefaultModel } from './models/orgLimitDefault'; +import { DevicesModuleModel } from './models/devicesModule'; import { MembershipTypeModel } from './models/membershipType'; import { AppMembershipDefaultModel } from './models/appMembershipDefault'; import { CommitModel } from './models/commit'; @@ -247,6 +248,7 @@ export function createClient(config: OrmClientConfig) { migrateFile: new MigrateFileModel(client), appLimitDefault: new AppLimitDefaultModel(client), orgLimitDefault: new OrgLimitDefaultModel(client), + devicesModule: new DevicesModuleModel(client), membershipType: new MembershipTypeModel(client), appMembershipDefault: new AppMembershipDefaultModel(client), commit: new CommitModel(client), diff --git a/sdk/constructive-react/src/public/orm/input-types.ts b/sdk/constructive-react/src/public/orm/input-types.ts index 60b4df70c..1d3e435ae 100644 --- a/sdk/constructive-react/src/public/orm/input-types.ts +++ b/sdk/constructive-react/src/public/orm/input-types.ts @@ -1821,6 +1821,15 @@ export interface OrgLimitDefault { /** Default maximum usage allowed for this limit */ max?: number | null; } +export interface DevicesModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + userDevicesTableId?: string | null; + deviceSettingsTableId?: string | null; + userDevicesTable?: string | null; + deviceSettingsTable?: string | null; +} /** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ export interface MembershipType { /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ @@ -1831,6 +1840,8 @@ export interface MembershipType { description?: string | null; /** Short prefix used to namespace tables and functions for this membership scope */ prefix?: string | null; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean | null; } /** Default membership settings per entity, controlling initial approval and verification state for new members */ export interface AppMembershipDefault { @@ -2025,6 +2036,7 @@ export interface DatabaseRelations { rlsModule?: RlsModule | null; hierarchyModule?: HierarchyModule | null; rateLimitsModule?: RateLimitsModule | null; + devicesModule?: DevicesModule | null; schemas?: ConnectionResult; tables?: ConnectionResult
; checkConstraints?: ConnectionResult; @@ -2548,6 +2560,12 @@ export interface RoleTypeRelations {} export interface MigrateFileRelations {} export interface AppLimitDefaultRelations {} export interface OrgLimitDefaultRelations {} +export interface DevicesModuleRelations { + database?: Database | null; + deviceSettingsTableByDeviceSettingsTableId?: Table | null; + schema?: Schema | null; + userDevicesTableByUserDevicesTableId?: Table | null; +} export interface MembershipTypeRelations {} export interface AppMembershipDefaultRelations {} export interface CommitRelations {} @@ -2750,6 +2768,7 @@ export type RoleTypeWithRelations = RoleType & RoleTypeRelations; export type MigrateFileWithRelations = MigrateFile & MigrateFileRelations; export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRelations; export type OrgLimitDefaultWithRelations = OrgLimitDefault & OrgLimitDefaultRelations; +export type DevicesModuleWithRelations = DevicesModule & DevicesModuleRelations; export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations; @@ -2831,6 +2850,9 @@ export type DatabaseSelect = { rateLimitsModule?: { select: RateLimitsModuleSelect; }; + devicesModule?: { + select: DevicesModuleSelect; + }; schemas?: { select: SchemaSelect; first?: number; @@ -5265,11 +5287,33 @@ export type OrgLimitDefaultSelect = { name?: boolean; max?: boolean; }; +export type DevicesModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + userDevicesTableId?: boolean; + deviceSettingsTableId?: boolean; + userDevicesTable?: boolean; + deviceSettingsTable?: boolean; + database?: { + select: DatabaseSelect; + }; + deviceSettingsTableByDeviceSettingsTableId?: { + select: TableSelect; + }; + schema?: { + select: SchemaSelect; + }; + userDevicesTableByUserDevicesTableId?: { + select: TableSelect; + }; +}; export type MembershipTypeSelect = { id?: boolean; name?: boolean; description?: boolean; prefix?: boolean; + hasUsersTableEntry?: boolean; }; export type AppMembershipDefaultSelect = { id?: boolean; @@ -6132,6 +6176,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -9417,6 +9465,36 @@ export interface OrgLimitDefaultFilter { /** Negates the expression. */ not?: OrgLimitDefaultFilter; } +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} export interface MembershipTypeFilter { /** Filter by the object’s `id` field. */ id?: IntFilter; @@ -9426,6 +9504,8 @@ export interface MembershipTypeFilter { description?: StringFilter; /** Filter by the object’s `prefix` field. */ prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; /** Checks for all expressions in this list. */ and?: MembershipTypeFilter[]; /** Checks for any expressions in this list. */ @@ -12301,6 +12381,24 @@ export type OrgLimitDefaultOrderBy = | 'NAME_DESC' | 'MAX_ASC' | 'MAX_DESC'; +export type DevicesModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_ASC' + | 'USER_DEVICES_TABLE_DESC' + | 'DEVICE_SETTINGS_TABLE_ASC' + | 'DEVICE_SETTINGS_TABLE_DESC'; export type MembershipTypeOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -12312,7 +12410,9 @@ export type MembershipTypeOrderBy = | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'PREFIX_ASC' - | 'PREFIX_DESC'; + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; export type AppMembershipDefaultOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -15713,18 +15813,48 @@ export interface DeleteOrgLimitDefaultInput { clientMutationId?: string; id: string; } +export interface CreateDevicesModuleInput { + clientMutationId?: string; + devicesModule: { + databaseId: string; + schemaId?: string; + userDevicesTableId?: string; + deviceSettingsTableId?: string; + userDevicesTable?: string; + deviceSettingsTable?: string; + }; +} +export interface DevicesModulePatch { + databaseId?: string | null; + schemaId?: string | null; + userDevicesTableId?: string | null; + deviceSettingsTableId?: string | null; + userDevicesTable?: string | null; + deviceSettingsTable?: string | null; +} +export interface UpdateDevicesModuleInput { + clientMutationId?: string; + id: string; + devicesModulePatch: DevicesModulePatch; +} +export interface DeleteDevicesModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateMembershipTypeInput { clientMutationId?: string; membershipType: { name: string; description: string; prefix: string; + hasUsersTableEntry?: boolean; }; } export interface MembershipTypePatch { name?: string | null; description?: string | null; prefix?: string | null; + hasUsersTableEntry?: boolean | null; } export interface UpdateMembershipTypeInput { clientMutationId?: string; @@ -21053,6 +21183,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -22500,6 +22634,37 @@ export interface RateLimitsModuleFilter { /** Filter by the object’s `schema` relation. */ schema?: SchemaFilter; } +/** A filter to be used against `DevicesModule` object types. All fields are combined with a logical ‘and.’ */ +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} /** A filter to be used against BitString fields. All fields are combined with a logical ‘and.’ */ export interface BitStringFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -27364,6 +27529,51 @@ export type DeleteOrgLimitDefaultPayloadSelect = { select: OrgLimitDefaultEdgeSelect; }; }; +export interface CreateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was created by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type CreateDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; +export interface UpdateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was updated by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type UpdateDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; +export interface DeleteDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was deleted by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type DeleteDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; export interface CreateMembershipTypePayload { clientMutationId?: string | null; /** The `MembershipType` that was created by this mutation. */ @@ -29042,6 +29252,18 @@ export type OrgLimitDefaultEdgeSelect = { select: OrgLimitDefaultSelect; }; }; +/** A `DevicesModule` edge in the connection. */ +export interface DevicesModuleEdge { + cursor?: string | null; + /** The `DevicesModule` at the end of the edge. */ + node?: DevicesModule | null; +} +export type DevicesModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: DevicesModuleSelect; + }; +}; /** A `MembershipType` edge in the connection. */ export interface MembershipTypeEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/public/orm/models/devicesModule.ts b/sdk/constructive-react/src/public/orm/models/devicesModule.ts new file mode 100644 index 000000000..11386e4fe --- /dev/null +++ b/sdk/constructive-react/src/public/orm/models/devicesModule.ts @@ -0,0 +1,237 @@ +/** + * DevicesModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + DevicesModule, + DevicesModuleWithRelations, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, + CreateDevicesModuleInput, + UpdateDevicesModuleInput, + DevicesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class DevicesModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModules: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModules: { + nodes: InferSelectResult[]; + }; + }> { + const { document, variables } = buildFindFirstDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + }, + 'DevicesModuleFilter', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', + document, + variables, + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', + document, + variables, + transform: (data: { + devicesModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'DevicesModule', + 'createDevicesModule', + 'devicesModule', + args.select, + args.data, + 'CreateDevicesModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'createDevicesModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + DevicesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'DevicesModule', + 'updateDevicesModule', + 'devicesModule', + args.select, + args.where.id, + args.data, + 'UpdateDevicesModuleInput', + 'id', + 'devicesModulePatch', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'updateDevicesModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'DevicesModule', + 'deleteDevicesModule', + 'devicesModule', + { + id: args.where.id, + }, + 'DeleteDevicesModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'deleteDevicesModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/public/orm/models/index.ts b/sdk/constructive-react/src/public/orm/models/index.ts index 0eacaeee7..19ede4ef0 100644 --- a/sdk/constructive-react/src/public/orm/models/index.ts +++ b/sdk/constructive-react/src/public/orm/models/index.ts @@ -101,6 +101,7 @@ export { RoleTypeModel } from './roleType'; export { MigrateFileModel } from './migrateFile'; export { AppLimitDefaultModel } from './appLimitDefault'; export { OrgLimitDefaultModel } from './orgLimitDefault'; +export { DevicesModuleModel } from './devicesModule'; export { MembershipTypeModel } from './membershipType'; export { AppMembershipDefaultModel } from './appMembershipDefault'; export { CommitModel } from './commit'; diff --git a/sdk/constructive-react/src/public/schema-types.ts b/sdk/constructive-react/src/public/schema-types.ts index 31aea28f3..625b6b6de 100644 --- a/sdk/constructive-react/src/public/schema-types.ts +++ b/sdk/constructive-react/src/public/schema-types.ts @@ -42,6 +42,7 @@ import type { DefaultIdsModule, DefaultPrivilege, DenormalizedTableField, + DevicesModule, Domain, Email, EmailsModule, @@ -2445,19 +2446,25 @@ export type OrgLimitDefaultOrderBy = | 'NAME_DESC' | 'MAX_ASC' | 'MAX_DESC'; -/** Methods to use when ordering `MembershipType`. */ -export type MembershipTypeOrderBy = +/** Methods to use when ordering `DevicesModule`. */ +export type DevicesModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' - | 'NAME_ASC' - | 'NAME_DESC' - | 'DESCRIPTION_ASC' - | 'DESCRIPTION_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC'; + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_ASC' + | 'USER_DEVICES_TABLE_DESC' + | 'DEVICE_SETTINGS_TABLE_ASC' + | 'DEVICE_SETTINGS_TABLE_DESC'; /** Methods to use when ordering `Object`. */ export type ObjectOrderBy = | 'NATURAL' @@ -2507,6 +2514,21 @@ export type OrgPermissionOrderBy = | 'BITSTR_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC'; +/** Methods to use when ordering `MembershipType`. */ +export type MembershipTypeOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; /** Methods to use when ordering `AppMembershipDefault`. */ export type AppMembershipDefaultOrderBy = | 'NATURAL' @@ -3136,6 +3158,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -8432,6 +8458,37 @@ export interface RateLimitsModuleFilter { /** Filter by the object’s `schema` relation. */ schema?: SchemaFilter; } +/** A filter to be used against `DevicesModule` object types. All fields are combined with a logical ‘and.’ */ +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} /** A filter to be used against many `DatabaseProvisionModule` object types. All fields are combined with a logical ‘and.’ */ export interface DatabaseToManyDatabaseProvisionModuleFilter { /** Filters to entities where at least one related entity matches. */ @@ -8613,23 +8670,6 @@ export interface OrgLimitDefaultFilter { /** Negates the expression. */ not?: OrgLimitDefaultFilter; } -/** A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ */ -export interface MembershipTypeFilter { - /** Filter by the object’s `id` field. */ - id?: IntFilter; - /** Filter by the object’s `name` field. */ - name?: StringFilter; - /** Filter by the object’s `description` field. */ - description?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Checks for all expressions in this list. */ - and?: MembershipTypeFilter[]; - /** Checks for any expressions in this list. */ - or?: MembershipTypeFilter[]; - /** Negates the expression. */ - not?: MembershipTypeFilter; -} /** A filter to be used against `Object` object types. All fields are combined with a logical ‘and.’ */ export interface ObjectFilter { /** Filter by the object’s `id` field. */ @@ -8691,6 +8731,25 @@ export interface OrgPermissionFilter { /** Negates the expression. */ not?: OrgPermissionFilter; } +/** A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ */ +export interface MembershipTypeFilter { + /** Filter by the object’s `id` field. */ + id?: IntFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: MembershipTypeFilter[]; + /** Checks for any expressions in this list. */ + or?: MembershipTypeFilter[]; + /** Negates the expression. */ + not?: MembershipTypeFilter; +} /** A filter to be used against `AppMembershipDefault` object types. All fields are combined with a logical ‘and.’ */ export interface AppMembershipDefaultFilter { /** Filter by the object’s `id` field. */ @@ -9494,6 +9553,21 @@ export interface ConnectedAccountsModuleInput { ownerTableId?: string; tableName: string; } +export interface CreateDevicesModuleInput { + clientMutationId?: string; + /** The `DevicesModule` to be created by this mutation. */ + devicesModule: DevicesModuleInput; +} +/** An input for mutations affecting `DevicesModule` */ +export interface DevicesModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + userDevicesTableId?: string; + deviceSettingsTableId?: string; + userDevicesTable?: string; + deviceSettingsTable?: string; +} export interface CreateEmailsModuleInput { clientMutationId?: string; /** The `EmailsModule` to be created by this mutation. */ @@ -9593,22 +9667,6 @@ export interface CryptoAddressInput { createdAt?: string; updatedAt?: string; } -export interface CreateMembershipTypeInput { - clientMutationId?: string; - /** The `MembershipType` to be created by this mutation. */ - membershipType: MembershipTypeInput; -} -/** An input for mutations affecting `MembershipType` */ -export interface MembershipTypeInput { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** Human-readable name of the membership type */ - name: string; - /** Description of what this membership type represents */ - description: string; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix: string; -} export interface CreateObjectInput { clientMutationId?: string; /** The `Object` to be created by this mutation. */ @@ -9747,6 +9805,24 @@ export interface AppLimitInput { /** Maximum allowed usage; NULL means use the default limit value */ max?: number; } +export interface CreateMembershipTypeInput { + clientMutationId?: string; + /** The `MembershipType` to be created by this mutation. */ + membershipType: MembershipTypeInput; +} +/** An input for mutations affecting `MembershipType` */ +export interface MembershipTypeInput { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** Human-readable name of the membership type */ + name: string; + /** Description of what this membership type represents */ + description: string; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix: string; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean; +} export interface CreateAppAchievementInput { clientMutationId?: string; /** The `AppAchievement` to be created by this mutation. */ @@ -11828,6 +11904,22 @@ export interface ConnectedAccountsModulePatch { ownerTableId?: string; tableName?: string; } +export interface UpdateDevicesModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `DevicesModule` being updated. */ + devicesModulePatch: DevicesModulePatch; +} +/** Represents an update to a `DevicesModule`. Fields that are set will be updated. */ +export interface DevicesModulePatch { + id?: string; + databaseId?: string; + schemaId?: string; + userDevicesTableId?: string; + deviceSettingsTableId?: string; + userDevicesTable?: string; + deviceSettingsTable?: string; +} export interface UpdateEmailsModuleInput { clientMutationId?: string; id: string; @@ -11933,24 +12025,6 @@ export interface CryptoAddressPatch { createdAt?: string; updatedAt?: string; } -export interface UpdateMembershipTypeInput { - clientMutationId?: string; - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** An object where the defined keys will be set on the `MembershipType` being updated. */ - membershipTypePatch: MembershipTypePatch; -} -/** Represents an update to a `MembershipType`. Fields that are set will be updated. */ -export interface MembershipTypePatch { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id?: number; - /** Human-readable name of the membership type */ - name?: string; - /** Description of what this membership type represents */ - description?: string; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix?: string; -} export interface UpdateObjectInput { clientMutationId?: string; id: string; @@ -12098,6 +12172,26 @@ export interface AppLimitPatch { /** Maximum allowed usage; NULL means use the default limit value */ max?: number; } +export interface UpdateMembershipTypeInput { + clientMutationId?: string; + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** An object where the defined keys will be set on the `MembershipType` being updated. */ + membershipTypePatch: MembershipTypePatch; +} +/** Represents an update to a `MembershipType`. Fields that are set will be updated. */ +export interface MembershipTypePatch { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id?: number; + /** Human-readable name of the membership type */ + name?: string; + /** Description of what this membership type represents */ + description?: string; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix?: string; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean; +} export interface UpdateAppAchievementInput { clientMutationId?: string; id: string; @@ -13926,6 +14020,10 @@ export interface DeleteConnectedAccountsModuleInput { clientMutationId?: string; id: string; } +export interface DeleteDevicesModuleInput { + clientMutationId?: string; + id: string; +} export interface DeleteEmailsModuleInput { clientMutationId?: string; id: string; @@ -13950,11 +14048,6 @@ export interface DeleteCryptoAddressInput { clientMutationId?: string; id: string; } -export interface DeleteMembershipTypeInput { - clientMutationId?: string; - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; -} export interface DeleteObjectInput { clientMutationId?: string; id: string; @@ -13988,6 +14081,11 @@ export interface DeleteAppLimitInput { clientMutationId?: string; id: string; } +export interface DeleteMembershipTypeInput { + clientMutationId?: string; + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; +} export interface DeleteAppAchievementInput { clientMutationId?: string; id: string; @@ -14506,6 +14604,13 @@ export interface ConnectedAccountsModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `DevicesModule` values. */ +export interface DevicesModuleConnection { + nodes: DevicesModule[]; + edges: DevicesModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `EmailsModule` values. */ export interface EmailsModuleConnection { nodes: EmailsModule[]; @@ -14548,13 +14653,6 @@ export interface CryptoAddressConnection { pageInfo: PageInfo; totalCount: number; } -/** A connection to a list of `MembershipType` values. */ -export interface MembershipTypeConnection { - nodes: MembershipType[]; - edges: MembershipTypeEdge[]; - pageInfo: PageInfo; - totalCount: number; -} /** A connection to a list of `Database` values. */ export interface DatabaseConnection { nodes: Database[]; @@ -14590,6 +14688,13 @@ export interface AppLimitConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `MembershipType` values. */ +export interface MembershipTypeConnection { + nodes: MembershipType[]; + edges: MembershipTypeEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `AppAchievement` values. */ export interface AppAchievementConnection { nodes: AppAchievement[]; @@ -15352,6 +15457,12 @@ export interface CreateConnectedAccountsModulePayload { connectedAccountsModule?: ConnectedAccountsModule | null; connectedAccountsModuleEdge?: ConnectedAccountsModuleEdge | null; } +export interface CreateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was created by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} export interface CreateEmailsModulePayload { clientMutationId?: string | null; /** The `EmailsModule` that was created by this mutation. */ @@ -15388,12 +15499,6 @@ export interface CreateCryptoAddressPayload { cryptoAddress?: CryptoAddress | null; cryptoAddressEdge?: CryptoAddressEdge | null; } -export interface CreateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was created by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} export interface CreateObjectPayload { clientMutationId?: string | null; /** The `Object` that was created by this mutation. */ @@ -15442,6 +15547,12 @@ export interface CreateAppLimitPayload { appLimit?: AppLimit | null; appLimitEdge?: AppLimitEdge | null; } +export interface CreateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was created by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} export interface CreateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was created by this mutation. */ @@ -15980,6 +16091,12 @@ export interface UpdateConnectedAccountsModulePayload { connectedAccountsModule?: ConnectedAccountsModule | null; connectedAccountsModuleEdge?: ConnectedAccountsModuleEdge | null; } +export interface UpdateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was updated by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} export interface UpdateEmailsModulePayload { clientMutationId?: string | null; /** The `EmailsModule` that was updated by this mutation. */ @@ -16016,12 +16133,6 @@ export interface UpdateCryptoAddressPayload { cryptoAddress?: CryptoAddress | null; cryptoAddressEdge?: CryptoAddressEdge | null; } -export interface UpdateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was updated by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} export interface UpdateObjectPayload { clientMutationId?: string | null; /** The `Object` that was updated by this mutation. */ @@ -16070,6 +16181,12 @@ export interface UpdateAppLimitPayload { appLimit?: AppLimit | null; appLimitEdge?: AppLimitEdge | null; } +export interface UpdateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was updated by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} export interface UpdateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was updated by this mutation. */ @@ -16598,6 +16715,12 @@ export interface DeleteConnectedAccountsModulePayload { connectedAccountsModule?: ConnectedAccountsModule | null; connectedAccountsModuleEdge?: ConnectedAccountsModuleEdge | null; } +export interface DeleteDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was deleted by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} export interface DeleteEmailsModulePayload { clientMutationId?: string | null; /** The `EmailsModule` that was deleted by this mutation. */ @@ -16634,12 +16757,6 @@ export interface DeleteCryptoAddressPayload { cryptoAddress?: CryptoAddress | null; cryptoAddressEdge?: CryptoAddressEdge | null; } -export interface DeleteMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was deleted by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} export interface DeleteObjectPayload { clientMutationId?: string | null; /** The `Object` that was deleted by this mutation. */ @@ -16688,6 +16805,12 @@ export interface DeleteAppLimitPayload { appLimit?: AppLimit | null; appLimitEdge?: AppLimitEdge | null; } +export interface DeleteMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was deleted by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} export interface DeleteAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was deleted by this mutation. */ @@ -17309,6 +17432,12 @@ export interface ConnectedAccountsModuleEdge { /** The `ConnectedAccountsModule` at the end of the edge. */ node?: ConnectedAccountsModule | null; } +/** A `DevicesModule` edge in the connection. */ +export interface DevicesModuleEdge { + cursor?: string | null; + /** The `DevicesModule` at the end of the edge. */ + node?: DevicesModule | null; +} /** A `EmailsModule` edge in the connection. */ export interface EmailsModuleEdge { cursor?: string | null; @@ -17345,12 +17474,6 @@ export interface CryptoAddressEdge { /** The `CryptoAddress` at the end of the edge. */ node?: CryptoAddress | null; } -/** A `MembershipType` edge in the connection. */ -export interface MembershipTypeEdge { - cursor?: string | null; - /** The `MembershipType` at the end of the edge. */ - node?: MembershipType | null; -} /** A `Database` edge in the connection. */ export interface DatabaseEdge { cursor?: string | null; @@ -17381,6 +17504,12 @@ export interface AppLimitEdge { /** The `AppLimit` at the end of the edge. */ node?: AppLimit | null; } +/** A `MembershipType` edge in the connection. */ +export interface MembershipTypeEdge { + cursor?: string | null; + /** The `MembershipType` at the end of the edge. */ + node?: MembershipType | null; +} /** A `AppAchievement` edge in the connection. */ export interface AppAchievementEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/public/types.ts b/sdk/constructive-react/src/public/types.ts index 7492bc87f..eb7ad48d9 100644 --- a/sdk/constructive-react/src/public/types.ts +++ b/sdk/constructive-react/src/public/types.ts @@ -1165,11 +1165,21 @@ export interface OrgLimitDefault { name: string | null; max: number | null; } +export interface DevicesModule { + id: string | null; + databaseId: string | null; + schemaId: string | null; + userDevicesTableId: string | null; + deviceSettingsTableId: string | null; + userDevicesTable: string | null; + deviceSettingsTable: string | null; +} export interface MembershipType { id: number | null; name: string | null; description: string | null; prefix: string | null; + hasUsersTableEntry: boolean | null; } export interface AppMembershipDefault { id: string | null; diff --git a/sdk/constructive-sdk/schemas/admin.graphql b/sdk/constructive-sdk/schemas/admin.graphql index c6dce4f61..0d4f71c38 100644 --- a/sdk/constructive-sdk/schemas/admin.graphql +++ b/sdk/constructive-sdk/schemas/admin.graphql @@ -1352,94 +1352,6 @@ enum OrgOwnerGrantOrderBy { UPDATED_AT_DESC } -"""A connection to a list of `MembershipType` values.""" -type MembershipTypeConnection { - """A list of `MembershipType` objects.""" - nodes: [MembershipType]! - - """ - A list of edges which contains the `MembershipType` and cursor to aid in pagination. - """ - edges: [MembershipTypeEdge]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! - - """The count of *all* `MembershipType` you could get from the connection.""" - totalCount: Int! -} - -""" -Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) -""" -type MembershipType { - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! - - """Human-readable name of the membership type""" - name: String! - - """Description of what this membership type represents""" - description: String! - - """ - Short prefix used to namespace tables and functions for this membership scope - """ - prefix: String! -} - -"""A `MembershipType` edge in the connection.""" -type MembershipTypeEdge { - """A cursor for use in pagination.""" - cursor: Cursor - - """The `MembershipType` at the end of the edge.""" - node: MembershipType -} - -""" -A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ -""" -input MembershipTypeFilter { - """Filter by the object’s `id` field.""" - id: IntFilter - - """Filter by the object’s `name` field.""" - name: StringFilter - - """Filter by the object’s `description` field.""" - description: StringFilter - - """Filter by the object’s `prefix` field.""" - prefix: StringFilter - - """Checks for all expressions in this list.""" - and: [MembershipTypeFilter!] - - """Checks for any expressions in this list.""" - or: [MembershipTypeFilter!] - - """Negates the expression.""" - not: MembershipTypeFilter -} - -"""Methods to use when ordering `MembershipType`.""" -enum MembershipTypeOrderBy { - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - ID_ASC - ID_DESC - NAME_ASC - NAME_DESC - DESCRIPTION_ASC - DESCRIPTION_DESC - PREFIX_ASC - PREFIX_DESC -} - """ A filter to be used against `AppPermission` object types. All fields are combined with a logical ‘and.’ """ @@ -1621,6 +1533,104 @@ enum AppLimitOrderBy { MAX_DESC } +"""A connection to a list of `MembershipType` values.""" +type MembershipTypeConnection { + """A list of `MembershipType` objects.""" + nodes: [MembershipType]! + + """ + A list of edges which contains the `MembershipType` and cursor to aid in pagination. + """ + edges: [MembershipTypeEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `MembershipType` you could get from the connection.""" + totalCount: Int! +} + +""" +Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) +""" +type MembershipType { + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! + + """Human-readable name of the membership type""" + name: String! + + """Description of what this membership type represents""" + description: String! + + """ + Short prefix used to namespace tables and functions for this membership scope + """ + prefix: String! + + """ + When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs + """ + hasUsersTableEntry: Boolean! +} + +"""A `MembershipType` edge in the connection.""" +type MembershipTypeEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `MembershipType` at the end of the edge.""" + node: MembershipType +} + +""" +A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ +""" +input MembershipTypeFilter { + """Filter by the object’s `id` field.""" + id: IntFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `prefix` field.""" + prefix: StringFilter + + """Filter by the object’s `hasUsersTableEntry` field.""" + hasUsersTableEntry: BooleanFilter + + """Checks for all expressions in this list.""" + and: [MembershipTypeFilter!] + + """Checks for any expressions in this list.""" + or: [MembershipTypeFilter!] + + """Negates the expression.""" + not: MembershipTypeFilter +} + +"""Methods to use when ordering `MembershipType`.""" +enum MembershipTypeOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + NAME_ASC + NAME_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + PREFIX_ASC + PREFIX_DESC + HAS_USERS_TABLE_ENTRY_ASC + HAS_USERS_TABLE_ENTRY_DESC +} + """A connection to a list of `AppAchievement` values.""" type AppAchievementConnection { """A list of `AppAchievement` objects.""" @@ -4406,60 +4416,6 @@ input OrgOwnerGrantInput { updatedAt: Datetime } -"""The output of our create `MembershipType` mutation.""" -type CreateMembershipTypePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `MembershipType` that was created by this mutation.""" - membershipType: MembershipType - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MembershipType`. May be used by Relay 1.""" - membershipTypeEdge( - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] - ): MembershipTypeEdge -} - -"""All input for the create `MembershipType` mutation.""" -input CreateMembershipTypeInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """The `MembershipType` to be created by this mutation.""" - membershipType: MembershipTypeInput! -} - -"""An input for mutations affecting `MembershipType`""" -input MembershipTypeInput { - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! - - """Human-readable name of the membership type""" - name: String! - - """Description of what this membership type represents""" - description: String! - - """ - Short prefix used to namespace tables and functions for this membership scope - """ - prefix: String! -} - """The output of our create `AppPermission` mutation.""" type CreateAppPermissionPayload { """ @@ -4624,6 +4580,65 @@ input AppLimitInput { max: Int } +"""The output of our create `MembershipType` mutation.""" +type CreateMembershipTypePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `MembershipType` that was created by this mutation.""" + membershipType: MembershipType + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MembershipType`. May be used by Relay 1.""" + membershipTypeEdge( + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] + ): MembershipTypeEdge +} + +"""All input for the create `MembershipType` mutation.""" +input CreateMembershipTypeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `MembershipType` to be created by this mutation.""" + membershipType: MembershipTypeInput! +} + +"""An input for mutations affecting `MembershipType`""" +input MembershipTypeInput { + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! + + """Human-readable name of the membership type""" + name: String! + + """Description of what this membership type represents""" + description: String! + + """ + Short prefix used to namespace tables and functions for this membership scope + """ + prefix: String! + + """ + When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs + """ + hasUsersTableEntry: Boolean +} + """The output of our create `AppAchievement` mutation.""" type CreateAppAchievementPayload { """ @@ -6095,84 +6110,21 @@ input UpdateOrgOwnerGrantInput { """ Represents an update to a `OrgOwnerGrant`. Fields that are set will be updated. -""" -input OrgOwnerGrantPatch { - id: UUID - - """True to grant ownership, false to revoke ownership""" - isGrant: Boolean - - """The member receiving or losing the ownership grant""" - actorId: UUID - - """The entity (org or group) this ownership grant applies to""" - entityId: UUID - grantorId: UUID - createdAt: Datetime - updatedAt: Datetime -} - -"""The output of our update `MembershipType` mutation.""" -type UpdateMembershipTypePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `MembershipType` that was updated by this mutation.""" - membershipType: MembershipType - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MembershipType`. May be used by Relay 1.""" - membershipTypeEdge( - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] - ): MembershipTypeEdge -} - -"""All input for the `updateMembershipType` mutation.""" -input UpdateMembershipTypeInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! - - """ - An object where the defined keys will be set on the `MembershipType` being updated. - """ - membershipTypePatch: MembershipTypePatch! -} - -""" -Represents an update to a `MembershipType`. Fields that are set will be updated. -""" -input MembershipTypePatch { - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int +""" +input OrgOwnerGrantPatch { + id: UUID - """Human-readable name of the membership type""" - name: String + """True to grant ownership, false to revoke ownership""" + isGrant: Boolean - """Description of what this membership type represents""" - description: String + """The member receiving or losing the ownership grant""" + actorId: UUID - """ - Short prefix used to namespace tables and functions for this membership scope - """ - prefix: String + """The entity (org or group) this ownership grant applies to""" + entityId: UUID + grantorId: UUID + createdAt: Datetime + updatedAt: Datetime } """The output of our update `AppPermission` mutation.""" @@ -6354,6 +6306,74 @@ input AppLimitPatch { max: Int } +"""The output of our update `MembershipType` mutation.""" +type UpdateMembershipTypePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `MembershipType` that was updated by this mutation.""" + membershipType: MembershipType + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MembershipType`. May be used by Relay 1.""" + membershipTypeEdge( + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] + ): MembershipTypeEdge +} + +"""All input for the `updateMembershipType` mutation.""" +input UpdateMembershipTypeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! + + """ + An object where the defined keys will be set on the `MembershipType` being updated. + """ + membershipTypePatch: MembershipTypePatch! +} + +""" +Represents an update to a `MembershipType`. Fields that are set will be updated. +""" +input MembershipTypePatch { + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int + + """Human-readable name of the membership type""" + name: String + + """Description of what this membership type represents""" + description: String + + """ + Short prefix used to namespace tables and functions for this membership scope + """ + prefix: String + + """ + When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs + """ + hasUsersTableEntry: Boolean +} + """The output of our update `AppAchievement` mutation.""" type UpdateAppAchievementPayload { """ @@ -7753,43 +7773,6 @@ input DeleteOrgOwnerGrantInput { id: UUID! } -"""The output of our delete `MembershipType` mutation.""" -type DeleteMembershipTypePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `MembershipType` that was deleted by this mutation.""" - membershipType: MembershipType - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MembershipType`. May be used by Relay 1.""" - membershipTypeEdge( - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] - ): MembershipTypeEdge -} - -"""All input for the `deleteMembershipType` mutation.""" -input DeleteMembershipTypeInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! -} - """The output of our delete `AppPermission` mutation.""" type DeleteAppPermissionPayload { """ @@ -7889,6 +7872,43 @@ input DeleteAppLimitInput { id: UUID! } +"""The output of our delete `MembershipType` mutation.""" +type DeleteMembershipTypePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `MembershipType` that was deleted by this mutation.""" + membershipType: MembershipType + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MembershipType`. May be used by Relay 1.""" + membershipTypeEdge( + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] + ): MembershipTypeEdge +} + +"""All input for the `deleteMembershipType` mutation.""" +input DeleteMembershipTypeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! +} + """The output of our delete `AppAchievement` mutation.""" type DeleteAppAchievementPayload { """ @@ -8864,8 +8884,8 @@ type Query { orderBy: [OrgOwnerGrantOrderBy!] = [PRIMARY_KEY_ASC] ): OrgOwnerGrantConnection - """Reads and enables pagination through a set of `MembershipType`.""" - membershipTypes( + """Reads and enables pagination through a set of `AppPermission`.""" + appPermissions( """Only read the first `n` values of the set.""" first: Int @@ -8887,14 +8907,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: MembershipTypeFilter + where: AppPermissionFilter - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!] = [PRIMARY_KEY_ASC] - ): MembershipTypeConnection + """The method to use when ordering `AppPermission`.""" + orderBy: [AppPermissionOrderBy!] = [PRIMARY_KEY_ASC] + ): AppPermissionConnection - """Reads and enables pagination through a set of `AppPermission`.""" - appPermissions( + """Reads and enables pagination through a set of `OrgPermission`.""" + orgPermissions( """Only read the first `n` values of the set.""" first: Int @@ -8916,14 +8936,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: AppPermissionFilter + where: OrgPermissionFilter - """The method to use when ordering `AppPermission`.""" - orderBy: [AppPermissionOrderBy!] = [PRIMARY_KEY_ASC] - ): AppPermissionConnection + """The method to use when ordering `OrgPermission`.""" + orderBy: [OrgPermissionOrderBy!] = [PRIMARY_KEY_ASC] + ): OrgPermissionConnection - """Reads and enables pagination through a set of `OrgPermission`.""" - orgPermissions( + """Reads and enables pagination through a set of `AppLimit`.""" + appLimits( """Only read the first `n` values of the set.""" first: Int @@ -8945,14 +8965,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: OrgPermissionFilter + where: AppLimitFilter - """The method to use when ordering `OrgPermission`.""" - orderBy: [OrgPermissionOrderBy!] = [PRIMARY_KEY_ASC] - ): OrgPermissionConnection + """The method to use when ordering `AppLimit`.""" + orderBy: [AppLimitOrderBy!] = [PRIMARY_KEY_ASC] + ): AppLimitConnection - """Reads and enables pagination through a set of `AppLimit`.""" - appLimits( + """Reads and enables pagination through a set of `MembershipType`.""" + membershipTypes( """Only read the first `n` values of the set.""" first: Int @@ -8974,11 +8994,11 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: AppLimitFilter + where: MembershipTypeFilter - """The method to use when ordering `AppLimit`.""" - orderBy: [AppLimitOrderBy!] = [PRIMARY_KEY_ASC] - ): AppLimitConnection + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!] = [PRIMARY_KEY_ASC] + ): MembershipTypeConnection """Reads and enables pagination through a set of `AppAchievement`.""" appAchievements( @@ -9568,14 +9588,6 @@ type Mutation { input: CreateOrgOwnerGrantInput! ): CreateOrgOwnerGrantPayload - """Creates a single `MembershipType`.""" - createMembershipType( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateMembershipTypeInput! - ): CreateMembershipTypePayload - """Creates a single `AppPermission`.""" createAppPermission( """ @@ -9600,6 +9612,14 @@ type Mutation { input: CreateAppLimitInput! ): CreateAppLimitPayload + """Creates a single `MembershipType`.""" + createMembershipType( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateMembershipTypeInput! + ): CreateMembershipTypePayload + """Creates a single `AppAchievement`.""" createAppAchievement( """ @@ -9812,14 +9832,6 @@ type Mutation { input: UpdateOrgOwnerGrantInput! ): UpdateOrgOwnerGrantPayload - """Updates a single `MembershipType` using a unique key and a patch.""" - updateMembershipType( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateMembershipTypeInput! - ): UpdateMembershipTypePayload - """Updates a single `AppPermission` using a unique key and a patch.""" updateAppPermission( """ @@ -9844,6 +9856,14 @@ type Mutation { input: UpdateAppLimitInput! ): UpdateAppLimitPayload + """Updates a single `MembershipType` using a unique key and a patch.""" + updateMembershipType( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateMembershipTypeInput! + ): UpdateMembershipTypePayload + """Updates a single `AppAchievement` using a unique key and a patch.""" updateAppAchievement( """ @@ -10056,14 +10076,6 @@ type Mutation { input: DeleteOrgOwnerGrantInput! ): DeleteOrgOwnerGrantPayload - """Deletes a single `MembershipType` using a unique key.""" - deleteMembershipType( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteMembershipTypeInput! - ): DeleteMembershipTypePayload - """Deletes a single `AppPermission` using a unique key.""" deleteAppPermission( """ @@ -10088,6 +10100,14 @@ type Mutation { input: DeleteAppLimitInput! ): DeleteAppLimitPayload + """Deletes a single `MembershipType` using a unique key.""" + deleteMembershipType( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteMembershipTypeInput! + ): DeleteMembershipTypePayload + """Deletes a single `AppAchievement` using a unique key.""" deleteAppAchievement( """ diff --git a/sdk/constructive-sdk/schemas/public.graphql b/sdk/constructive-sdk/schemas/public.graphql index dae3c91f2..f705220f5 100644 --- a/sdk/constructive-sdk/schemas/public.graphql +++ b/sdk/constructive-sdk/schemas/public.graphql @@ -3400,6 +3400,9 @@ type Database { """Reads a single `RateLimitsModule` that is related to this `Database`.""" rateLimitsModule: RateLimitsModule + """Reads a single `DevicesModule` that is related to this `Database`.""" + devicesModule: DevicesModule + """ Reads and enables pagination through a set of `DatabaseProvisionModule`. """ @@ -5293,6 +5296,12 @@ input DatabaseFilter { """A related `rateLimitsModule` exists.""" rateLimitsModuleExists: Boolean + """Filter by the object’s `devicesModule` relation.""" + devicesModule: DevicesModuleFilter + + """A related `devicesModule` exists.""" + devicesModuleExists: Boolean + """Filter by the object’s `databaseProvisionModules` relation.""" databaseProvisionModules: DatabaseToManyDatabaseProvisionModuleFilter @@ -13739,6 +13748,57 @@ input RateLimitsModuleFilter { schema: SchemaFilter } +""" +A filter to be used against `DevicesModule` object types. All fields are combined with a logical ‘and.’ +""" +input DevicesModuleFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `schemaId` field.""" + schemaId: UUIDFilter + + """Filter by the object’s `userDevicesTableId` field.""" + userDevicesTableId: UUIDFilter + + """Filter by the object’s `deviceSettingsTableId` field.""" + deviceSettingsTableId: UUIDFilter + + """Filter by the object’s `userDevicesTable` field.""" + userDevicesTable: StringFilter + + """Filter by the object’s `deviceSettingsTable` field.""" + deviceSettingsTable: StringFilter + + """Checks for all expressions in this list.""" + and: [DevicesModuleFilter!] + + """Checks for any expressions in this list.""" + or: [DevicesModuleFilter!] + + """Negates the expression.""" + not: DevicesModuleFilter + + """Filter by the object’s `database` relation.""" + database: DatabaseFilter + + """ + Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. + """ + deviceSettingsTableByDeviceSettingsTableId: TableFilter + + """Filter by the object’s `schema` relation.""" + schema: SchemaFilter + + """ + Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. + """ + userDevicesTableByUserDevicesTableId: TableFilter +} + """ A filter to be used against many `DatabaseProvisionModule` object types. All fields are combined with a logical ‘and.’ """ @@ -19568,6 +19628,28 @@ type RateLimitsModule { schema: Schema } +type DevicesModule { + id: UUID! + databaseId: UUID! + schemaId: UUID! + userDevicesTableId: UUID! + deviceSettingsTableId: UUID! + userDevicesTable: String! + deviceSettingsTable: String! + + """Reads a single `Database` that is related to this `DevicesModule`.""" + database: Database + + """Reads a single `Table` that is related to this `DevicesModule`.""" + deviceSettingsTableByDeviceSettingsTableId: Table + + """Reads a single `Schema` that is related to this `DevicesModule`.""" + schema: Schema + + """Reads a single `Table` that is related to this `DevicesModule`.""" + userDevicesTableByUserDevicesTableId: Table +} + """A connection to a list of `DatabaseProvisionModule` values.""" type DatabaseProvisionModuleConnection { """A list of `DatabaseProvisionModule` objects.""" @@ -22252,92 +22334,51 @@ enum OrgLimitDefaultOrderBy { MAX_DESC } -"""A connection to a list of `MembershipType` values.""" -type MembershipTypeConnection { - """A list of `MembershipType` objects.""" - nodes: [MembershipType]! +"""A connection to a list of `DevicesModule` values.""" +type DevicesModuleConnection { + """A list of `DevicesModule` objects.""" + nodes: [DevicesModule]! """ - A list of edges which contains the `MembershipType` and cursor to aid in pagination. + A list of edges which contains the `DevicesModule` and cursor to aid in pagination. """ - edges: [MembershipTypeEdge]! + edges: [DevicesModuleEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! - """The count of *all* `MembershipType` you could get from the connection.""" + """The count of *all* `DevicesModule` you could get from the connection.""" totalCount: Int! } -""" -Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) -""" -type MembershipType { - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! - - """Human-readable name of the membership type""" - name: String! - - """Description of what this membership type represents""" - description: String! - - """ - Short prefix used to namespace tables and functions for this membership scope - """ - prefix: String! -} - -"""A `MembershipType` edge in the connection.""" -type MembershipTypeEdge { +"""A `DevicesModule` edge in the connection.""" +type DevicesModuleEdge { """A cursor for use in pagination.""" cursor: Cursor - """The `MembershipType` at the end of the edge.""" - node: MembershipType + """The `DevicesModule` at the end of the edge.""" + node: DevicesModule } -""" -A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ -""" -input MembershipTypeFilter { - """Filter by the object’s `id` field.""" - id: IntFilter - - """Filter by the object’s `name` field.""" - name: StringFilter - - """Filter by the object’s `description` field.""" - description: StringFilter - - """Filter by the object’s `prefix` field.""" - prefix: StringFilter - - """Checks for all expressions in this list.""" - and: [MembershipTypeFilter!] - - """Checks for any expressions in this list.""" - or: [MembershipTypeFilter!] - - """Negates the expression.""" - not: MembershipTypeFilter -} - -"""Methods to use when ordering `MembershipType`.""" -enum MembershipTypeOrderBy { +"""Methods to use when ordering `DevicesModule`.""" +enum DevicesModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC ID_ASC ID_DESC - NAME_ASC - NAME_DESC - DESCRIPTION_ASC - DESCRIPTION_DESC - PREFIX_ASC - PREFIX_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + SCHEMA_ID_ASC + SCHEMA_ID_DESC + USER_DEVICES_TABLE_ID_ASC + USER_DEVICES_TABLE_ID_DESC + DEVICE_SETTINGS_TABLE_ID_ASC + DEVICE_SETTINGS_TABLE_ID_DESC + USER_DEVICES_TABLE_ASC + USER_DEVICES_TABLE_DESC + DEVICE_SETTINGS_TABLE_ASC + DEVICE_SETTINGS_TABLE_DESC } """ @@ -22488,6 +22529,104 @@ enum OrgPermissionOrderBy { DESCRIPTION_DESC } +"""A connection to a list of `MembershipType` values.""" +type MembershipTypeConnection { + """A list of `MembershipType` objects.""" + nodes: [MembershipType]! + + """ + A list of edges which contains the `MembershipType` and cursor to aid in pagination. + """ + edges: [MembershipTypeEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `MembershipType` you could get from the connection.""" + totalCount: Int! +} + +""" +Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) +""" +type MembershipType { + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! + + """Human-readable name of the membership type""" + name: String! + + """Description of what this membership type represents""" + description: String! + + """ + Short prefix used to namespace tables and functions for this membership scope + """ + prefix: String! + + """ + When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs + """ + hasUsersTableEntry: Boolean! +} + +"""A `MembershipType` edge in the connection.""" +type MembershipTypeEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `MembershipType` at the end of the edge.""" + node: MembershipType +} + +""" +A filter to be used against `MembershipType` object types. All fields are combined with a logical ‘and.’ +""" +input MembershipTypeFilter { + """Filter by the object’s `id` field.""" + id: IntFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `prefix` field.""" + prefix: StringFilter + + """Filter by the object’s `hasUsersTableEntry` field.""" + hasUsersTableEntry: BooleanFilter + + """Checks for all expressions in this list.""" + and: [MembershipTypeFilter!] + + """Checks for any expressions in this list.""" + or: [MembershipTypeFilter!] + + """Negates the expression.""" + not: MembershipTypeFilter +} + +"""Methods to use when ordering `MembershipType`.""" +enum MembershipTypeOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + NAME_ASC + NAME_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + PREFIX_ASC + PREFIX_DESC + HAS_USERS_TABLE_ENTRY_ASC + HAS_USERS_TABLE_ENTRY_DESC +} + """A connection to a list of `AppMembershipDefault` values.""" type AppMembershipDefaultConnection { """A list of `AppMembershipDefault` objects.""" @@ -25970,6 +26109,52 @@ input ConnectedAccountsModuleInput { tableName: String! } +"""The output of our create `DevicesModule` mutation.""" +type CreateDevicesModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `DevicesModule` that was created by this mutation.""" + devicesModule: DevicesModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `DevicesModule`. May be used by Relay 1.""" + devicesModuleEdge( + """The method to use when ordering `DevicesModule`.""" + orderBy: [DevicesModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): DevicesModuleEdge +} + +"""All input for the create `DevicesModule` mutation.""" +input CreateDevicesModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `DevicesModule` to be created by this mutation.""" + devicesModule: DevicesModuleInput! +} + +"""An input for mutations affecting `DevicesModule`""" +input DevicesModuleInput { + id: UUID + databaseId: UUID! + schemaId: UUID + userDevicesTableId: UUID + deviceSettingsTableId: UUID + userDevicesTable: String + deviceSettingsTable: String +} + """The output of our create `EmailsModule` mutation.""" type CreateEmailsModulePayload { """ @@ -26266,60 +26451,6 @@ input CryptoAddressInput { updatedAt: Datetime } -"""The output of our create `MembershipType` mutation.""" -type CreateMembershipTypePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `MembershipType` that was created by this mutation.""" - membershipType: MembershipType - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MembershipType`. May be used by Relay 1.""" - membershipTypeEdge( - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] - ): MembershipTypeEdge -} - -"""All input for the create `MembershipType` mutation.""" -input CreateMembershipTypeInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """The `MembershipType` to be created by this mutation.""" - membershipType: MembershipTypeInput! -} - -"""An input for mutations affecting `MembershipType`""" -input MembershipTypeInput { - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! - - """Human-readable name of the membership type""" - name: String! - - """Description of what this membership type represents""" - description: String! - - """ - Short prefix used to namespace tables and functions for this membership scope - """ - prefix: String! -} - """The output of our create `Object` mutation.""" type CreateObjectPayload { """ @@ -26734,6 +26865,65 @@ input AppLimitInput { max: Int } +"""The output of our create `MembershipType` mutation.""" +type CreateMembershipTypePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `MembershipType` that was created by this mutation.""" + membershipType: MembershipType + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MembershipType`. May be used by Relay 1.""" + membershipTypeEdge( + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] + ): MembershipTypeEdge +} + +"""All input for the create `MembershipType` mutation.""" +input CreateMembershipTypeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `MembershipType` to be created by this mutation.""" + membershipType: MembershipTypeInput! +} + +"""An input for mutations affecting `MembershipType`""" +input MembershipTypeInput { + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! + + """Human-readable name of the membership type""" + name: String! + + """Description of what this membership type represents""" + description: String! + + """ + Short prefix used to namespace tables and functions for this membership scope + """ + prefix: String! + + """ + When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs + """ + hasUsersTableEntry: Boolean +} + """The output of our create `AppAchievement` mutation.""" type CreateAppAchievementPayload { """ @@ -32104,6 +32294,57 @@ input ConnectedAccountsModulePatch { tableName: String } +"""The output of our update `DevicesModule` mutation.""" +type UpdateDevicesModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `DevicesModule` that was updated by this mutation.""" + devicesModule: DevicesModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `DevicesModule`. May be used by Relay 1.""" + devicesModuleEdge( + """The method to use when ordering `DevicesModule`.""" + orderBy: [DevicesModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): DevicesModuleEdge +} + +"""All input for the `updateDevicesModule` mutation.""" +input UpdateDevicesModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `DevicesModule` being updated. + """ + devicesModulePatch: DevicesModulePatch! +} + +""" +Represents an update to a `DevicesModule`. Fields that are set will be updated. +""" +input DevicesModulePatch { + id: UUID + databaseId: UUID + schemaId: UUID + userDevicesTableId: UUID + deviceSettingsTableId: UUID + userDevicesTable: String + deviceSettingsTable: String +} + """The output of our update `EmailsModule` mutation.""" type UpdateEmailsModulePayload { """ @@ -32430,69 +32671,6 @@ input CryptoAddressPatch { updatedAt: Datetime } -"""The output of our update `MembershipType` mutation.""" -type UpdateMembershipTypePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `MembershipType` that was updated by this mutation.""" - membershipType: MembershipType - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MembershipType`. May be used by Relay 1.""" - membershipTypeEdge( - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] - ): MembershipTypeEdge -} - -"""All input for the `updateMembershipType` mutation.""" -input UpdateMembershipTypeInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! - - """ - An object where the defined keys will be set on the `MembershipType` being updated. - """ - membershipTypePatch: MembershipTypePatch! -} - -""" -Represents an update to a `MembershipType`. Fields that are set will be updated. -""" -input MembershipTypePatch { - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int - - """Human-readable name of the membership type""" - name: String - - """Description of what this membership type represents""" - description: String - - """ - Short prefix used to namespace tables and functions for this membership scope - """ - prefix: String -} - """The output of our update `Object` mutation.""" type UpdateObjectPayload { """ @@ -32948,6 +33126,74 @@ input AppLimitPatch { max: Int } +"""The output of our update `MembershipType` mutation.""" +type UpdateMembershipTypePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `MembershipType` that was updated by this mutation.""" + membershipType: MembershipType + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MembershipType`. May be used by Relay 1.""" + membershipTypeEdge( + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] + ): MembershipTypeEdge +} + +"""All input for the `updateMembershipType` mutation.""" +input UpdateMembershipTypeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! + + """ + An object where the defined keys will be set on the `MembershipType` being updated. + """ + membershipTypePatch: MembershipTypePatch! +} + +""" +Represents an update to a `MembershipType`. Fields that are set will be updated. +""" +input MembershipTypePatch { + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int + + """Human-readable name of the membership type""" + name: String + + """Description of what this membership type represents""" + description: String + + """ + Short prefix used to namespace tables and functions for this membership scope + """ + prefix: String + + """ + When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs + """ + hasUsersTableEntry: Boolean +} + """The output of our update `AppAchievement` mutation.""" type UpdateAppAchievementPayload { """ @@ -38081,6 +38327,39 @@ input DeleteConnectedAccountsModuleInput { id: UUID! } +"""The output of our delete `DevicesModule` mutation.""" +type DeleteDevicesModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `DevicesModule` that was deleted by this mutation.""" + devicesModule: DevicesModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `DevicesModule`. May be used by Relay 1.""" + devicesModuleEdge( + """The method to use when ordering `DevicesModule`.""" + orderBy: [DevicesModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): DevicesModuleEdge +} + +"""All input for the `deleteDevicesModule` mutation.""" +input DeleteDevicesModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + """The output of our delete `EmailsModule` mutation.""" type DeleteEmailsModulePayload { """ @@ -38279,43 +38558,6 @@ input DeleteCryptoAddressInput { id: UUID! } -"""The output of our delete `MembershipType` mutation.""" -type DeleteMembershipTypePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `MembershipType` that was deleted by this mutation.""" - membershipType: MembershipType - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MembershipType`. May be used by Relay 1.""" - membershipTypeEdge( - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] - ): MembershipTypeEdge -} - -"""All input for the `deleteMembershipType` mutation.""" -input DeleteMembershipTypeInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """ - Integer identifier for the membership type (1=App, 2=Organization, 3=Group) - """ - id: Int! -} - """The output of our delete `Object` mutation.""" type DeleteObjectPayload { """ @@ -38581,6 +38823,43 @@ input DeleteAppLimitInput { id: UUID! } +"""The output of our delete `MembershipType` mutation.""" +type DeleteMembershipTypePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `MembershipType` that was deleted by this mutation.""" + membershipType: MembershipType + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MembershipType`. May be used by Relay 1.""" + membershipTypeEdge( + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!]! = [PRIMARY_KEY_ASC] + ): MembershipTypeEdge +} + +"""All input for the `deleteMembershipType` mutation.""" +input DeleteMembershipTypeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """ + Integer identifier for the membership type (1=App, 2=Organization, 3=Group) + """ + id: Int! +} + """The output of our delete `AppAchievement` mutation.""" type DeleteAppAchievementPayload { """ @@ -41657,6 +41936,35 @@ type Query { orderBy: [ConnectedAccountsModuleOrderBy!] = [PRIMARY_KEY_ASC] ): ConnectedAccountsModuleConnection + """Reads and enables pagination through a set of `DevicesModule`.""" + devicesModules( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: DevicesModuleFilter + + """The method to use when ordering `DevicesModule`.""" + orderBy: [DevicesModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): DevicesModuleConnection + """Reads and enables pagination through a set of `EmailsModule`.""" emailsModules( """Only read the first `n` values of the set.""" @@ -41831,35 +42139,6 @@ type Query { orderBy: [CryptoAddressOrderBy!] = [PRIMARY_KEY_ASC] ): CryptoAddressConnection - """Reads and enables pagination through a set of `MembershipType`.""" - membershipTypes( - """Only read the first `n` values of the set.""" - first: Int - - """Only read the last `n` values of the set.""" - last: Int - - """ - Skip the first `n` values from our `after` cursor, an alternative to cursor - based pagination. May not be used with `last`. - """ - offset: Int - - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: MembershipTypeFilter - - """The method to use when ordering `MembershipType`.""" - orderBy: [MembershipTypeOrderBy!] = [PRIMARY_KEY_ASC] - ): MembershipTypeConnection - """Reads and enables pagination through a set of `Object`.""" objects( """Only read the first `n` values of the set.""" @@ -42092,6 +42371,35 @@ type Query { orderBy: [AppLimitOrderBy!] = [PRIMARY_KEY_ASC] ): AppLimitConnection + """Reads and enables pagination through a set of `MembershipType`.""" + membershipTypes( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: MembershipTypeFilter + + """The method to use when ordering `MembershipType`.""" + orderBy: [MembershipTypeOrderBy!] = [PRIMARY_KEY_ASC] + ): MembershipTypeConnection + """Reads and enables pagination through a set of `AppAchievement`.""" appAchievements( """Only read the first `n` values of the set.""" @@ -44455,6 +44763,14 @@ type Mutation { input: CreateConnectedAccountsModuleInput! ): CreateConnectedAccountsModulePayload + """Creates a single `DevicesModule`.""" + createDevicesModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateDevicesModuleInput! + ): CreateDevicesModulePayload + """Creates a single `EmailsModule`.""" createEmailsModule( """ @@ -44503,14 +44819,6 @@ type Mutation { input: CreateCryptoAddressInput! ): CreateCryptoAddressPayload - """Creates a single `MembershipType`.""" - createMembershipType( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateMembershipTypeInput! - ): CreateMembershipTypePayload - """Creates a single `Object`.""" createObject( """ @@ -44575,6 +44883,14 @@ type Mutation { input: CreateAppLimitInput! ): CreateAppLimitPayload + """Creates a single `MembershipType`.""" + createMembershipType( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateMembershipTypeInput! + ): CreateMembershipTypePayload + """Creates a single `AppAchievement`.""" createAppAchievement( """ @@ -45305,6 +45621,14 @@ type Mutation { input: UpdateConnectedAccountsModuleInput! ): UpdateConnectedAccountsModulePayload + """Updates a single `DevicesModule` using a unique key and a patch.""" + updateDevicesModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateDevicesModuleInput! + ): UpdateDevicesModulePayload + """Updates a single `EmailsModule` using a unique key and a patch.""" updateEmailsModule( """ @@ -45353,14 +45677,6 @@ type Mutation { input: UpdateCryptoAddressInput! ): UpdateCryptoAddressPayload - """Updates a single `MembershipType` using a unique key and a patch.""" - updateMembershipType( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateMembershipTypeInput! - ): UpdateMembershipTypePayload - """Updates a single `Object` using a unique key and a patch.""" updateObject( """ @@ -45427,6 +45743,14 @@ type Mutation { input: UpdateAppLimitInput! ): UpdateAppLimitPayload + """Updates a single `MembershipType` using a unique key and a patch.""" + updateMembershipType( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateMembershipTypeInput! + ): UpdateMembershipTypePayload + """Updates a single `AppAchievement` using a unique key and a patch.""" updateAppAchievement( """ @@ -46147,6 +46471,14 @@ type Mutation { input: DeleteConnectedAccountsModuleInput! ): DeleteConnectedAccountsModulePayload + """Deletes a single `DevicesModule` using a unique key.""" + deleteDevicesModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteDevicesModuleInput! + ): DeleteDevicesModulePayload + """Deletes a single `EmailsModule` using a unique key.""" deleteEmailsModule( """ @@ -46195,14 +46527,6 @@ type Mutation { input: DeleteCryptoAddressInput! ): DeleteCryptoAddressPayload - """Deletes a single `MembershipType` using a unique key.""" - deleteMembershipType( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteMembershipTypeInput! - ): DeleteMembershipTypePayload - """Deletes a single `Object` using a unique key.""" deleteObject( """ @@ -46267,6 +46591,14 @@ type Mutation { input: DeleteAppLimitInput! ): DeleteAppLimitPayload + """Deletes a single `MembershipType` using a unique key.""" + deleteMembershipType( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteMembershipTypeInput! + ): DeleteMembershipTypePayload + """Deletes a single `AppAchievement` using a unique key.""" deleteAppAchievement( """ diff --git a/sdk/constructive-sdk/src/admin/orm/README.md b/sdk/constructive-sdk/src/admin/orm/README.md index bb7c574ae..98a72fe8b 100644 --- a/sdk/constructive-sdk/src/admin/orm/README.md +++ b/sdk/constructive-sdk/src/admin/orm/README.md @@ -35,8 +35,8 @@ const db = createClient({ | `orgLimitDefault` | findMany, findOne, create, update, delete | | `orgAdminGrant` | findMany, findOne, create, update, delete | | `orgOwnerGrant` | findMany, findOne, create, update, delete | -| `membershipType` | findMany, findOne, create, update, delete | | `appLimit` | findMany, findOne, create, update, delete | +| `membershipType` | findMany, findOne, create, update, delete | | `appAchievement` | findMany, findOne, create, update, delete | | `appStep` | findMany, findOne, create, update, delete | | `appClaimedInvite` | findMany, findOne, create, update, delete | @@ -511,69 +511,70 @@ const updated = await db.orgOwnerGrant.update({ where: { id: '' }, data: { const deleted = await db.orgOwnerGrant.delete({ where: { id: '' } }).execute(); ``` -### `db.membershipType` +### `db.appLimit` -CRUD operations for MembershipType records. +CRUD operations for AppLimit records. **Fields:** | Field | Type | Editable | |-------|------|----------| -| `id` | Int | No | +| `id` | UUID | No | | `name` | String | Yes | -| `description` | String | Yes | -| `prefix` | String | Yes | +| `actorId` | UUID | Yes | +| `num` | Int | Yes | +| `max` | Int | Yes | **Operations:** ```typescript -// List all membershipType records -const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true } }).execute(); +// List all appLimit records +const items = await db.appLimit.findMany({ select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); // Get one by id -const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true } }).execute(); +const item = await db.appLimit.findOne({ id: '', select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); // Create -const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute(); +const created = await db.appLimit.create({ data: { name: '', actorId: '', num: '', max: '' }, select: { id: true } }).execute(); // Update -const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); +const updated = await db.appLimit.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.membershipType.delete({ where: { id: '' } }).execute(); +const deleted = await db.appLimit.delete({ where: { id: '' } }).execute(); ``` -### `db.appLimit` +### `db.membershipType` -CRUD operations for AppLimit records. +CRUD operations for MembershipType records. **Fields:** | Field | Type | Editable | |-------|------|----------| -| `id` | UUID | No | +| `id` | Int | No | | `name` | String | Yes | -| `actorId` | UUID | Yes | -| `num` | Int | Yes | -| `max` | Int | Yes | +| `description` | String | Yes | +| `prefix` | String | Yes | +| `hasUsersTableEntry` | Boolean | Yes | **Operations:** ```typescript -// List all appLimit records -const items = await db.appLimit.findMany({ select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); +// List all membershipType records +const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Get one by id -const item = await db.appLimit.findOne({ id: '', select: { id: true, name: true, actorId: true, num: true, max: true } }).execute(); +const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Create -const created = await db.appLimit.create({ data: { name: '', actorId: '', num: '', max: '' }, select: { id: true } }).execute(); +const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); // Update -const updated = await db.appLimit.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); +const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.appLimit.delete({ where: { id: '' } }).execute(); +const deleted = await db.membershipType.delete({ where: { id: '' } }).execute(); ``` ### `db.appAchievement` diff --git a/sdk/constructive-sdk/src/admin/orm/index.ts b/sdk/constructive-sdk/src/admin/orm/index.ts index becae9d2a..76969882b 100644 --- a/sdk/constructive-sdk/src/admin/orm/index.ts +++ b/sdk/constructive-sdk/src/admin/orm/index.ts @@ -19,8 +19,8 @@ import { AppLimitDefaultModel } from './models/appLimitDefault'; import { OrgLimitDefaultModel } from './models/orgLimitDefault'; import { OrgAdminGrantModel } from './models/orgAdminGrant'; import { OrgOwnerGrantModel } from './models/orgOwnerGrant'; -import { MembershipTypeModel } from './models/membershipType'; import { AppLimitModel } from './models/appLimit'; +import { MembershipTypeModel } from './models/membershipType'; import { AppAchievementModel } from './models/appAchievement'; import { AppStepModel } from './models/appStep'; import { AppClaimedInviteModel } from './models/appClaimedInvite'; @@ -86,8 +86,8 @@ export function createClient(config: OrmClientConfig) { orgLimitDefault: new OrgLimitDefaultModel(client), orgAdminGrant: new OrgAdminGrantModel(client), orgOwnerGrant: new OrgOwnerGrantModel(client), - membershipType: new MembershipTypeModel(client), appLimit: new AppLimitModel(client), + membershipType: new MembershipTypeModel(client), appAchievement: new AppAchievementModel(client), appStep: new AppStepModel(client), appClaimedInvite: new AppClaimedInviteModel(client), diff --git a/sdk/constructive-sdk/src/admin/orm/input-types.ts b/sdk/constructive-sdk/src/admin/orm/input-types.ts index 66dd2861c..5ff064f0c 100644 --- a/sdk/constructive-sdk/src/admin/orm/input-types.ts +++ b/sdk/constructive-sdk/src/admin/orm/input-types.ts @@ -370,17 +370,6 @@ export interface OrgOwnerGrant { createdAt?: string | null; updatedAt?: string | null; } -/** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ -export interface MembershipType { - /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ - id: number; - /** Human-readable name of the membership type */ - name?: string | null; - /** Description of what this membership type represents */ - description?: string | null; - /** Short prefix used to namespace tables and functions for this membership scope */ - prefix?: string | null; -} /** Tracks per-actor usage counts against configurable maximum limits */ export interface AppLimit { id: string; @@ -393,6 +382,19 @@ export interface AppLimit { /** Maximum allowed usage; NULL means use the default limit value */ max?: number | null; } +/** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ +export interface MembershipType { + /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ + id: number; + /** Human-readable name of the membership type */ + name?: string | null; + /** Description of what this membership type represents */ + description?: string | null; + /** Short prefix used to namespace tables and functions for this membership scope */ + prefix?: string | null; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean | null; +} /** Aggregated user progress for level requirements, tallying the total count; updated via triggers and should not be modified manually */ export interface AppAchievement { id: string; @@ -695,8 +697,8 @@ export interface AppLimitDefaultRelations {} export interface OrgLimitDefaultRelations {} export interface OrgAdminGrantRelations {} export interface OrgOwnerGrantRelations {} -export interface MembershipTypeRelations {} export interface AppLimitRelations {} +export interface MembershipTypeRelations {} export interface AppAchievementRelations {} export interface AppStepRelations {} export interface AppClaimedInviteRelations {} @@ -732,8 +734,8 @@ export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRela export type OrgLimitDefaultWithRelations = OrgLimitDefault & OrgLimitDefaultRelations; export type OrgAdminGrantWithRelations = OrgAdminGrant & OrgAdminGrantRelations; export type OrgOwnerGrantWithRelations = OrgOwnerGrant & OrgOwnerGrantRelations; -export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppLimitWithRelations = AppLimit & AppLimitRelations; +export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppAchievementWithRelations = AppAchievement & AppAchievementRelations; export type AppStepWithRelations = AppStep & AppStepRelations; export type AppClaimedInviteWithRelations = AppClaimedInvite & AppClaimedInviteRelations; @@ -844,12 +846,6 @@ export type OrgOwnerGrantSelect = { createdAt?: boolean; updatedAt?: boolean; }; -export type MembershipTypeSelect = { - id?: boolean; - name?: boolean; - description?: boolean; - prefix?: boolean; -}; export type AppLimitSelect = { id?: boolean; name?: boolean; @@ -857,6 +853,13 @@ export type AppLimitSelect = { num?: boolean; max?: boolean; }; +export type MembershipTypeSelect = { + id?: boolean; + name?: boolean; + description?: boolean; + prefix?: boolean; + hasUsersTableEntry?: boolean; +}; export type AppAchievementSelect = { id?: boolean; actorId?: boolean; @@ -1262,22 +1265,6 @@ export interface OrgOwnerGrantFilter { /** Negates the expression. */ not?: OrgOwnerGrantFilter; } -export interface MembershipTypeFilter { - /** Filter by the object’s `id` field. */ - id?: IntFilter; - /** Filter by the object’s `name` field. */ - name?: StringFilter; - /** Filter by the object’s `description` field. */ - description?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Checks for all expressions in this list. */ - and?: MembershipTypeFilter[]; - /** Checks for any expressions in this list. */ - or?: MembershipTypeFilter[]; - /** Negates the expression. */ - not?: MembershipTypeFilter; -} export interface AppLimitFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -1296,6 +1283,24 @@ export interface AppLimitFilter { /** Negates the expression. */ not?: AppLimitFilter; } +export interface MembershipTypeFilter { + /** Filter by the object’s `id` field. */ + id?: IntFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: MembershipTypeFilter[]; + /** Checks for any expressions in this list. */ + or?: MembershipTypeFilter[]; + /** Negates the expression. */ + not?: MembershipTypeFilter; +} export interface AppAchievementFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -1887,18 +1892,6 @@ export type OrgOwnerGrantOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; -export type MembershipTypeOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'NAME_ASC' - | 'NAME_DESC' - | 'DESCRIPTION_ASC' - | 'DESCRIPTION_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC'; export type AppLimitOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -1913,6 +1906,20 @@ export type AppLimitOrderBy = | 'NUM_DESC' | 'MAX_ASC' | 'MAX_DESC'; +export type MembershipTypeOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; export type AppAchievementOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -2572,28 +2579,6 @@ export interface DeleteOrgOwnerGrantInput { clientMutationId?: string; id: string; } -export interface CreateMembershipTypeInput { - clientMutationId?: string; - membershipType: { - name: string; - description: string; - prefix: string; - }; -} -export interface MembershipTypePatch { - name?: string | null; - description?: string | null; - prefix?: string | null; -} -export interface UpdateMembershipTypeInput { - clientMutationId?: string; - id: number; - membershipTypePatch: MembershipTypePatch; -} -export interface DeleteMembershipTypeInput { - clientMutationId?: string; - id: number; -} export interface CreateAppLimitInput { clientMutationId?: string; appLimit: { @@ -2618,6 +2603,30 @@ export interface DeleteAppLimitInput { clientMutationId?: string; id: string; } +export interface CreateMembershipTypeInput { + clientMutationId?: string; + membershipType: { + name: string; + description: string; + prefix: string; + hasUsersTableEntry?: boolean; + }; +} +export interface MembershipTypePatch { + name?: string | null; + description?: string | null; + prefix?: string | null; + hasUsersTableEntry?: boolean | null; +} +export interface UpdateMembershipTypeInput { + clientMutationId?: string; + id: number; + membershipTypePatch: MembershipTypePatch; +} +export interface DeleteMembershipTypeInput { + clientMutationId?: string; + id: number; +} export interface CreateAppAchievementInput { clientMutationId?: string; appAchievement: { @@ -3884,51 +3893,6 @@ export type DeleteOrgOwnerGrantPayloadSelect = { select: OrgOwnerGrantEdgeSelect; }; }; -export interface CreateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was created by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type CreateMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; -export interface UpdateMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was updated by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type UpdateMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; -export interface DeleteMembershipTypePayload { - clientMutationId?: string | null; - /** The `MembershipType` that was deleted by this mutation. */ - membershipType?: MembershipType | null; - membershipTypeEdge?: MembershipTypeEdge | null; -} -export type DeleteMembershipTypePayloadSelect = { - clientMutationId?: boolean; - membershipType?: { - select: MembershipTypeSelect; - }; - membershipTypeEdge?: { - select: MembershipTypeEdgeSelect; - }; -}; export interface CreateAppLimitPayload { clientMutationId?: string | null; /** The `AppLimit` that was created by this mutation. */ @@ -3974,6 +3938,51 @@ export type DeleteAppLimitPayloadSelect = { select: AppLimitEdgeSelect; }; }; +export interface CreateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was created by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type CreateMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; +export interface UpdateMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was updated by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type UpdateMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; +export interface DeleteMembershipTypePayload { + clientMutationId?: string | null; + /** The `MembershipType` that was deleted by this mutation. */ + membershipType?: MembershipType | null; + membershipTypeEdge?: MembershipTypeEdge | null; +} +export type DeleteMembershipTypePayloadSelect = { + clientMutationId?: boolean; + membershipType?: { + select: MembershipTypeSelect; + }; + membershipTypeEdge?: { + select: MembershipTypeEdgeSelect; + }; +}; export interface CreateAppAchievementPayload { clientMutationId?: string | null; /** The `AppAchievement` that was created by this mutation. */ @@ -4855,18 +4864,6 @@ export type OrgOwnerGrantEdgeSelect = { select: OrgOwnerGrantSelect; }; }; -/** A `MembershipType` edge in the connection. */ -export interface MembershipTypeEdge { - cursor?: string | null; - /** The `MembershipType` at the end of the edge. */ - node?: MembershipType | null; -} -export type MembershipTypeEdgeSelect = { - cursor?: boolean; - node?: { - select: MembershipTypeSelect; - }; -}; /** A `AppLimit` edge in the connection. */ export interface AppLimitEdge { cursor?: string | null; @@ -4879,6 +4876,18 @@ export type AppLimitEdgeSelect = { select: AppLimitSelect; }; }; +/** A `MembershipType` edge in the connection. */ +export interface MembershipTypeEdge { + cursor?: string | null; + /** The `MembershipType` at the end of the edge. */ + node?: MembershipType | null; +} +export type MembershipTypeEdgeSelect = { + cursor?: boolean; + node?: { + select: MembershipTypeSelect; + }; +}; /** A `AppAchievement` edge in the connection. */ export interface AppAchievementEdge { cursor?: string | null; diff --git a/sdk/constructive-sdk/src/admin/orm/models/index.ts b/sdk/constructive-sdk/src/admin/orm/models/index.ts index 91876b01c..a4bd7a8ee 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/index.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/index.ts @@ -17,8 +17,8 @@ export { AppLimitDefaultModel } from './appLimitDefault'; export { OrgLimitDefaultModel } from './orgLimitDefault'; export { OrgAdminGrantModel } from './orgAdminGrant'; export { OrgOwnerGrantModel } from './orgOwnerGrant'; -export { MembershipTypeModel } from './membershipType'; export { AppLimitModel } from './appLimit'; +export { MembershipTypeModel } from './membershipType'; export { AppAchievementModel } from './appAchievement'; export { AppStepModel } from './appStep'; export { AppClaimedInviteModel } from './appClaimedInvite'; diff --git a/sdk/constructive-sdk/src/public/README.md b/sdk/constructive-sdk/src/public/README.md index 7b7f12fca..0a9568855 100644 --- a/sdk/constructive-sdk/src/public/README.md +++ b/sdk/constructive-sdk/src/public/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 109 +- **Tables:** 110 - **Custom queries:** 20 - **Custom mutations:** 44 diff --git a/sdk/constructive-sdk/src/public/orm/README.md b/sdk/constructive-sdk/src/public/orm/README.md index 9129a2618..2ac3c9bce 100644 --- a/sdk/constructive-sdk/src/public/orm/README.md +++ b/sdk/constructive-sdk/src/public/orm/README.md @@ -119,6 +119,7 @@ const db = createClient({ | `migrateFile` | findMany, findOne, create, update, delete | | `appLimitDefault` | findMany, findOne, create, update, delete | | `orgLimitDefault` | findMany, findOne, create, update, delete | +| `devicesModule` | findMany, findOne, create, update, delete | | `membershipType` | findMany, findOne, create, update, delete | | `appMembershipDefault` | findMany, findOne, create, update, delete | | `commit` | findMany, findOne, create, update, delete | @@ -3835,6 +3836,41 @@ const updated = await db.orgLimitDefault.update({ where: { id: '' }, data: const deleted = await db.orgLimitDefault.delete({ where: { id: '' } }).execute(); ``` +### `db.devicesModule` + +CRUD operations for DevicesModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `userDevicesTableId` | UUID | Yes | +| `deviceSettingsTableId` | UUID | Yes | +| `userDevicesTable` | String | Yes | +| `deviceSettingsTable` | String | Yes | + +**Operations:** + +```typescript +// List all devicesModule records +const items = await db.devicesModule.findMany({ select: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }).execute(); + +// Get one by id +const item = await db.devicesModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, userDevicesTableId: true, deviceSettingsTableId: true, userDevicesTable: true, deviceSettingsTable: true } }).execute(); + +// Create +const created = await db.devicesModule.create({ data: { databaseId: '', schemaId: '', userDevicesTableId: '', deviceSettingsTableId: '', userDevicesTable: '', deviceSettingsTable: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.devicesModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.devicesModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.membershipType` CRUD operations for MembershipType records. @@ -3847,18 +3883,19 @@ CRUD operations for MembershipType records. | `name` | String | Yes | | `description` | String | Yes | | `prefix` | String | Yes | +| `hasUsersTableEntry` | Boolean | Yes | **Operations:** ```typescript // List all membershipType records -const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true } }).execute(); +const items = await db.membershipType.findMany({ select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Get one by id -const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true } }).execute(); +const item = await db.membershipType.findOne({ id: '', select: { id: true, name: true, description: true, prefix: true, hasUsersTableEntry: true } }).execute(); // Create -const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '' }, select: { id: true } }).execute(); +const created = await db.membershipType.create({ data: { name: '', description: '', prefix: '', hasUsersTableEntry: '' }, select: { id: true } }).execute(); // Update const updated = await db.membershipType.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); diff --git a/sdk/constructive-sdk/src/public/orm/index.ts b/sdk/constructive-sdk/src/public/orm/index.ts index 0d921879c..951a0775b 100644 --- a/sdk/constructive-sdk/src/public/orm/index.ts +++ b/sdk/constructive-sdk/src/public/orm/index.ts @@ -103,6 +103,7 @@ import { RoleTypeModel } from './models/roleType'; import { MigrateFileModel } from './models/migrateFile'; import { AppLimitDefaultModel } from './models/appLimitDefault'; import { OrgLimitDefaultModel } from './models/orgLimitDefault'; +import { DevicesModuleModel } from './models/devicesModule'; import { MembershipTypeModel } from './models/membershipType'; import { AppMembershipDefaultModel } from './models/appMembershipDefault'; import { CommitModel } from './models/commit'; @@ -247,6 +248,7 @@ export function createClient(config: OrmClientConfig) { migrateFile: new MigrateFileModel(client), appLimitDefault: new AppLimitDefaultModel(client), orgLimitDefault: new OrgLimitDefaultModel(client), + devicesModule: new DevicesModuleModel(client), membershipType: new MembershipTypeModel(client), appMembershipDefault: new AppMembershipDefaultModel(client), commit: new CommitModel(client), diff --git a/sdk/constructive-sdk/src/public/orm/input-types.ts b/sdk/constructive-sdk/src/public/orm/input-types.ts index 60b4df70c..1d3e435ae 100644 --- a/sdk/constructive-sdk/src/public/orm/input-types.ts +++ b/sdk/constructive-sdk/src/public/orm/input-types.ts @@ -1821,6 +1821,15 @@ export interface OrgLimitDefault { /** Default maximum usage allowed for this limit */ max?: number | null; } +export interface DevicesModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + userDevicesTableId?: string | null; + deviceSettingsTableId?: string | null; + userDevicesTable?: string | null; + deviceSettingsTable?: string | null; +} /** Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) */ export interface MembershipType { /** Integer identifier for the membership type (1=App, 2=Organization, 3=Group) */ @@ -1831,6 +1840,8 @@ export interface MembershipType { description?: string | null; /** Short prefix used to namespace tables and functions for this membership scope */ prefix?: string | null; + /** When true, entities of this membership type get a one-to-one ID in the users table and a corresponding role_type entry, enabling them to own resources via owner_id FKs */ + hasUsersTableEntry?: boolean | null; } /** Default membership settings per entity, controlling initial approval and verification state for new members */ export interface AppMembershipDefault { @@ -2025,6 +2036,7 @@ export interface DatabaseRelations { rlsModule?: RlsModule | null; hierarchyModule?: HierarchyModule | null; rateLimitsModule?: RateLimitsModule | null; + devicesModule?: DevicesModule | null; schemas?: ConnectionResult; tables?: ConnectionResult
; checkConstraints?: ConnectionResult; @@ -2548,6 +2560,12 @@ export interface RoleTypeRelations {} export interface MigrateFileRelations {} export interface AppLimitDefaultRelations {} export interface OrgLimitDefaultRelations {} +export interface DevicesModuleRelations { + database?: Database | null; + deviceSettingsTableByDeviceSettingsTableId?: Table | null; + schema?: Schema | null; + userDevicesTableByUserDevicesTableId?: Table | null; +} export interface MembershipTypeRelations {} export interface AppMembershipDefaultRelations {} export interface CommitRelations {} @@ -2750,6 +2768,7 @@ export type RoleTypeWithRelations = RoleType & RoleTypeRelations; export type MigrateFileWithRelations = MigrateFile & MigrateFileRelations; export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRelations; export type OrgLimitDefaultWithRelations = OrgLimitDefault & OrgLimitDefaultRelations; +export type DevicesModuleWithRelations = DevicesModule & DevicesModuleRelations; export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations; @@ -2831,6 +2850,9 @@ export type DatabaseSelect = { rateLimitsModule?: { select: RateLimitsModuleSelect; }; + devicesModule?: { + select: DevicesModuleSelect; + }; schemas?: { select: SchemaSelect; first?: number; @@ -5265,11 +5287,33 @@ export type OrgLimitDefaultSelect = { name?: boolean; max?: boolean; }; +export type DevicesModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + userDevicesTableId?: boolean; + deviceSettingsTableId?: boolean; + userDevicesTable?: boolean; + deviceSettingsTable?: boolean; + database?: { + select: DatabaseSelect; + }; + deviceSettingsTableByDeviceSettingsTableId?: { + select: TableSelect; + }; + schema?: { + select: SchemaSelect; + }; + userDevicesTableByUserDevicesTableId?: { + select: TableSelect; + }; +}; export type MembershipTypeSelect = { id?: boolean; name?: boolean; description?: boolean; prefix?: boolean; + hasUsersTableEntry?: boolean; }; export type AppMembershipDefaultSelect = { id?: boolean; @@ -6132,6 +6176,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -9417,6 +9465,36 @@ export interface OrgLimitDefaultFilter { /** Negates the expression. */ not?: OrgLimitDefaultFilter; } +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} export interface MembershipTypeFilter { /** Filter by the object’s `id` field. */ id?: IntFilter; @@ -9426,6 +9504,8 @@ export interface MembershipTypeFilter { description?: StringFilter; /** Filter by the object’s `prefix` field. */ prefix?: StringFilter; + /** Filter by the object’s `hasUsersTableEntry` field. */ + hasUsersTableEntry?: BooleanFilter; /** Checks for all expressions in this list. */ and?: MembershipTypeFilter[]; /** Checks for any expressions in this list. */ @@ -12301,6 +12381,24 @@ export type OrgLimitDefaultOrderBy = | 'NAME_DESC' | 'MAX_ASC' | 'MAX_DESC'; +export type DevicesModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_ASC' + | 'USER_DEVICES_TABLE_DESC' + | 'DEVICE_SETTINGS_TABLE_ASC' + | 'DEVICE_SETTINGS_TABLE_DESC'; export type MembershipTypeOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -12312,7 +12410,9 @@ export type MembershipTypeOrderBy = | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'PREFIX_ASC' - | 'PREFIX_DESC'; + | 'PREFIX_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC'; export type AppMembershipDefaultOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -15713,18 +15813,48 @@ export interface DeleteOrgLimitDefaultInput { clientMutationId?: string; id: string; } +export interface CreateDevicesModuleInput { + clientMutationId?: string; + devicesModule: { + databaseId: string; + schemaId?: string; + userDevicesTableId?: string; + deviceSettingsTableId?: string; + userDevicesTable?: string; + deviceSettingsTable?: string; + }; +} +export interface DevicesModulePatch { + databaseId?: string | null; + schemaId?: string | null; + userDevicesTableId?: string | null; + deviceSettingsTableId?: string | null; + userDevicesTable?: string | null; + deviceSettingsTable?: string | null; +} +export interface UpdateDevicesModuleInput { + clientMutationId?: string; + id: string; + devicesModulePatch: DevicesModulePatch; +} +export interface DeleteDevicesModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateMembershipTypeInput { clientMutationId?: string; membershipType: { name: string; description: string; prefix: string; + hasUsersTableEntry?: boolean; }; } export interface MembershipTypePatch { name?: string | null; description?: string | null; prefix?: string | null; + hasUsersTableEntry?: boolean | null; } export interface UpdateMembershipTypeInput { clientMutationId?: string; @@ -21053,6 +21183,10 @@ export interface DatabaseFilter { rateLimitsModule?: RateLimitsModuleFilter; /** A related `rateLimitsModule` exists. */ rateLimitsModuleExists?: boolean; + /** Filter by the object’s `devicesModule` relation. */ + devicesModule?: DevicesModuleFilter; + /** A related `devicesModule` exists. */ + devicesModuleExists?: boolean; /** Filter by the object’s `databaseProvisionModules` relation. */ databaseProvisionModules?: DatabaseToManyDatabaseProvisionModuleFilter; /** `databaseProvisionModules` exist. */ @@ -22500,6 +22634,37 @@ export interface RateLimitsModuleFilter { /** Filter by the object’s `schema` relation. */ schema?: SchemaFilter; } +/** A filter to be used against `DevicesModule` object types. All fields are combined with a logical ‘and.’ */ +export interface DevicesModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `userDevicesTableId` field. */ + userDevicesTableId?: UUIDFilter; + /** Filter by the object’s `deviceSettingsTableId` field. */ + deviceSettingsTableId?: UUIDFilter; + /** Filter by the object’s `userDevicesTable` field. */ + userDevicesTable?: StringFilter; + /** Filter by the object’s `deviceSettingsTable` field. */ + deviceSettingsTable?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DevicesModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DevicesModuleFilter[]; + /** Negates the expression. */ + not?: DevicesModuleFilter; + /** Filter by the object’s `database` relation. */ + database?: DatabaseFilter; + /** Filter by the object’s `deviceSettingsTableByDeviceSettingsTableId` relation. */ + deviceSettingsTableByDeviceSettingsTableId?: TableFilter; + /** Filter by the object’s `schema` relation. */ + schema?: SchemaFilter; + /** Filter by the object’s `userDevicesTableByUserDevicesTableId` relation. */ + userDevicesTableByUserDevicesTableId?: TableFilter; +} /** A filter to be used against BitString fields. All fields are combined with a logical ‘and.’ */ export interface BitStringFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -27364,6 +27529,51 @@ export type DeleteOrgLimitDefaultPayloadSelect = { select: OrgLimitDefaultEdgeSelect; }; }; +export interface CreateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was created by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type CreateDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; +export interface UpdateDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was updated by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type UpdateDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; +export interface DeleteDevicesModulePayload { + clientMutationId?: string | null; + /** The `DevicesModule` that was deleted by this mutation. */ + devicesModule?: DevicesModule | null; + devicesModuleEdge?: DevicesModuleEdge | null; +} +export type DeleteDevicesModulePayloadSelect = { + clientMutationId?: boolean; + devicesModule?: { + select: DevicesModuleSelect; + }; + devicesModuleEdge?: { + select: DevicesModuleEdgeSelect; + }; +}; export interface CreateMembershipTypePayload { clientMutationId?: string | null; /** The `MembershipType` that was created by this mutation. */ @@ -29042,6 +29252,18 @@ export type OrgLimitDefaultEdgeSelect = { select: OrgLimitDefaultSelect; }; }; +/** A `DevicesModule` edge in the connection. */ +export interface DevicesModuleEdge { + cursor?: string | null; + /** The `DevicesModule` at the end of the edge. */ + node?: DevicesModule | null; +} +export type DevicesModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: DevicesModuleSelect; + }; +}; /** A `MembershipType` edge in the connection. */ export interface MembershipTypeEdge { cursor?: string | null; diff --git a/sdk/constructive-sdk/src/public/orm/models/devicesModule.ts b/sdk/constructive-sdk/src/public/orm/models/devicesModule.ts new file mode 100644 index 000000000..11386e4fe --- /dev/null +++ b/sdk/constructive-sdk/src/public/orm/models/devicesModule.ts @@ -0,0 +1,237 @@ +/** + * DevicesModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + DevicesModule, + DevicesModuleWithRelations, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, + CreateDevicesModuleInput, + UpdateDevicesModuleInput, + DevicesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class DevicesModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModules: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModules: { + nodes: InferSelectResult[]; + }; + }> { + const { document, variables } = buildFindFirstDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + }, + 'DevicesModuleFilter', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', + document, + variables, + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + devicesModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', + document, + variables, + transform: (data: { + devicesModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'DevicesModule', + 'createDevicesModule', + 'devicesModule', + args.select, + args.data, + 'CreateDevicesModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'createDevicesModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + DevicesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'DevicesModule', + 'updateDevicesModule', + 'devicesModule', + args.select, + args.where.id, + args.data, + 'UpdateDevicesModuleInput', + 'id', + 'devicesModulePatch', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'updateDevicesModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'DevicesModule', + 'deleteDevicesModule', + 'devicesModule', + { + id: args.where.id, + }, + 'DeleteDevicesModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'deleteDevicesModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/public/orm/models/index.ts b/sdk/constructive-sdk/src/public/orm/models/index.ts index 0eacaeee7..19ede4ef0 100644 --- a/sdk/constructive-sdk/src/public/orm/models/index.ts +++ b/sdk/constructive-sdk/src/public/orm/models/index.ts @@ -101,6 +101,7 @@ export { RoleTypeModel } from './roleType'; export { MigrateFileModel } from './migrateFile'; export { AppLimitDefaultModel } from './appLimitDefault'; export { OrgLimitDefaultModel } from './orgLimitDefault'; +export { DevicesModuleModel } from './devicesModule'; export { MembershipTypeModel } from './membershipType'; export { AppMembershipDefaultModel } from './appMembershipDefault'; export { CommitModel } from './commit';