@constructive-io/sdk 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +84 -0
- package/admin/index.d.ts +5 -0
- package/admin/index.js +21 -0
- package/admin/orm/client.d.ts +55 -0
- package/admin/orm/client.js +105 -0
- package/admin/orm/index.d.ts +153 -0
- package/admin/orm/index.js +122 -0
- package/admin/orm/input-types.d.ts +3682 -0
- package/admin/orm/input-types.js +5 -0
- package/admin/orm/models/appAchievement.d.ts +56 -0
- package/admin/orm/models/appAchievement.js +98 -0
- package/admin/orm/models/appAdminGrant.d.ts +56 -0
- package/admin/orm/models/appAdminGrant.js +98 -0
- package/admin/orm/models/appGrant.d.ts +56 -0
- package/admin/orm/models/appGrant.js +98 -0
- package/admin/orm/models/appLevel.d.ts +56 -0
- package/admin/orm/models/appLevel.js +98 -0
- package/admin/orm/models/appLevelRequirement.d.ts +56 -0
- package/admin/orm/models/appLevelRequirement.js +98 -0
- package/admin/orm/models/appLimit.d.ts +56 -0
- package/admin/orm/models/appLimit.js +98 -0
- package/admin/orm/models/appLimitDefault.d.ts +56 -0
- package/admin/orm/models/appLimitDefault.js +98 -0
- package/admin/orm/models/appMembership.d.ts +56 -0
- package/admin/orm/models/appMembership.js +98 -0
- package/admin/orm/models/appMembershipDefault.d.ts +56 -0
- package/admin/orm/models/appMembershipDefault.js +98 -0
- package/admin/orm/models/appOwnerGrant.d.ts +56 -0
- package/admin/orm/models/appOwnerGrant.js +98 -0
- package/admin/orm/models/appPermission.d.ts +56 -0
- package/admin/orm/models/appPermission.js +98 -0
- package/admin/orm/models/appPermissionDefault.d.ts +56 -0
- package/admin/orm/models/appPermissionDefault.js +98 -0
- package/admin/orm/models/appStep.d.ts +56 -0
- package/admin/orm/models/appStep.js +98 -0
- package/admin/orm/models/claimedInvite.d.ts +56 -0
- package/admin/orm/models/claimedInvite.js +98 -0
- package/admin/orm/models/index.d.ts +33 -0
- package/admin/orm/models/index.js +64 -0
- package/admin/orm/models/invite.d.ts +56 -0
- package/admin/orm/models/invite.js +98 -0
- package/admin/orm/models/membershipType.d.ts +56 -0
- package/admin/orm/models/membershipType.js +98 -0
- package/admin/orm/models/orgAdminGrant.d.ts +56 -0
- package/admin/orm/models/orgAdminGrant.js +98 -0
- package/admin/orm/models/orgClaimedInvite.d.ts +56 -0
- package/admin/orm/models/orgClaimedInvite.js +98 -0
- package/admin/orm/models/orgGrant.d.ts +56 -0
- package/admin/orm/models/orgGrant.js +98 -0
- package/admin/orm/models/orgInvite.d.ts +56 -0
- package/admin/orm/models/orgInvite.js +98 -0
- package/admin/orm/models/orgLimit.d.ts +56 -0
- package/admin/orm/models/orgLimit.js +98 -0
- package/admin/orm/models/orgLimitDefault.d.ts +56 -0
- package/admin/orm/models/orgLimitDefault.js +98 -0
- package/admin/orm/models/orgMember.d.ts +56 -0
- package/admin/orm/models/orgMember.js +98 -0
- package/admin/orm/models/orgMembership.d.ts +56 -0
- package/admin/orm/models/orgMembership.js +98 -0
- package/admin/orm/models/orgMembershipDefault.d.ts +56 -0
- package/admin/orm/models/orgMembershipDefault.js +98 -0
- package/admin/orm/models/orgOwnerGrant.d.ts +56 -0
- package/admin/orm/models/orgOwnerGrant.js +98 -0
- package/admin/orm/models/orgPermission.d.ts +56 -0
- package/admin/orm/models/orgPermission.js +98 -0
- package/admin/orm/models/orgPermissionDefault.d.ts +56 -0
- package/admin/orm/models/orgPermissionDefault.js +98 -0
- package/admin/orm/mutation/index.d.ts +27 -0
- package/admin/orm/mutation/index.js +33 -0
- package/admin/orm/query/index.d.ts +101 -0
- package/admin/orm/query/index.js +173 -0
- package/admin/orm/query-builder.d.ts +89 -0
- package/admin/orm/query-builder.js +611 -0
- package/admin/orm/select-types.d.ts +101 -0
- package/admin/orm/select-types.js +2 -0
- package/admin/orm/types.d.ts +6 -0
- package/admin/orm/types.js +23 -0
- package/auth/index.d.ts +5 -0
- package/auth/index.js +21 -0
- package/auth/orm/client.d.ts +55 -0
- package/auth/orm/client.js +105 -0
- package/auth/orm/index.d.ts +151 -0
- package/auth/orm/index.js +80 -0
- package/auth/orm/input-types.d.ts +1412 -0
- package/auth/orm/input-types.js +5 -0
- package/auth/orm/models/auditLog.d.ts +56 -0
- package/auth/orm/models/auditLog.js +98 -0
- package/auth/orm/models/connectedAccount.d.ts +56 -0
- package/auth/orm/models/connectedAccount.js +98 -0
- package/auth/orm/models/cryptoAddress.d.ts +56 -0
- package/auth/orm/models/cryptoAddress.js +98 -0
- package/auth/orm/models/email.d.ts +56 -0
- package/auth/orm/models/email.js +98 -0
- package/auth/orm/models/index.d.ts +12 -0
- package/auth/orm/models/index.js +22 -0
- package/auth/orm/models/phoneNumber.d.ts +56 -0
- package/auth/orm/models/phoneNumber.js +98 -0
- package/auth/orm/models/roleType.d.ts +56 -0
- package/auth/orm/models/roleType.js +98 -0
- package/auth/orm/models/user.d.ts +56 -0
- package/auth/orm/models/user.js +98 -0
- package/auth/orm/mutation/index.d.ts +139 -0
- package/auth/orm/mutation/index.js +201 -0
- package/auth/orm/query/index.d.ts +31 -0
- package/auth/orm/query/index.js +37 -0
- package/auth/orm/query-builder.d.ts +89 -0
- package/auth/orm/query-builder.js +611 -0
- package/auth/orm/select-types.d.ts +101 -0
- package/auth/orm/select-types.js +2 -0
- package/auth/orm/types.d.ts +6 -0
- package/auth/orm/types.js +23 -0
- package/esm/admin/index.d.ts +5 -0
- package/esm/admin/index.js +5 -0
- package/esm/admin/orm/client.d.ts +55 -0
- package/esm/admin/orm/client.js +99 -0
- package/esm/admin/orm/index.d.ts +153 -0
- package/esm/admin/orm/index.js +100 -0
- package/esm/admin/orm/input-types.d.ts +3682 -0
- package/esm/admin/orm/input-types.js +2 -0
- package/esm/admin/orm/models/appAchievement.d.ts +56 -0
- package/esm/admin/orm/models/appAchievement.js +94 -0
- package/esm/admin/orm/models/appAdminGrant.d.ts +56 -0
- package/esm/admin/orm/models/appAdminGrant.js +94 -0
- package/esm/admin/orm/models/appGrant.d.ts +56 -0
- package/esm/admin/orm/models/appGrant.js +94 -0
- package/esm/admin/orm/models/appLevel.d.ts +56 -0
- package/esm/admin/orm/models/appLevel.js +94 -0
- package/esm/admin/orm/models/appLevelRequirement.d.ts +56 -0
- package/esm/admin/orm/models/appLevelRequirement.js +94 -0
- package/esm/admin/orm/models/appLimit.d.ts +56 -0
- package/esm/admin/orm/models/appLimit.js +94 -0
- package/esm/admin/orm/models/appLimitDefault.d.ts +56 -0
- package/esm/admin/orm/models/appLimitDefault.js +94 -0
- package/esm/admin/orm/models/appMembership.d.ts +56 -0
- package/esm/admin/orm/models/appMembership.js +94 -0
- package/esm/admin/orm/models/appMembershipDefault.d.ts +56 -0
- package/esm/admin/orm/models/appMembershipDefault.js +94 -0
- package/esm/admin/orm/models/appOwnerGrant.d.ts +56 -0
- package/esm/admin/orm/models/appOwnerGrant.js +94 -0
- package/esm/admin/orm/models/appPermission.d.ts +56 -0
- package/esm/admin/orm/models/appPermission.js +94 -0
- package/esm/admin/orm/models/appPermissionDefault.d.ts +56 -0
- package/esm/admin/orm/models/appPermissionDefault.js +94 -0
- package/esm/admin/orm/models/appStep.d.ts +56 -0
- package/esm/admin/orm/models/appStep.js +94 -0
- package/esm/admin/orm/models/claimedInvite.d.ts +56 -0
- package/esm/admin/orm/models/claimedInvite.js +94 -0
- package/esm/admin/orm/models/index.d.ts +33 -0
- package/esm/admin/orm/models/index.js +33 -0
- package/esm/admin/orm/models/invite.d.ts +56 -0
- package/esm/admin/orm/models/invite.js +94 -0
- package/esm/admin/orm/models/membershipType.d.ts +56 -0
- package/esm/admin/orm/models/membershipType.js +94 -0
- package/esm/admin/orm/models/orgAdminGrant.d.ts +56 -0
- package/esm/admin/orm/models/orgAdminGrant.js +94 -0
- package/esm/admin/orm/models/orgClaimedInvite.d.ts +56 -0
- package/esm/admin/orm/models/orgClaimedInvite.js +94 -0
- package/esm/admin/orm/models/orgGrant.d.ts +56 -0
- package/esm/admin/orm/models/orgGrant.js +94 -0
- package/esm/admin/orm/models/orgInvite.d.ts +56 -0
- package/esm/admin/orm/models/orgInvite.js +94 -0
- package/esm/admin/orm/models/orgLimit.d.ts +56 -0
- package/esm/admin/orm/models/orgLimit.js +94 -0
- package/esm/admin/orm/models/orgLimitDefault.d.ts +56 -0
- package/esm/admin/orm/models/orgLimitDefault.js +94 -0
- package/esm/admin/orm/models/orgMember.d.ts +56 -0
- package/esm/admin/orm/models/orgMember.js +94 -0
- package/esm/admin/orm/models/orgMembership.d.ts +56 -0
- package/esm/admin/orm/models/orgMembership.js +94 -0
- package/esm/admin/orm/models/orgMembershipDefault.d.ts +56 -0
- package/esm/admin/orm/models/orgMembershipDefault.js +94 -0
- package/esm/admin/orm/models/orgOwnerGrant.d.ts +56 -0
- package/esm/admin/orm/models/orgOwnerGrant.js +94 -0
- package/esm/admin/orm/models/orgPermission.d.ts +56 -0
- package/esm/admin/orm/models/orgPermission.js +94 -0
- package/esm/admin/orm/models/orgPermissionDefault.d.ts +56 -0
- package/esm/admin/orm/models/orgPermissionDefault.js +94 -0
- package/esm/admin/orm/mutation/index.d.ts +27 -0
- package/esm/admin/orm/mutation/index.js +30 -0
- package/esm/admin/orm/query/index.d.ts +101 -0
- package/esm/admin/orm/query/index.js +170 -0
- package/esm/admin/orm/query-builder.d.ts +89 -0
- package/esm/admin/orm/query-builder.js +564 -0
- package/esm/admin/orm/select-types.d.ts +101 -0
- package/esm/admin/orm/select-types.js +1 -0
- package/esm/admin/orm/types.d.ts +6 -0
- package/esm/admin/orm/types.js +7 -0
- package/esm/auth/index.d.ts +5 -0
- package/esm/auth/index.js +5 -0
- package/esm/auth/orm/client.d.ts +55 -0
- package/esm/auth/orm/client.js +99 -0
- package/esm/auth/orm/index.d.ts +151 -0
- package/esm/auth/orm/index.js +58 -0
- package/esm/auth/orm/input-types.d.ts +1412 -0
- package/esm/auth/orm/input-types.js +2 -0
- package/esm/auth/orm/models/auditLog.d.ts +56 -0
- package/esm/auth/orm/models/auditLog.js +94 -0
- package/esm/auth/orm/models/connectedAccount.d.ts +56 -0
- package/esm/auth/orm/models/connectedAccount.js +94 -0
- package/esm/auth/orm/models/cryptoAddress.d.ts +56 -0
- package/esm/auth/orm/models/cryptoAddress.js +94 -0
- package/esm/auth/orm/models/email.d.ts +56 -0
- package/esm/auth/orm/models/email.js +94 -0
- package/esm/auth/orm/models/index.d.ts +12 -0
- package/esm/auth/orm/models/index.js +12 -0
- package/esm/auth/orm/models/phoneNumber.d.ts +56 -0
- package/esm/auth/orm/models/phoneNumber.js +94 -0
- package/esm/auth/orm/models/roleType.d.ts +56 -0
- package/esm/auth/orm/models/roleType.js +94 -0
- package/esm/auth/orm/models/user.d.ts +56 -0
- package/esm/auth/orm/models/user.js +94 -0
- package/esm/auth/orm/mutation/index.d.ts +139 -0
- package/esm/auth/orm/mutation/index.js +198 -0
- package/esm/auth/orm/query/index.d.ts +31 -0
- package/esm/auth/orm/query/index.js +34 -0
- package/esm/auth/orm/query-builder.d.ts +89 -0
- package/esm/auth/orm/query-builder.js +564 -0
- package/esm/auth/orm/select-types.d.ts +101 -0
- package/esm/auth/orm/select-types.js +1 -0
- package/esm/auth/orm/types.d.ts +6 -0
- package/esm/auth/orm/types.js +7 -0
- package/esm/index.d.ts +12 -0
- package/esm/index.js +12 -0
- package/esm/objects/index.d.ts +5 -0
- package/esm/objects/index.js +5 -0
- package/esm/objects/orm/client.d.ts +55 -0
- package/esm/objects/orm/client.js +99 -0
- package/esm/objects/orm/index.d.ts +107 -0
- package/esm/objects/orm/index.js +54 -0
- package/esm/objects/orm/input-types.d.ts +909 -0
- package/esm/objects/orm/input-types.js +2 -0
- package/esm/objects/orm/models/commit.d.ts +56 -0
- package/esm/objects/orm/models/commit.js +94 -0
- package/esm/objects/orm/models/getAllRecord.d.ts +32 -0
- package/esm/objects/orm/models/getAllRecord.js +51 -0
- package/esm/objects/orm/models/index.d.ts +10 -0
- package/esm/objects/orm/models/index.js +10 -0
- package/esm/objects/orm/models/object.d.ts +56 -0
- package/esm/objects/orm/models/object.js +84 -0
- package/esm/objects/orm/models/ref.d.ts +56 -0
- package/esm/objects/orm/models/ref.js +94 -0
- package/esm/objects/orm/models/store.d.ts +56 -0
- package/esm/objects/orm/models/store.js +94 -0
- package/esm/objects/orm/mutation/index.d.ts +75 -0
- package/esm/objects/orm/mutation/index.js +102 -0
- package/esm/objects/orm/query/index.d.ts +57 -0
- package/esm/objects/orm/query/index.js +110 -0
- package/esm/objects/orm/query-builder.d.ts +89 -0
- package/esm/objects/orm/query-builder.js +564 -0
- package/esm/objects/orm/select-types.d.ts +101 -0
- package/esm/objects/orm/select-types.js +1 -0
- package/esm/objects/orm/types.d.ts +6 -0
- package/esm/objects/orm/types.js +7 -0
- package/esm/public/index.d.ts +5 -0
- package/esm/public/index.js +5 -0
- package/esm/public/orm/client.d.ts +55 -0
- package/esm/public/orm/client.js +99 -0
- package/esm/public/orm/index.d.ts +480 -0
- package/esm/public/orm/index.js +242 -0
- package/esm/public/orm/input-types.d.ts +15987 -0
- package/esm/public/orm/input-types.js +128 -0
- package/esm/public/orm/models/api.d.ts +56 -0
- package/esm/public/orm/models/api.js +94 -0
- package/esm/public/orm/models/apiModule.d.ts +56 -0
- package/esm/public/orm/models/apiModule.js +94 -0
- package/esm/public/orm/models/apiSchema.d.ts +56 -0
- package/esm/public/orm/models/apiSchema.js +94 -0
- package/esm/public/orm/models/app.d.ts +56 -0
- package/esm/public/orm/models/app.js +94 -0
- package/esm/public/orm/models/appAchievement.d.ts +56 -0
- package/esm/public/orm/models/appAchievement.js +94 -0
- package/esm/public/orm/models/appAdminGrant.d.ts +56 -0
- package/esm/public/orm/models/appAdminGrant.js +94 -0
- package/esm/public/orm/models/appGrant.d.ts +56 -0
- package/esm/public/orm/models/appGrant.js +94 -0
- package/esm/public/orm/models/appLevel.d.ts +56 -0
- package/esm/public/orm/models/appLevel.js +94 -0
- package/esm/public/orm/models/appLevelRequirement.d.ts +56 -0
- package/esm/public/orm/models/appLevelRequirement.js +94 -0
- package/esm/public/orm/models/appLimit.d.ts +56 -0
- package/esm/public/orm/models/appLimit.js +94 -0
- package/esm/public/orm/models/appLimitDefault.d.ts +56 -0
- package/esm/public/orm/models/appLimitDefault.js +94 -0
- package/esm/public/orm/models/appMembership.d.ts +56 -0
- package/esm/public/orm/models/appMembership.js +94 -0
- package/esm/public/orm/models/appMembershipDefault.d.ts +56 -0
- package/esm/public/orm/models/appMembershipDefault.js +94 -0
- package/esm/public/orm/models/appOwnerGrant.d.ts +56 -0
- package/esm/public/orm/models/appOwnerGrant.js +94 -0
- package/esm/public/orm/models/appPermission.d.ts +56 -0
- package/esm/public/orm/models/appPermission.js +94 -0
- package/esm/public/orm/models/appPermissionDefault.d.ts +56 -0
- package/esm/public/orm/models/appPermissionDefault.js +94 -0
- package/esm/public/orm/models/appStep.d.ts +56 -0
- package/esm/public/orm/models/appStep.js +94 -0
- package/esm/public/orm/models/astMigration.d.ts +38 -0
- package/esm/public/orm/models/astMigration.js +72 -0
- package/esm/public/orm/models/auditLog.d.ts +56 -0
- package/esm/public/orm/models/auditLog.js +94 -0
- package/esm/public/orm/models/checkConstraint.d.ts +56 -0
- package/esm/public/orm/models/checkConstraint.js +94 -0
- package/esm/public/orm/models/claimedInvite.d.ts +56 -0
- package/esm/public/orm/models/claimedInvite.js +94 -0
- package/esm/public/orm/models/commit.d.ts +56 -0
- package/esm/public/orm/models/commit.js +94 -0
- package/esm/public/orm/models/connectedAccount.d.ts +56 -0
- package/esm/public/orm/models/connectedAccount.js +94 -0
- package/esm/public/orm/models/connectedAccountsModule.d.ts +56 -0
- package/esm/public/orm/models/connectedAccountsModule.js +94 -0
- package/esm/public/orm/models/cryptoAddress.d.ts +56 -0
- package/esm/public/orm/models/cryptoAddress.js +94 -0
- package/esm/public/orm/models/cryptoAddressesModule.d.ts +56 -0
- package/esm/public/orm/models/cryptoAddressesModule.js +94 -0
- package/esm/public/orm/models/cryptoAuthModule.d.ts +56 -0
- package/esm/public/orm/models/cryptoAuthModule.js +94 -0
- package/esm/public/orm/models/database.d.ts +56 -0
- package/esm/public/orm/models/database.js +94 -0
- package/esm/public/orm/models/databaseProvisionModule.d.ts +56 -0
- package/esm/public/orm/models/databaseProvisionModule.js +94 -0
- package/esm/public/orm/models/defaultIdsModule.d.ts +56 -0
- package/esm/public/orm/models/defaultIdsModule.js +94 -0
- package/esm/public/orm/models/denormalizedTableField.d.ts +56 -0
- package/esm/public/orm/models/denormalizedTableField.js +94 -0
- package/esm/public/orm/models/domain.d.ts +56 -0
- package/esm/public/orm/models/domain.js +94 -0
- package/esm/public/orm/models/email.d.ts +56 -0
- package/esm/public/orm/models/email.js +94 -0
- package/esm/public/orm/models/emailsModule.d.ts +56 -0
- package/esm/public/orm/models/emailsModule.js +94 -0
- package/esm/public/orm/models/encryptedSecretsModule.d.ts +56 -0
- package/esm/public/orm/models/encryptedSecretsModule.js +94 -0
- package/esm/public/orm/models/field.d.ts +56 -0
- package/esm/public/orm/models/field.js +94 -0
- package/esm/public/orm/models/fieldModule.d.ts +56 -0
- package/esm/public/orm/models/fieldModule.js +94 -0
- package/esm/public/orm/models/foreignKeyConstraint.d.ts +56 -0
- package/esm/public/orm/models/foreignKeyConstraint.js +94 -0
- package/esm/public/orm/models/fullTextSearch.d.ts +56 -0
- package/esm/public/orm/models/fullTextSearch.js +94 -0
- package/esm/public/orm/models/getAllRecord.d.ts +32 -0
- package/esm/public/orm/models/getAllRecord.js +51 -0
- package/esm/public/orm/models/hierarchyModule.d.ts +56 -0
- package/esm/public/orm/models/hierarchyModule.js +94 -0
- package/esm/public/orm/models/index.d.ts +104 -0
- package/esm/public/orm/models/index.js +104 -0
- package/esm/public/orm/models/indexModel.d.ts +56 -0
- package/esm/public/orm/models/indexModel.js +94 -0
- package/esm/public/orm/models/invite.d.ts +56 -0
- package/esm/public/orm/models/invite.js +94 -0
- package/esm/public/orm/models/invitesModule.d.ts +56 -0
- package/esm/public/orm/models/invitesModule.js +94 -0
- package/esm/public/orm/models/levelsModule.d.ts +56 -0
- package/esm/public/orm/models/levelsModule.js +94 -0
- package/esm/public/orm/models/limitFunction.d.ts +56 -0
- package/esm/public/orm/models/limitFunction.js +94 -0
- package/esm/public/orm/models/limitsModule.d.ts +56 -0
- package/esm/public/orm/models/limitsModule.js +94 -0
- package/esm/public/orm/models/membershipType.d.ts +56 -0
- package/esm/public/orm/models/membershipType.js +94 -0
- package/esm/public/orm/models/membershipTypesModule.d.ts +56 -0
- package/esm/public/orm/models/membershipTypesModule.js +94 -0
- package/esm/public/orm/models/membershipsModule.d.ts +56 -0
- package/esm/public/orm/models/membershipsModule.js +94 -0
- package/esm/public/orm/models/nodeTypeRegistry.d.ts +56 -0
- package/esm/public/orm/models/nodeTypeRegistry.js +94 -0
- package/esm/public/orm/models/object.d.ts +56 -0
- package/esm/public/orm/models/object.js +84 -0
- package/esm/public/orm/models/orgAdminGrant.d.ts +56 -0
- package/esm/public/orm/models/orgAdminGrant.js +94 -0
- package/esm/public/orm/models/orgClaimedInvite.d.ts +56 -0
- package/esm/public/orm/models/orgClaimedInvite.js +94 -0
- package/esm/public/orm/models/orgGrant.d.ts +56 -0
- package/esm/public/orm/models/orgGrant.js +94 -0
- package/esm/public/orm/models/orgInvite.d.ts +56 -0
- package/esm/public/orm/models/orgInvite.js +94 -0
- package/esm/public/orm/models/orgLimit.d.ts +56 -0
- package/esm/public/orm/models/orgLimit.js +94 -0
- package/esm/public/orm/models/orgLimitDefault.d.ts +56 -0
- package/esm/public/orm/models/orgLimitDefault.js +94 -0
- package/esm/public/orm/models/orgMember.d.ts +56 -0
- package/esm/public/orm/models/orgMember.js +94 -0
- package/esm/public/orm/models/orgMembership.d.ts +56 -0
- package/esm/public/orm/models/orgMembership.js +94 -0
- package/esm/public/orm/models/orgMembershipDefault.d.ts +56 -0
- package/esm/public/orm/models/orgMembershipDefault.js +94 -0
- package/esm/public/orm/models/orgOwnerGrant.d.ts +56 -0
- package/esm/public/orm/models/orgOwnerGrant.js +94 -0
- package/esm/public/orm/models/orgPermission.d.ts +56 -0
- package/esm/public/orm/models/orgPermission.js +94 -0
- package/esm/public/orm/models/orgPermissionDefault.d.ts +56 -0
- package/esm/public/orm/models/orgPermissionDefault.js +94 -0
- package/esm/public/orm/models/permissionsModule.d.ts +56 -0
- package/esm/public/orm/models/permissionsModule.js +94 -0
- package/esm/public/orm/models/phoneNumber.d.ts +56 -0
- package/esm/public/orm/models/phoneNumber.js +94 -0
- package/esm/public/orm/models/phoneNumbersModule.d.ts +56 -0
- package/esm/public/orm/models/phoneNumbersModule.js +94 -0
- package/esm/public/orm/models/policy.d.ts +56 -0
- package/esm/public/orm/models/policy.js +94 -0
- package/esm/public/orm/models/primaryKeyConstraint.d.ts +56 -0
- package/esm/public/orm/models/primaryKeyConstraint.js +94 -0
- package/esm/public/orm/models/procedure.d.ts +56 -0
- package/esm/public/orm/models/procedure.js +94 -0
- package/esm/public/orm/models/profilesModule.d.ts +56 -0
- package/esm/public/orm/models/profilesModule.js +94 -0
- package/esm/public/orm/models/ref.d.ts +56 -0
- package/esm/public/orm/models/ref.js +94 -0
- package/esm/public/orm/models/rlsModule.d.ts +56 -0
- package/esm/public/orm/models/rlsModule.js +94 -0
- package/esm/public/orm/models/roleType.d.ts +56 -0
- package/esm/public/orm/models/roleType.js +94 -0
- package/esm/public/orm/models/schema.d.ts +56 -0
- package/esm/public/orm/models/schema.js +94 -0
- package/esm/public/orm/models/schemaGrant.d.ts +56 -0
- package/esm/public/orm/models/schemaGrant.js +94 -0
- package/esm/public/orm/models/secretsModule.d.ts +56 -0
- package/esm/public/orm/models/secretsModule.js +94 -0
- package/esm/public/orm/models/sessionsModule.d.ts +56 -0
- package/esm/public/orm/models/sessionsModule.js +94 -0
- package/esm/public/orm/models/site.d.ts +56 -0
- package/esm/public/orm/models/site.js +94 -0
- package/esm/public/orm/models/siteMetadatum.d.ts +56 -0
- package/esm/public/orm/models/siteMetadatum.js +94 -0
- package/esm/public/orm/models/siteModule.d.ts +56 -0
- package/esm/public/orm/models/siteModule.js +94 -0
- package/esm/public/orm/models/siteTheme.d.ts +56 -0
- package/esm/public/orm/models/siteTheme.js +94 -0
- package/esm/public/orm/models/sqlMigration.d.ts +38 -0
- package/esm/public/orm/models/sqlMigration.js +72 -0
- package/esm/public/orm/models/store.d.ts +56 -0
- package/esm/public/orm/models/store.js +94 -0
- package/esm/public/orm/models/table.d.ts +56 -0
- package/esm/public/orm/models/table.js +94 -0
- package/esm/public/orm/models/tableGrant.d.ts +56 -0
- package/esm/public/orm/models/tableGrant.js +94 -0
- package/esm/public/orm/models/tableModule.d.ts +56 -0
- package/esm/public/orm/models/tableModule.js +94 -0
- package/esm/public/orm/models/tableTemplateModule.d.ts +56 -0
- package/esm/public/orm/models/tableTemplateModule.js +94 -0
- package/esm/public/orm/models/trigger.d.ts +56 -0
- package/esm/public/orm/models/trigger.js +94 -0
- package/esm/public/orm/models/triggerFunction.d.ts +56 -0
- package/esm/public/orm/models/triggerFunction.js +94 -0
- package/esm/public/orm/models/uniqueConstraint.d.ts +56 -0
- package/esm/public/orm/models/uniqueConstraint.js +94 -0
- package/esm/public/orm/models/user.d.ts +56 -0
- package/esm/public/orm/models/user.js +94 -0
- package/esm/public/orm/models/userAuthModule.d.ts +56 -0
- package/esm/public/orm/models/userAuthModule.js +94 -0
- package/esm/public/orm/models/usersModule.d.ts +56 -0
- package/esm/public/orm/models/usersModule.js +94 -0
- package/esm/public/orm/models/uuidModule.d.ts +56 -0
- package/esm/public/orm/models/uuidModule.js +94 -0
- package/esm/public/orm/models/view.d.ts +56 -0
- package/esm/public/orm/models/view.js +94 -0
- package/esm/public/orm/models/viewGrant.d.ts +56 -0
- package/esm/public/orm/models/viewGrant.js +94 -0
- package/esm/public/orm/models/viewRule.d.ts +56 -0
- package/esm/public/orm/models/viewRule.js +94 -0
- package/esm/public/orm/models/viewTable.d.ts +56 -0
- package/esm/public/orm/models/viewTable.js +94 -0
- package/esm/public/orm/mutation/index.d.ts +259 -0
- package/esm/public/orm/mutation/index.js +378 -0
- package/esm/public/orm/query/index.d.ts +168 -0
- package/esm/public/orm/query/index.js +302 -0
- package/esm/public/orm/query-builder.d.ts +89 -0
- package/esm/public/orm/query-builder.js +564 -0
- package/esm/public/orm/select-types.d.ts +101 -0
- package/esm/public/orm/select-types.js +1 -0
- package/esm/public/orm/types.d.ts +6 -0
- package/esm/public/orm/types.js +7 -0
- package/index.d.ts +12 -0
- package/index.js +48 -0
- package/objects/index.d.ts +5 -0
- package/objects/index.js +21 -0
- package/objects/orm/client.d.ts +55 -0
- package/objects/orm/client.js +105 -0
- package/objects/orm/index.d.ts +107 -0
- package/objects/orm/index.js +76 -0
- package/objects/orm/input-types.d.ts +909 -0
- package/objects/orm/input-types.js +5 -0
- package/objects/orm/models/commit.d.ts +56 -0
- package/objects/orm/models/commit.js +98 -0
- package/objects/orm/models/getAllRecord.d.ts +32 -0
- package/objects/orm/models/getAllRecord.js +55 -0
- package/objects/orm/models/index.d.ts +10 -0
- package/objects/orm/models/index.js +18 -0
- package/objects/orm/models/object.d.ts +56 -0
- package/objects/orm/models/object.js +88 -0
- package/objects/orm/models/ref.d.ts +56 -0
- package/objects/orm/models/ref.js +98 -0
- package/objects/orm/models/store.d.ts +56 -0
- package/objects/orm/models/store.js +98 -0
- package/objects/orm/mutation/index.d.ts +75 -0
- package/objects/orm/mutation/index.js +105 -0
- package/objects/orm/query/index.d.ts +57 -0
- package/objects/orm/query/index.js +113 -0
- package/objects/orm/query-builder.d.ts +89 -0
- package/objects/orm/query-builder.js +611 -0
- package/objects/orm/select-types.d.ts +101 -0
- package/objects/orm/select-types.js +2 -0
- package/objects/orm/types.d.ts +6 -0
- package/objects/orm/types.js +23 -0
- package/package.json +54 -0
- package/public/index.d.ts +5 -0
- package/public/index.js +21 -0
- package/public/orm/client.d.ts +55 -0
- package/public/orm/client.js +105 -0
- package/public/orm/index.d.ts +480 -0
- package/public/orm/index.js +264 -0
- package/public/orm/input-types.d.ts +15987 -0
- package/public/orm/input-types.js +131 -0
- package/public/orm/models/api.d.ts +56 -0
- package/public/orm/models/api.js +98 -0
- package/public/orm/models/apiModule.d.ts +56 -0
- package/public/orm/models/apiModule.js +98 -0
- package/public/orm/models/apiSchema.d.ts +56 -0
- package/public/orm/models/apiSchema.js +98 -0
- package/public/orm/models/app.d.ts +56 -0
- package/public/orm/models/app.js +98 -0
- package/public/orm/models/appAchievement.d.ts +56 -0
- package/public/orm/models/appAchievement.js +98 -0
- package/public/orm/models/appAdminGrant.d.ts +56 -0
- package/public/orm/models/appAdminGrant.js +98 -0
- package/public/orm/models/appGrant.d.ts +56 -0
- package/public/orm/models/appGrant.js +98 -0
- package/public/orm/models/appLevel.d.ts +56 -0
- package/public/orm/models/appLevel.js +98 -0
- package/public/orm/models/appLevelRequirement.d.ts +56 -0
- package/public/orm/models/appLevelRequirement.js +98 -0
- package/public/orm/models/appLimit.d.ts +56 -0
- package/public/orm/models/appLimit.js +98 -0
- package/public/orm/models/appLimitDefault.d.ts +56 -0
- package/public/orm/models/appLimitDefault.js +98 -0
- package/public/orm/models/appMembership.d.ts +56 -0
- package/public/orm/models/appMembership.js +98 -0
- package/public/orm/models/appMembershipDefault.d.ts +56 -0
- package/public/orm/models/appMembershipDefault.js +98 -0
- package/public/orm/models/appOwnerGrant.d.ts +56 -0
- package/public/orm/models/appOwnerGrant.js +98 -0
- package/public/orm/models/appPermission.d.ts +56 -0
- package/public/orm/models/appPermission.js +98 -0
- package/public/orm/models/appPermissionDefault.d.ts +56 -0
- package/public/orm/models/appPermissionDefault.js +98 -0
- package/public/orm/models/appStep.d.ts +56 -0
- package/public/orm/models/appStep.js +98 -0
- package/public/orm/models/astMigration.d.ts +38 -0
- package/public/orm/models/astMigration.js +76 -0
- package/public/orm/models/auditLog.d.ts +56 -0
- package/public/orm/models/auditLog.js +98 -0
- package/public/orm/models/checkConstraint.d.ts +56 -0
- package/public/orm/models/checkConstraint.js +98 -0
- package/public/orm/models/claimedInvite.d.ts +56 -0
- package/public/orm/models/claimedInvite.js +98 -0
- package/public/orm/models/commit.d.ts +56 -0
- package/public/orm/models/commit.js +98 -0
- package/public/orm/models/connectedAccount.d.ts +56 -0
- package/public/orm/models/connectedAccount.js +98 -0
- package/public/orm/models/connectedAccountsModule.d.ts +56 -0
- package/public/orm/models/connectedAccountsModule.js +98 -0
- package/public/orm/models/cryptoAddress.d.ts +56 -0
- package/public/orm/models/cryptoAddress.js +98 -0
- package/public/orm/models/cryptoAddressesModule.d.ts +56 -0
- package/public/orm/models/cryptoAddressesModule.js +98 -0
- package/public/orm/models/cryptoAuthModule.d.ts +56 -0
- package/public/orm/models/cryptoAuthModule.js +98 -0
- package/public/orm/models/database.d.ts +56 -0
- package/public/orm/models/database.js +98 -0
- package/public/orm/models/databaseProvisionModule.d.ts +56 -0
- package/public/orm/models/databaseProvisionModule.js +98 -0
- package/public/orm/models/defaultIdsModule.d.ts +56 -0
- package/public/orm/models/defaultIdsModule.js +98 -0
- package/public/orm/models/denormalizedTableField.d.ts +56 -0
- package/public/orm/models/denormalizedTableField.js +98 -0
- package/public/orm/models/domain.d.ts +56 -0
- package/public/orm/models/domain.js +98 -0
- package/public/orm/models/email.d.ts +56 -0
- package/public/orm/models/email.js +98 -0
- package/public/orm/models/emailsModule.d.ts +56 -0
- package/public/orm/models/emailsModule.js +98 -0
- package/public/orm/models/encryptedSecretsModule.d.ts +56 -0
- package/public/orm/models/encryptedSecretsModule.js +98 -0
- package/public/orm/models/field.d.ts +56 -0
- package/public/orm/models/field.js +98 -0
- package/public/orm/models/fieldModule.d.ts +56 -0
- package/public/orm/models/fieldModule.js +98 -0
- package/public/orm/models/foreignKeyConstraint.d.ts +56 -0
- package/public/orm/models/foreignKeyConstraint.js +98 -0
- package/public/orm/models/fullTextSearch.d.ts +56 -0
- package/public/orm/models/fullTextSearch.js +98 -0
- package/public/orm/models/getAllRecord.d.ts +32 -0
- package/public/orm/models/getAllRecord.js +55 -0
- package/public/orm/models/hierarchyModule.d.ts +56 -0
- package/public/orm/models/hierarchyModule.js +98 -0
- package/public/orm/models/index.d.ts +104 -0
- package/public/orm/models/index.js +207 -0
- package/public/orm/models/indexModel.d.ts +56 -0
- package/public/orm/models/indexModel.js +98 -0
- package/public/orm/models/invite.d.ts +56 -0
- package/public/orm/models/invite.js +98 -0
- package/public/orm/models/invitesModule.d.ts +56 -0
- package/public/orm/models/invitesModule.js +98 -0
- package/public/orm/models/levelsModule.d.ts +56 -0
- package/public/orm/models/levelsModule.js +98 -0
- package/public/orm/models/limitFunction.d.ts +56 -0
- package/public/orm/models/limitFunction.js +98 -0
- package/public/orm/models/limitsModule.d.ts +56 -0
- package/public/orm/models/limitsModule.js +98 -0
- package/public/orm/models/membershipType.d.ts +56 -0
- package/public/orm/models/membershipType.js +98 -0
- package/public/orm/models/membershipTypesModule.d.ts +56 -0
- package/public/orm/models/membershipTypesModule.js +98 -0
- package/public/orm/models/membershipsModule.d.ts +56 -0
- package/public/orm/models/membershipsModule.js +98 -0
- package/public/orm/models/nodeTypeRegistry.d.ts +56 -0
- package/public/orm/models/nodeTypeRegistry.js +98 -0
- package/public/orm/models/object.d.ts +56 -0
- package/public/orm/models/object.js +88 -0
- package/public/orm/models/orgAdminGrant.d.ts +56 -0
- package/public/orm/models/orgAdminGrant.js +98 -0
- package/public/orm/models/orgClaimedInvite.d.ts +56 -0
- package/public/orm/models/orgClaimedInvite.js +98 -0
- package/public/orm/models/orgGrant.d.ts +56 -0
- package/public/orm/models/orgGrant.js +98 -0
- package/public/orm/models/orgInvite.d.ts +56 -0
- package/public/orm/models/orgInvite.js +98 -0
- package/public/orm/models/orgLimit.d.ts +56 -0
- package/public/orm/models/orgLimit.js +98 -0
- package/public/orm/models/orgLimitDefault.d.ts +56 -0
- package/public/orm/models/orgLimitDefault.js +98 -0
- package/public/orm/models/orgMember.d.ts +56 -0
- package/public/orm/models/orgMember.js +98 -0
- package/public/orm/models/orgMembership.d.ts +56 -0
- package/public/orm/models/orgMembership.js +98 -0
- package/public/orm/models/orgMembershipDefault.d.ts +56 -0
- package/public/orm/models/orgMembershipDefault.js +98 -0
- package/public/orm/models/orgOwnerGrant.d.ts +56 -0
- package/public/orm/models/orgOwnerGrant.js +98 -0
- package/public/orm/models/orgPermission.d.ts +56 -0
- package/public/orm/models/orgPermission.js +98 -0
- package/public/orm/models/orgPermissionDefault.d.ts +56 -0
- package/public/orm/models/orgPermissionDefault.js +98 -0
- package/public/orm/models/permissionsModule.d.ts +56 -0
- package/public/orm/models/permissionsModule.js +98 -0
- package/public/orm/models/phoneNumber.d.ts +56 -0
- package/public/orm/models/phoneNumber.js +98 -0
- package/public/orm/models/phoneNumbersModule.d.ts +56 -0
- package/public/orm/models/phoneNumbersModule.js +98 -0
- package/public/orm/models/policy.d.ts +56 -0
- package/public/orm/models/policy.js +98 -0
- package/public/orm/models/primaryKeyConstraint.d.ts +56 -0
- package/public/orm/models/primaryKeyConstraint.js +98 -0
- package/public/orm/models/procedure.d.ts +56 -0
- package/public/orm/models/procedure.js +98 -0
- package/public/orm/models/profilesModule.d.ts +56 -0
- package/public/orm/models/profilesModule.js +98 -0
- package/public/orm/models/ref.d.ts +56 -0
- package/public/orm/models/ref.js +98 -0
- package/public/orm/models/rlsModule.d.ts +56 -0
- package/public/orm/models/rlsModule.js +98 -0
- package/public/orm/models/roleType.d.ts +56 -0
- package/public/orm/models/roleType.js +98 -0
- package/public/orm/models/schema.d.ts +56 -0
- package/public/orm/models/schema.js +98 -0
- package/public/orm/models/schemaGrant.d.ts +56 -0
- package/public/orm/models/schemaGrant.js +98 -0
- package/public/orm/models/secretsModule.d.ts +56 -0
- package/public/orm/models/secretsModule.js +98 -0
- package/public/orm/models/sessionsModule.d.ts +56 -0
- package/public/orm/models/sessionsModule.js +98 -0
- package/public/orm/models/site.d.ts +56 -0
- package/public/orm/models/site.js +98 -0
- package/public/orm/models/siteMetadatum.d.ts +56 -0
- package/public/orm/models/siteMetadatum.js +98 -0
- package/public/orm/models/siteModule.d.ts +56 -0
- package/public/orm/models/siteModule.js +98 -0
- package/public/orm/models/siteTheme.d.ts +56 -0
- package/public/orm/models/siteTheme.js +98 -0
- package/public/orm/models/sqlMigration.d.ts +38 -0
- package/public/orm/models/sqlMigration.js +76 -0
- package/public/orm/models/store.d.ts +56 -0
- package/public/orm/models/store.js +98 -0
- package/public/orm/models/table.d.ts +56 -0
- package/public/orm/models/table.js +98 -0
- package/public/orm/models/tableGrant.d.ts +56 -0
- package/public/orm/models/tableGrant.js +98 -0
- package/public/orm/models/tableModule.d.ts +56 -0
- package/public/orm/models/tableModule.js +98 -0
- package/public/orm/models/tableTemplateModule.d.ts +56 -0
- package/public/orm/models/tableTemplateModule.js +98 -0
- package/public/orm/models/trigger.d.ts +56 -0
- package/public/orm/models/trigger.js +98 -0
- package/public/orm/models/triggerFunction.d.ts +56 -0
- package/public/orm/models/triggerFunction.js +98 -0
- package/public/orm/models/uniqueConstraint.d.ts +56 -0
- package/public/orm/models/uniqueConstraint.js +98 -0
- package/public/orm/models/user.d.ts +56 -0
- package/public/orm/models/user.js +98 -0
- package/public/orm/models/userAuthModule.d.ts +56 -0
- package/public/orm/models/userAuthModule.js +98 -0
- package/public/orm/models/usersModule.d.ts +56 -0
- package/public/orm/models/usersModule.js +98 -0
- package/public/orm/models/uuidModule.d.ts +56 -0
- package/public/orm/models/uuidModule.js +98 -0
- package/public/orm/models/view.d.ts +56 -0
- package/public/orm/models/view.js +98 -0
- package/public/orm/models/viewGrant.d.ts +56 -0
- package/public/orm/models/viewGrant.js +98 -0
- package/public/orm/models/viewRule.d.ts +56 -0
- package/public/orm/models/viewRule.js +98 -0
- package/public/orm/models/viewTable.d.ts +56 -0
- package/public/orm/models/viewTable.js +98 -0
- package/public/orm/mutation/index.d.ts +259 -0
- package/public/orm/mutation/index.js +381 -0
- package/public/orm/query/index.d.ts +168 -0
- package/public/orm/query/index.js +305 -0
- package/public/orm/query-builder.d.ts +89 -0
- package/public/orm/query-builder.js +611 -0
- package/public/orm/select-types.d.ts +101 -0
- package/public/orm/select-types.js +2 -0
- package/public/orm/types.d.ts +6 -0
- package/public/orm/types.js +23 -0
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Builder - Builds and executes GraphQL operations
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { parseType, print } from '@0no-co/graphql.web';
|
|
7
|
+
import * as t from 'gql-ast';
|
|
8
|
+
import { GraphQLRequestError } from './client';
|
|
9
|
+
export class QueryBuilder {
|
|
10
|
+
config;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Execute the query and return a discriminated union result
|
|
16
|
+
* Use result.ok to check success, or .unwrap() to throw on error
|
|
17
|
+
*/
|
|
18
|
+
async execute() {
|
|
19
|
+
const rawResult = await this.config.client.execute(this.config.document, this.config.variables);
|
|
20
|
+
if (!rawResult.ok) {
|
|
21
|
+
return rawResult;
|
|
22
|
+
}
|
|
23
|
+
if (!this.config.transform) {
|
|
24
|
+
return rawResult;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
ok: true,
|
|
28
|
+
data: this.config.transform(rawResult.data),
|
|
29
|
+
errors: undefined,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Execute and unwrap the result, throwing GraphQLRequestError on failure
|
|
34
|
+
* @throws {GraphQLRequestError} If the query returns errors
|
|
35
|
+
*/
|
|
36
|
+
async unwrap() {
|
|
37
|
+
const result = await this.execute();
|
|
38
|
+
if (!result.ok) {
|
|
39
|
+
throw new GraphQLRequestError(result.errors, result.data);
|
|
40
|
+
}
|
|
41
|
+
return result.data;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Execute and unwrap, returning defaultValue on error instead of throwing
|
|
45
|
+
*/
|
|
46
|
+
async unwrapOr(defaultValue) {
|
|
47
|
+
const result = await this.execute();
|
|
48
|
+
if (!result.ok) {
|
|
49
|
+
return defaultValue;
|
|
50
|
+
}
|
|
51
|
+
return result.data;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Execute and unwrap, calling onError callback on failure
|
|
55
|
+
*/
|
|
56
|
+
async unwrapOrElse(onError) {
|
|
57
|
+
const result = await this.execute();
|
|
58
|
+
if (!result.ok) {
|
|
59
|
+
return onError(result.errors);
|
|
60
|
+
}
|
|
61
|
+
return result.data;
|
|
62
|
+
}
|
|
63
|
+
toGraphQL() {
|
|
64
|
+
return this.config.document;
|
|
65
|
+
}
|
|
66
|
+
getVariables() {
|
|
67
|
+
return this.config.variables;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const OP_QUERY = 'query';
|
|
71
|
+
const OP_MUTATION = 'mutation';
|
|
72
|
+
const ENUM_VALUE_KIND = 'EnumValue';
|
|
73
|
+
// ============================================================================
|
|
74
|
+
// Selection Builders
|
|
75
|
+
// ============================================================================
|
|
76
|
+
export function buildSelections(select, connectionFieldsMap, entityType) {
|
|
77
|
+
if (!select) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const fields = [];
|
|
81
|
+
const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined;
|
|
82
|
+
for (const [key, value] of Object.entries(select)) {
|
|
83
|
+
if (value === false || value === undefined) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (value === true) {
|
|
87
|
+
fields.push(t.field({ name: key }));
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (typeof value === 'object' && value !== null) {
|
|
91
|
+
const nested = value;
|
|
92
|
+
if (!nested.select || typeof nested.select !== 'object') {
|
|
93
|
+
throw new Error(`Invalid selection for field "${key}": nested selections must include a "select" object.`);
|
|
94
|
+
}
|
|
95
|
+
const relatedEntityType = entityConnections?.[key];
|
|
96
|
+
const nestedSelections = buildSelections(nested.select, connectionFieldsMap, relatedEntityType);
|
|
97
|
+
const isConnection = nested.connection === true ||
|
|
98
|
+
nested.first !== undefined ||
|
|
99
|
+
nested.filter !== undefined ||
|
|
100
|
+
relatedEntityType !== undefined;
|
|
101
|
+
const args = buildArgs([
|
|
102
|
+
buildOptionalArg('first', nested.first),
|
|
103
|
+
nested.filter
|
|
104
|
+
? t.argument({
|
|
105
|
+
name: 'filter',
|
|
106
|
+
value: buildValueAst(nested.filter),
|
|
107
|
+
})
|
|
108
|
+
: null,
|
|
109
|
+
buildEnumListArg('orderBy', nested.orderBy),
|
|
110
|
+
]);
|
|
111
|
+
if (isConnection) {
|
|
112
|
+
fields.push(t.field({
|
|
113
|
+
name: key,
|
|
114
|
+
args,
|
|
115
|
+
selectionSet: t.selectionSet({
|
|
116
|
+
selections: buildConnectionSelections(nestedSelections),
|
|
117
|
+
}),
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
fields.push(t.field({
|
|
122
|
+
name: key,
|
|
123
|
+
args,
|
|
124
|
+
selectionSet: t.selectionSet({ selections: nestedSelections }),
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return fields;
|
|
130
|
+
}
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// Document Builders
|
|
133
|
+
// ============================================================================
|
|
134
|
+
export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) {
|
|
135
|
+
const selections = select
|
|
136
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
137
|
+
: [t.field({ name: 'id' })];
|
|
138
|
+
const variableDefinitions = [];
|
|
139
|
+
const queryArgs = [];
|
|
140
|
+
const variables = {};
|
|
141
|
+
addVariable({
|
|
142
|
+
varName: 'where',
|
|
143
|
+
argName: 'filter',
|
|
144
|
+
typeName: filterTypeName,
|
|
145
|
+
value: args.where,
|
|
146
|
+
}, variableDefinitions, queryArgs, variables);
|
|
147
|
+
addVariable({
|
|
148
|
+
varName: 'orderBy',
|
|
149
|
+
typeName: '[' + orderByTypeName + '!]',
|
|
150
|
+
value: args.orderBy?.length ? args.orderBy : undefined,
|
|
151
|
+
}, variableDefinitions, queryArgs, variables);
|
|
152
|
+
addVariable({ varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, variables);
|
|
153
|
+
addVariable({ varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, variables);
|
|
154
|
+
addVariable({ varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, variables);
|
|
155
|
+
addVariable({ varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, variables);
|
|
156
|
+
addVariable({ varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, variables);
|
|
157
|
+
const document = t.document({
|
|
158
|
+
definitions: [
|
|
159
|
+
t.operationDefinition({
|
|
160
|
+
operation: OP_QUERY,
|
|
161
|
+
name: operationName + 'Query',
|
|
162
|
+
variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined,
|
|
163
|
+
selectionSet: t.selectionSet({
|
|
164
|
+
selections: [
|
|
165
|
+
t.field({
|
|
166
|
+
name: queryField,
|
|
167
|
+
args: queryArgs.length ? queryArgs : undefined,
|
|
168
|
+
selectionSet: t.selectionSet({
|
|
169
|
+
selections: buildConnectionSelections(selections),
|
|
170
|
+
}),
|
|
171
|
+
}),
|
|
172
|
+
],
|
|
173
|
+
}),
|
|
174
|
+
}),
|
|
175
|
+
],
|
|
176
|
+
});
|
|
177
|
+
return { document: print(document), variables };
|
|
178
|
+
}
|
|
179
|
+
export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap) {
|
|
180
|
+
const selections = select
|
|
181
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
182
|
+
: [t.field({ name: 'id' })];
|
|
183
|
+
const variableDefinitions = [];
|
|
184
|
+
const queryArgs = [];
|
|
185
|
+
const variables = {};
|
|
186
|
+
// Always add first: 1 for findFirst
|
|
187
|
+
addVariable({ varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, variables);
|
|
188
|
+
addVariable({
|
|
189
|
+
varName: 'where',
|
|
190
|
+
argName: 'filter',
|
|
191
|
+
typeName: filterTypeName,
|
|
192
|
+
value: args.where,
|
|
193
|
+
}, variableDefinitions, queryArgs, variables);
|
|
194
|
+
const document = t.document({
|
|
195
|
+
definitions: [
|
|
196
|
+
t.operationDefinition({
|
|
197
|
+
operation: OP_QUERY,
|
|
198
|
+
name: operationName + 'Query',
|
|
199
|
+
variableDefinitions,
|
|
200
|
+
selectionSet: t.selectionSet({
|
|
201
|
+
selections: [
|
|
202
|
+
t.field({
|
|
203
|
+
name: queryField,
|
|
204
|
+
args: queryArgs,
|
|
205
|
+
selectionSet: t.selectionSet({
|
|
206
|
+
selections: [
|
|
207
|
+
t.field({
|
|
208
|
+
name: 'nodes',
|
|
209
|
+
selectionSet: t.selectionSet({ selections }),
|
|
210
|
+
}),
|
|
211
|
+
],
|
|
212
|
+
}),
|
|
213
|
+
}),
|
|
214
|
+
],
|
|
215
|
+
}),
|
|
216
|
+
}),
|
|
217
|
+
],
|
|
218
|
+
});
|
|
219
|
+
return { document: print(document), variables };
|
|
220
|
+
}
|
|
221
|
+
export function buildCreateDocument(operationName, mutationField, entityField, select, data, inputTypeName, connectionFieldsMap) {
|
|
222
|
+
const selections = select
|
|
223
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
224
|
+
: [t.field({ name: 'id' })];
|
|
225
|
+
return {
|
|
226
|
+
document: buildInputMutationDocument({
|
|
227
|
+
operationName,
|
|
228
|
+
mutationField,
|
|
229
|
+
inputTypeName,
|
|
230
|
+
resultSelections: [
|
|
231
|
+
t.field({
|
|
232
|
+
name: entityField,
|
|
233
|
+
selectionSet: t.selectionSet({ selections }),
|
|
234
|
+
}),
|
|
235
|
+
],
|
|
236
|
+
}),
|
|
237
|
+
variables: {
|
|
238
|
+
input: {
|
|
239
|
+
[entityField]: data,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
export function buildUpdateDocument(operationName, mutationField, entityField, select, where, data, inputTypeName, patchFieldName, connectionFieldsMap) {
|
|
245
|
+
const selections = select
|
|
246
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
247
|
+
: [t.field({ name: 'id' })];
|
|
248
|
+
return {
|
|
249
|
+
document: buildInputMutationDocument({
|
|
250
|
+
operationName,
|
|
251
|
+
mutationField,
|
|
252
|
+
inputTypeName,
|
|
253
|
+
resultSelections: [
|
|
254
|
+
t.field({
|
|
255
|
+
name: entityField,
|
|
256
|
+
selectionSet: t.selectionSet({ selections }),
|
|
257
|
+
}),
|
|
258
|
+
],
|
|
259
|
+
}),
|
|
260
|
+
variables: {
|
|
261
|
+
input: {
|
|
262
|
+
id: where.id,
|
|
263
|
+
[patchFieldName]: data,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
export function buildUpdateByPkDocument(operationName, mutationField, entityField, select, id, data, inputTypeName, idFieldName, patchFieldName, connectionFieldsMap) {
|
|
269
|
+
const selections = select
|
|
270
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
271
|
+
: [t.field({ name: 'id' })];
|
|
272
|
+
return {
|
|
273
|
+
document: buildInputMutationDocument({
|
|
274
|
+
operationName,
|
|
275
|
+
mutationField,
|
|
276
|
+
inputTypeName,
|
|
277
|
+
resultSelections: [
|
|
278
|
+
t.field({
|
|
279
|
+
name: entityField,
|
|
280
|
+
selectionSet: t.selectionSet({ selections }),
|
|
281
|
+
}),
|
|
282
|
+
],
|
|
283
|
+
}),
|
|
284
|
+
variables: {
|
|
285
|
+
input: {
|
|
286
|
+
[idFieldName]: id,
|
|
287
|
+
[patchFieldName]: data,
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
export function buildFindOneDocument(operationName, queryField, id, select, idArgName, idTypeName, connectionFieldsMap) {
|
|
293
|
+
const selections = select
|
|
294
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
295
|
+
: [t.field({ name: 'id' })];
|
|
296
|
+
const variableDefinitions = [
|
|
297
|
+
t.variableDefinition({
|
|
298
|
+
variable: t.variable({ name: idArgName }),
|
|
299
|
+
type: parseType(idTypeName),
|
|
300
|
+
}),
|
|
301
|
+
];
|
|
302
|
+
const queryArgs = [
|
|
303
|
+
t.argument({
|
|
304
|
+
name: idArgName,
|
|
305
|
+
value: t.variable({ name: idArgName }),
|
|
306
|
+
}),
|
|
307
|
+
];
|
|
308
|
+
const document = t.document({
|
|
309
|
+
definitions: [
|
|
310
|
+
t.operationDefinition({
|
|
311
|
+
operation: OP_QUERY,
|
|
312
|
+
name: operationName + 'Query',
|
|
313
|
+
variableDefinitions,
|
|
314
|
+
selectionSet: t.selectionSet({
|
|
315
|
+
selections: [
|
|
316
|
+
t.field({
|
|
317
|
+
name: queryField,
|
|
318
|
+
args: queryArgs,
|
|
319
|
+
selectionSet: t.selectionSet({ selections }),
|
|
320
|
+
}),
|
|
321
|
+
],
|
|
322
|
+
}),
|
|
323
|
+
}),
|
|
324
|
+
],
|
|
325
|
+
});
|
|
326
|
+
return {
|
|
327
|
+
document: print(document),
|
|
328
|
+
variables: { [idArgName]: id },
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
export function buildDeleteDocument(operationName, mutationField, entityField, where, inputTypeName, select, connectionFieldsMap) {
|
|
332
|
+
const entitySelections = select
|
|
333
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
334
|
+
: [t.field({ name: 'id' })];
|
|
335
|
+
return {
|
|
336
|
+
document: buildInputMutationDocument({
|
|
337
|
+
operationName,
|
|
338
|
+
mutationField,
|
|
339
|
+
inputTypeName,
|
|
340
|
+
resultSelections: [
|
|
341
|
+
t.field({
|
|
342
|
+
name: entityField,
|
|
343
|
+
selectionSet: t.selectionSet({
|
|
344
|
+
selections: entitySelections,
|
|
345
|
+
}),
|
|
346
|
+
}),
|
|
347
|
+
],
|
|
348
|
+
}),
|
|
349
|
+
variables: {
|
|
350
|
+
input: {
|
|
351
|
+
id: where.id,
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
export function buildDeleteByPkDocument(operationName, mutationField, entityField, id, inputTypeName, idFieldName, select, connectionFieldsMap) {
|
|
357
|
+
const entitySelections = select
|
|
358
|
+
? buildSelections(select, connectionFieldsMap, operationName)
|
|
359
|
+
: [t.field({ name: 'id' })];
|
|
360
|
+
return {
|
|
361
|
+
document: buildInputMutationDocument({
|
|
362
|
+
operationName,
|
|
363
|
+
mutationField,
|
|
364
|
+
inputTypeName,
|
|
365
|
+
resultSelections: [
|
|
366
|
+
t.field({
|
|
367
|
+
name: entityField,
|
|
368
|
+
selectionSet: t.selectionSet({ selections: entitySelections }),
|
|
369
|
+
}),
|
|
370
|
+
],
|
|
371
|
+
}),
|
|
372
|
+
variables: {
|
|
373
|
+
input: {
|
|
374
|
+
[idFieldName]: id,
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
export function buildCustomDocument(operationType, operationName, fieldName, select, args, variableDefinitions, connectionFieldsMap, entityType) {
|
|
380
|
+
let actualSelect = select;
|
|
381
|
+
let isConnection = false;
|
|
382
|
+
if (isCustomSelectionWrapper(select)) {
|
|
383
|
+
actualSelect = select.select;
|
|
384
|
+
isConnection = select.connection === true;
|
|
385
|
+
}
|
|
386
|
+
const selections = actualSelect
|
|
387
|
+
? buildSelections(actualSelect, connectionFieldsMap, entityType)
|
|
388
|
+
: [];
|
|
389
|
+
const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({
|
|
390
|
+
variable: t.variable({ name: definition.name }),
|
|
391
|
+
type: parseType(definition.type),
|
|
392
|
+
}));
|
|
393
|
+
const fieldArgs = variableDefinitions.map((definition) => t.argument({
|
|
394
|
+
name: definition.name,
|
|
395
|
+
value: t.variable({ name: definition.name }),
|
|
396
|
+
}));
|
|
397
|
+
const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections;
|
|
398
|
+
const document = t.document({
|
|
399
|
+
definitions: [
|
|
400
|
+
t.operationDefinition({
|
|
401
|
+
operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY,
|
|
402
|
+
name: operationName,
|
|
403
|
+
variableDefinitions: variableDefs.length ? variableDefs : undefined,
|
|
404
|
+
selectionSet: t.selectionSet({
|
|
405
|
+
selections: [
|
|
406
|
+
t.field({
|
|
407
|
+
name: fieldName,
|
|
408
|
+
args: fieldArgs.length ? fieldArgs : undefined,
|
|
409
|
+
selectionSet: fieldSelections.length
|
|
410
|
+
? t.selectionSet({ selections: fieldSelections })
|
|
411
|
+
: undefined,
|
|
412
|
+
}),
|
|
413
|
+
],
|
|
414
|
+
}),
|
|
415
|
+
}),
|
|
416
|
+
],
|
|
417
|
+
});
|
|
418
|
+
return {
|
|
419
|
+
document: print(document),
|
|
420
|
+
variables: (args ?? {}),
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function isCustomSelectionWrapper(value) {
|
|
424
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
const record = value;
|
|
428
|
+
const keys = Object.keys(record);
|
|
429
|
+
if (!keys.includes('select') || !keys.includes('connection')) {
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
if (keys.some((key) => key !== 'select' && key !== 'connection')) {
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select);
|
|
436
|
+
}
|
|
437
|
+
// ============================================================================
|
|
438
|
+
// Helper Functions
|
|
439
|
+
// ============================================================================
|
|
440
|
+
function buildArgs(args) {
|
|
441
|
+
return args.filter((arg) => arg !== null);
|
|
442
|
+
}
|
|
443
|
+
function buildOptionalArg(name, value) {
|
|
444
|
+
if (value === undefined) {
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
447
|
+
const valueNode = typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value });
|
|
448
|
+
return t.argument({ name, value: valueNode });
|
|
449
|
+
}
|
|
450
|
+
function buildEnumListArg(name, values) {
|
|
451
|
+
if (!values || values.length === 0) {
|
|
452
|
+
return null;
|
|
453
|
+
}
|
|
454
|
+
return t.argument({
|
|
455
|
+
name,
|
|
456
|
+
value: t.listValue({
|
|
457
|
+
values: values.map((value) => buildEnumValue(value)),
|
|
458
|
+
}),
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function buildEnumValue(value) {
|
|
462
|
+
return {
|
|
463
|
+
kind: ENUM_VALUE_KIND,
|
|
464
|
+
value,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function buildPageInfoSelections() {
|
|
468
|
+
return [
|
|
469
|
+
t.field({ name: 'hasNextPage' }),
|
|
470
|
+
t.field({ name: 'hasPreviousPage' }),
|
|
471
|
+
t.field({ name: 'startCursor' }),
|
|
472
|
+
t.field({ name: 'endCursor' }),
|
|
473
|
+
];
|
|
474
|
+
}
|
|
475
|
+
function buildConnectionSelections(nodeSelections) {
|
|
476
|
+
return [
|
|
477
|
+
t.field({
|
|
478
|
+
name: 'nodes',
|
|
479
|
+
selectionSet: t.selectionSet({ selections: nodeSelections }),
|
|
480
|
+
}),
|
|
481
|
+
t.field({ name: 'totalCount' }),
|
|
482
|
+
t.field({
|
|
483
|
+
name: 'pageInfo',
|
|
484
|
+
selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }),
|
|
485
|
+
}),
|
|
486
|
+
];
|
|
487
|
+
}
|
|
488
|
+
function buildInputMutationDocument(config) {
|
|
489
|
+
const document = t.document({
|
|
490
|
+
definitions: [
|
|
491
|
+
t.operationDefinition({
|
|
492
|
+
operation: OP_MUTATION,
|
|
493
|
+
name: config.operationName + 'Mutation',
|
|
494
|
+
variableDefinitions: [
|
|
495
|
+
t.variableDefinition({
|
|
496
|
+
variable: t.variable({ name: 'input' }),
|
|
497
|
+
type: parseType(config.inputTypeName + '!'),
|
|
498
|
+
}),
|
|
499
|
+
],
|
|
500
|
+
selectionSet: t.selectionSet({
|
|
501
|
+
selections: [
|
|
502
|
+
t.field({
|
|
503
|
+
name: config.mutationField,
|
|
504
|
+
args: [
|
|
505
|
+
t.argument({
|
|
506
|
+
name: 'input',
|
|
507
|
+
value: t.variable({ name: 'input' }),
|
|
508
|
+
}),
|
|
509
|
+
],
|
|
510
|
+
selectionSet: t.selectionSet({
|
|
511
|
+
selections: config.resultSelections,
|
|
512
|
+
}),
|
|
513
|
+
}),
|
|
514
|
+
],
|
|
515
|
+
}),
|
|
516
|
+
}),
|
|
517
|
+
],
|
|
518
|
+
});
|
|
519
|
+
return print(document);
|
|
520
|
+
}
|
|
521
|
+
function addVariable(spec, definitions, args, variables) {
|
|
522
|
+
if (spec.value === undefined)
|
|
523
|
+
return;
|
|
524
|
+
definitions.push(t.variableDefinition({
|
|
525
|
+
variable: t.variable({ name: spec.varName }),
|
|
526
|
+
type: parseType(spec.typeName),
|
|
527
|
+
}));
|
|
528
|
+
args.push(t.argument({
|
|
529
|
+
name: spec.argName ?? spec.varName,
|
|
530
|
+
value: t.variable({ name: spec.varName }),
|
|
531
|
+
}));
|
|
532
|
+
variables[spec.varName] = spec.value;
|
|
533
|
+
}
|
|
534
|
+
function buildValueAst(value) {
|
|
535
|
+
if (value === null) {
|
|
536
|
+
return t.nullValue();
|
|
537
|
+
}
|
|
538
|
+
if (typeof value === 'boolean') {
|
|
539
|
+
return t.booleanValue({ value });
|
|
540
|
+
}
|
|
541
|
+
if (typeof value === 'number') {
|
|
542
|
+
return Number.isInteger(value)
|
|
543
|
+
? t.intValue({ value: value.toString() })
|
|
544
|
+
: t.floatValue({ value: value.toString() });
|
|
545
|
+
}
|
|
546
|
+
if (typeof value === 'string') {
|
|
547
|
+
return t.stringValue({ value });
|
|
548
|
+
}
|
|
549
|
+
if (Array.isArray(value)) {
|
|
550
|
+
return t.listValue({
|
|
551
|
+
values: value.map((item) => buildValueAst(item)),
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
if (typeof value === 'object' && value !== null) {
|
|
555
|
+
const obj = value;
|
|
556
|
+
return t.objectValue({
|
|
557
|
+
fields: Object.entries(obj).map(([key, val]) => t.objectField({
|
|
558
|
+
name: key,
|
|
559
|
+
value: buildValueAst(val),
|
|
560
|
+
})),
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
throw new Error('Unsupported value type: ' + typeof value);
|
|
564
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type utilities for select inference
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
export interface ConnectionResult<T> {
|
|
7
|
+
nodes: T[];
|
|
8
|
+
totalCount: number;
|
|
9
|
+
pageInfo: PageInfo;
|
|
10
|
+
}
|
|
11
|
+
export interface PageInfo {
|
|
12
|
+
hasNextPage: boolean;
|
|
13
|
+
hasPreviousPage: boolean;
|
|
14
|
+
startCursor?: string | null;
|
|
15
|
+
endCursor?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
|
|
18
|
+
select?: TSelect;
|
|
19
|
+
where?: TWhere;
|
|
20
|
+
orderBy?: TOrderBy[];
|
|
21
|
+
first?: number;
|
|
22
|
+
last?: number;
|
|
23
|
+
after?: string;
|
|
24
|
+
before?: string;
|
|
25
|
+
offset?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface FindFirstArgs<TSelect, TWhere> {
|
|
28
|
+
select?: TSelect;
|
|
29
|
+
where?: TWhere;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateArgs<TSelect, TData> {
|
|
32
|
+
data: TData;
|
|
33
|
+
select?: TSelect;
|
|
34
|
+
}
|
|
35
|
+
export interface UpdateArgs<TSelect, TWhere, TData> {
|
|
36
|
+
where: TWhere;
|
|
37
|
+
data: TData;
|
|
38
|
+
select?: TSelect;
|
|
39
|
+
}
|
|
40
|
+
export type FindOneArgs<TSelect, TIdName extends string = 'id', TId = string> = {
|
|
41
|
+
select?: TSelect;
|
|
42
|
+
} & Record<TIdName, TId>;
|
|
43
|
+
export interface DeleteArgs<TWhere, TSelect = undefined> {
|
|
44
|
+
where: TWhere;
|
|
45
|
+
select?: TSelect;
|
|
46
|
+
}
|
|
47
|
+
type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
48
|
+
type DecrementDepth = {
|
|
49
|
+
0: 0;
|
|
50
|
+
1: 0;
|
|
51
|
+
2: 1;
|
|
52
|
+
3: 2;
|
|
53
|
+
4: 3;
|
|
54
|
+
5: 4;
|
|
55
|
+
6: 5;
|
|
56
|
+
7: 6;
|
|
57
|
+
8: 7;
|
|
58
|
+
9: 8;
|
|
59
|
+
10: 9;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Recursively validates select objects, rejecting unknown keys.
|
|
63
|
+
*
|
|
64
|
+
* NOTE: Depth is intentionally capped to avoid circular-instantiation issues
|
|
65
|
+
* in very large cyclic schemas.
|
|
66
|
+
*/
|
|
67
|
+
export type DeepExact<T, Shape, Depth extends DepthLevel = 10> = Depth extends 0 ? T extends Shape ? T : never : T extends Shape ? Exclude<keyof T, keyof Shape> extends never ? {
|
|
68
|
+
[K in keyof T]: K extends keyof Shape ? T[K] extends {
|
|
69
|
+
select: infer NS;
|
|
70
|
+
} ? Extract<Shape[K], {
|
|
71
|
+
select?: unknown;
|
|
72
|
+
}> extends {
|
|
73
|
+
select?: infer ShapeNS;
|
|
74
|
+
} ? DeepExact<Omit<T[K], 'select'> & {
|
|
75
|
+
select: DeepExact<NS, NonNullable<ShapeNS>, DecrementDepth[Depth]>;
|
|
76
|
+
}, Extract<Shape[K], {
|
|
77
|
+
select?: unknown;
|
|
78
|
+
}>, DecrementDepth[Depth]> : never : T[K] : never;
|
|
79
|
+
} : never : never;
|
|
80
|
+
/**
|
|
81
|
+
* Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`.
|
|
82
|
+
* Use this as an intersection in overloads:
|
|
83
|
+
* `{ select: S } & StrictSelect<S, XxxSelect>`.
|
|
84
|
+
*/
|
|
85
|
+
export type StrictSelect<S, Shape> = S extends DeepExact<S, Shape> ? {} : never;
|
|
86
|
+
/**
|
|
87
|
+
* Hook-optimized strict select variant.
|
|
88
|
+
*
|
|
89
|
+
* Uses a shallower recursion depth to keep editor autocomplete responsive
|
|
90
|
+
* in large schemas while still validating common nested-select mistakes.
|
|
91
|
+
*/
|
|
92
|
+
export type HookStrictSelect<S, Shape> = S extends DeepExact<S, Shape, 5> ? {} : never;
|
|
93
|
+
/**
|
|
94
|
+
* Infer result type from select configuration
|
|
95
|
+
*/
|
|
96
|
+
export type InferSelectResult<TEntity, TSelect> = TSelect extends undefined ? TEntity : {
|
|
97
|
+
[K in keyof TSelect as TSelect[K] extends false | undefined ? never : K]: TSelect[K] extends true ? K extends keyof TEntity ? TEntity[K] : never : TSelect[K] extends {
|
|
98
|
+
select: infer NestedSelect;
|
|
99
|
+
} ? K extends keyof TEntity ? NonNullable<TEntity[K]> extends ConnectionResult<infer NodeType> ? ConnectionResult<InferSelectResult<NodeType, NestedSelect>> : InferSelectResult<NonNullable<TEntity[K]>, NestedSelect> | (null extends TEntity[K] ? null : never) : never : K extends keyof TEntity ? TEntity[K] : never;
|
|
100
|
+
};
|
|
101
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @constructive-io/sdk
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated GraphQL types and ORM client.
|
|
5
|
+
* Run `pnpm run generate` to populate this package from the schema files.
|
|
6
|
+
*
|
|
7
|
+
* @generated by @constructive-io/graphql-codegen
|
|
8
|
+
*/
|
|
9
|
+
export * as admin from './admin';
|
|
10
|
+
export * as auth from './auth';
|
|
11
|
+
export * as objects from './objects';
|
|
12
|
+
export * as public_ from './public';
|