@appsemble/utils 0.29.11 → 0.30.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/README.md +3 -3
- package/api/components/parameters/$own.d.ts +2 -0
- package/api/components/parameters/$own.js +7 -0
- package/api/components/parameters/appMemberId.d.ts +2 -0
- package/api/components/parameters/appMemberId.js +8 -0
- package/api/components/parameters/groupId.d.ts +2 -0
- package/api/components/parameters/groupId.js +8 -0
- package/api/components/parameters/groupMemberId.d.ts +2 -0
- package/api/components/parameters/groupMemberId.js +8 -0
- package/api/components/parameters/index.d.ts +17 -13
- package/api/components/parameters/index.js +17 -13
- package/api/components/parameters/organizationId.d.ts +9 -2
- package/api/components/parameters/organizationId.js +1 -1
- package/api/components/parameters/roles.js +12 -6
- package/api/components/parameters/seed.d.ts +2 -0
- package/api/components/parameters/seed.js +9 -0
- package/api/components/parameters/selectedGroupId.d.ts +2 -0
- package/api/components/parameters/selectedGroupId.js +7 -0
- package/api/components/parameters/serviceSecretId.d.ts +2 -0
- package/api/components/parameters/{appServiceId.js → serviceSecretId.js} +3 -3
- package/api/components/requestBodies/oauth2Consent.js +1 -5
- package/api/components/requestBodies/user.js +1 -1
- package/api/components/schemas/ActionDefinition.js +14 -11
- package/api/components/schemas/AppAccount.js +7 -24
- package/api/components/schemas/AppDefinition.js +3 -15
- package/api/components/schemas/AppMember.d.ts +2 -0
- package/api/components/schemas/AppMember.js +26 -0
- package/api/components/schemas/AppMemberCurrentPatchActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberCurrentPatchActionDefinition.js +30 -0
- package/api/components/schemas/AppMemberDeleteActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberDeleteActionDefinition.js +20 -0
- package/api/components/schemas/AppMemberInfo.d.ts +2 -0
- package/api/components/schemas/AppMemberInfo.js +48 -0
- package/api/components/schemas/AppMemberInviteActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberInviteActionDefinition.js +24 -0
- package/api/components/schemas/AppMemberLoginActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberLoginActionDefinition.js +24 -0
- package/api/components/schemas/AppMemberLogoutActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberLogoutActionDefinition.js +14 -0
- package/api/components/schemas/AppMemberPropertiesPatchActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberPropertiesPatchActionDefinition.js +26 -0
- package/api/components/schemas/AppMemberPropertyDefinition.d.ts +2 -0
- package/api/components/schemas/{UserPropertyDefinition.js → AppMemberPropertyDefinition.js} +5 -5
- package/api/components/schemas/AppMemberQueryActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberQueryActionDefinition.js +20 -0
- package/api/components/schemas/AppMemberRegisterActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberRegisterActionDefinition.js +43 -0
- package/api/components/schemas/AppMemberRoleUpdateActionDefinition.d.ts +1 -0
- package/api/components/schemas/AppMemberRoleUpdateActionDefinition.js +27 -0
- package/api/components/schemas/AppMembersDefinition.d.ts +2 -0
- package/api/components/schemas/AppMembersDefinition.js +17 -0
- package/api/components/schemas/BasePageDefinition.js +4 -0
- package/api/components/schemas/GroupMember.d.ts +2 -0
- package/api/components/schemas/GroupMember.js +19 -0
- package/api/components/schemas/GroupMemberDeleteActionDefinition.d.ts +1 -0
- package/api/components/schemas/{TeamMembersActionDefinition.js → GroupMemberDeleteActionDefinition.js} +5 -5
- package/api/components/schemas/GroupMemberInviteActionDefinition.d.ts +1 -0
- package/api/components/schemas/{TeamInviteActionDefinition.js → GroupMemberInviteActionDefinition.js} +5 -6
- package/api/components/schemas/GroupMemberQueryActionDefinition.d.ts +1 -0
- package/api/components/schemas/GroupMemberQueryActionDefinition.js +18 -0
- package/api/components/schemas/GroupMemberRoleUpdateActionDefinition.d.ts +1 -0
- package/api/components/schemas/GroupMemberRoleUpdateActionDefinition.js +22 -0
- package/api/components/schemas/GroupQueryActionDefinition.d.ts +1 -0
- package/api/components/schemas/{UserLogoutActionDefinition.js → GroupQueryActionDefinition.js} +4 -4
- package/api/components/schemas/OrganizationMember.js +2 -2
- package/api/components/schemas/PageActionsDefinition.d.ts +2 -0
- package/api/components/schemas/{TabsPageActionsDefinition.js → PageActionsDefinition.js} +2 -2
- package/api/components/schemas/PageDefinition.js +3 -0
- package/api/components/schemas/ResourceCountActionDefinition.js +4 -0
- package/api/components/schemas/ResourceCreateActionDefinition.js +1 -1
- package/api/components/schemas/ResourceDefinition.js +0 -22
- package/api/components/schemas/ResourceQueryActionDefinition.js +4 -0
- package/api/components/schemas/SecurityDefaultDefinition.js +1 -1
- package/api/components/schemas/SecurityDefinition.js +2 -6
- package/api/components/schemas/SecurityGuestDefinition.d.ts +2 -0
- package/api/components/schemas/SecurityGuestDefinition.js +26 -0
- package/api/components/schemas/SecurityRoleDefinition.js +7 -0
- package/api/components/schemas/TabsPageDefinition.js +1 -1
- package/api/components/schemas/User.js +2 -22
- package/api/components/schemas/UserInfo.d.ts +2 -0
- package/api/components/schemas/UserInfo.js +42 -0
- package/api/components/schemas/index.d.ts +23 -16
- package/api/components/schemas/index.js +23 -16
- package/api/components/securitySchemes/app.js +6 -6
- package/api/components/securitySchemes/cli.js +3 -3
- package/api/paths/app-collections/appCollectionId/apps/appId/pinned.d.ts +2 -0
- package/api/paths/app-collections/appCollectionId/apps/appId/pinned.js +70 -0
- package/api/paths/app-collections/appCollectionId/apps/appId.d.ts +2 -0
- package/api/paths/app-collections/appCollectionId/apps/appId.js +34 -0
- package/api/paths/app-collections/appCollectionId/apps.d.ts +2 -0
- package/api/paths/app-collections/appCollectionId/apps.js +93 -0
- package/api/paths/app-collections/appCollectionId/expert/profileImage.d.ts +2 -0
- package/api/paths/app-collections/appCollectionId/expert/profileImage.js +31 -0
- package/api/paths/app-collections/appCollectionId/headerImage.d.ts +2 -0
- package/api/paths/app-collections/appCollectionId/headerImage.js +31 -0
- package/api/paths/app-collections/appCollectionId.d.ts +2 -0
- package/api/paths/app-collections/appCollectionId.js +102 -0
- package/api/paths/app-invites/token/respond.d.ts +2 -0
- package/api/paths/app-invites/token/respond.js +51 -0
- package/api/paths/app-invites/token.d.ts +2 -0
- package/api/paths/app-invites/token.js +23 -0
- package/api/paths/app-members/appMemberId/picture.d.ts +2 -0
- package/api/paths/app-members/appMemberId/picture.js +30 -0
- package/api/paths/app-members/appMemberId/properties.d.ts +2 -0
- package/api/paths/app-members/appMemberId/properties.js +48 -0
- package/api/paths/app-members/appMemberId/role.d.ts +2 -0
- package/api/paths/app-members/appMemberId/role.js +46 -0
- package/api/paths/app-members/appMemberId.d.ts +2 -0
- package/api/paths/app-members/appMemberId.js +24 -0
- package/api/paths/appCollections.d.ts +1 -1
- package/api/paths/appCollections.js +12 -454
- package/api/paths/appTemplates.d.ts +2 -0
- package/api/paths/appTemplates.js +94 -0
- package/api/paths/apps/appId/actions/path.d.ts +2 -0
- package/api/paths/{action.js → apps/appId/actions/path.js} +18 -20
- package/api/paths/apps/appId/assets/assetId.d.ts +2 -0
- package/api/paths/apps/appId/assets/assetId.js +38 -0
- package/api/paths/apps/appId/assets/count.d.ts +2 -0
- package/api/paths/apps/appId/assets/count.js +22 -0
- package/api/paths/apps/appId/assets.d.ts +2 -0
- package/api/paths/apps/appId/assets.js +96 -0
- package/api/paths/apps/appId/auth/email/login.d.ts +2 -0
- package/api/paths/apps/appId/auth/email/login.js +10 -0
- package/api/paths/apps/appId/auth/email/register.d.ts +2 -0
- package/api/paths/apps/appId/auth/email/register.js +52 -0
- package/api/paths/apps/appId/auth/email/requestResetPassword.d.ts +2 -0
- package/api/paths/apps/appId/auth/email/requestResetPassword.js +31 -0
- package/api/paths/apps/appId/auth/email/resendVerification.d.ts +2 -0
- package/api/paths/apps/appId/auth/email/resendVerification.js +32 -0
- package/api/paths/apps/appId/auth/email/resetPassword.d.ts +2 -0
- package/api/paths/apps/appId/auth/email/resetPassword.js +34 -0
- package/api/paths/apps/appId/auth/email/verify.d.ts +2 -0
- package/api/paths/apps/appId/auth/email/verify.js +31 -0
- package/api/paths/apps/appId/broadcast.d.ts +2 -0
- package/api/paths/apps/appId/broadcast.js +36 -0
- package/api/paths/apps/appId/demo-groups.d.ts +2 -0
- package/api/paths/apps/appId/demo-groups.js +29 -0
- package/api/paths/apps/appId/demo-members.d.ts +2 -0
- package/api/paths/apps/appId/demo-members.js +27 -0
- package/api/paths/apps/appId/email.d.ts +2 -0
- package/api/paths/apps/appId/email.js +48 -0
- package/api/paths/apps/appId/export.d.ts +2 -0
- package/api/paths/apps/appId/export.js +41 -0
- package/api/paths/apps/appId/groups.d.ts +2 -0
- package/api/paths/apps/appId/groups.js +79 -0
- package/api/paths/apps/appId/icon.d.ts +2 -0
- package/api/paths/apps/appId/icon.js +31 -0
- package/api/paths/apps/appId/invites.d.ts +2 -0
- package/api/paths/apps/appId/invites.js +79 -0
- package/api/paths/apps/appId/lock.d.ts +2 -0
- package/api/paths/apps/appId/lock.js +35 -0
- package/api/paths/apps/appId/maskableIcon.d.ts +2 -0
- package/api/paths/apps/appId/maskableIcon.js +15 -0
- package/api/paths/apps/appId/members/current/groups.d.ts +2 -0
- package/api/paths/apps/appId/members/current/groups.js +30 -0
- package/api/paths/apps/appId/members/current/link.d.ts +2 -0
- package/api/paths/apps/appId/members/current/link.js +41 -0
- package/api/paths/apps/appId/members/current.d.ts +2 -0
- package/api/paths/apps/appId/members/current.js +111 -0
- package/api/paths/apps/appId/members.d.ts +2 -0
- package/api/paths/apps/appId/members.js +29 -0
- package/api/paths/apps/appId/messages/language.d.ts +2 -0
- package/api/paths/apps/appId/messages/language.js +47 -0
- package/api/paths/apps/appId/messages.d.ts +2 -0
- package/api/paths/apps/appId/messages.js +72 -0
- package/api/paths/apps/appId/quotas/emails.d.ts +2 -0
- package/api/paths/apps/appId/quotas/emails.js +36 -0
- package/api/paths/apps/appId/ratings.d.ts +2 -0
- package/api/paths/apps/appId/ratings.js +58 -0
- package/api/paths/apps/appId/readmes/readmeId.d.ts +2 -0
- package/api/paths/apps/appId/readmes/readmeId.js +17 -0
- package/api/paths/apps/appId/reseed.d.ts +2 -0
- package/api/paths/apps/appId/reseed.js +12 -0
- package/api/paths/apps/appId/resources/resourceType/count.d.ts +2 -0
- package/api/paths/apps/appId/resources/resourceType/count.js +30 -0
- package/api/paths/apps/appId/resources/resourceType/resourceId/subscriptions.d.ts +2 -0
- package/api/paths/apps/appId/resources/resourceType/resourceId/subscriptions.js +31 -0
- package/api/paths/apps/appId/resources/resourceType/resourceId.d.ts +2 -0
- package/api/paths/apps/appId/resources/resourceType/resourceId.js +74 -0
- package/api/paths/apps/appId/resources/resourceType/subscriptions.d.ts +2 -0
- package/api/paths/apps/appId/resources/resourceType/subscriptions.js +26 -0
- package/api/paths/apps/appId/resources/resourceType.d.ts +2 -0
- package/api/paths/apps/appId/resources/resourceType.js +171 -0
- package/api/paths/apps/appId/resources/versions.d.ts +2 -0
- package/api/paths/apps/appId/resources/versions.js +29 -0
- package/api/paths/apps/appId/resources.d.ts +2 -0
- package/api/paths/apps/appId/resources.js +15 -0
- package/api/paths/apps/appId/saml/secretId/acs.d.ts +2 -0
- package/api/paths/apps/appId/saml/secretId/acs.js +35 -0
- package/api/paths/apps/appId/saml/secretId/authn.d.ts +2 -0
- package/api/paths/apps/appId/saml/secretId/authn.js +37 -0
- package/api/paths/apps/appId/saml/secretId/metadata.d.ts +2 -0
- package/api/paths/apps/appId/saml/secretId/metadata.js +21 -0
- package/api/paths/apps/appId/scim/resource-types/resourceTypeId.d.ts +2 -0
- package/api/paths/apps/appId/scim/resource-types/resourceTypeId.js +25 -0
- package/api/paths/apps/appId/scim/resource-types.d.ts +2 -0
- package/api/paths/apps/appId/scim/resource-types.js +22 -0
- package/api/paths/apps/appId/scim/schemas/schemaId.d.ts +2 -0
- package/api/paths/apps/appId/scim/schemas/schemaId.js +24 -0
- package/api/paths/apps/appId/scim/schemas.d.ts +2 -0
- package/api/paths/apps/appId/scim/schemas.js +21 -0
- package/api/paths/apps/appId/scim/service-provider-config.d.ts +2 -0
- package/api/paths/apps/appId/scim/service-provider-config.js +22 -0
- package/api/paths/apps/appId/scim/users/userId.d.ts +2 -0
- package/api/paths/apps/appId/scim/users/userId.js +92 -0
- package/api/paths/apps/appId/scim/users.d.ts +2 -0
- package/api/paths/apps/appId/scim/users.js +58 -0
- package/api/paths/apps/appId/screenshots/screenshotId.d.ts +2 -0
- package/api/paths/apps/appId/screenshots/screenshotId.js +28 -0
- package/api/paths/apps/appId/screenshots.d.ts +2 -0
- package/api/paths/apps/appId/screenshots.js +55 -0
- package/api/paths/apps/appId/secrets/oauth2/secretId/verify.d.ts +2 -0
- package/api/paths/apps/appId/secrets/oauth2/secretId/verify.js +47 -0
- package/api/paths/apps/appId/secrets/oauth2/secretId.d.ts +2 -0
- package/api/paths/apps/appId/secrets/oauth2/secretId.js +60 -0
- package/api/paths/apps/appId/secrets/oauth2.d.ts +2 -0
- package/api/paths/apps/appId/secrets/oauth2.js +54 -0
- package/api/paths/apps/appId/secrets/saml/secretId.d.ts +2 -0
- package/api/paths/apps/appId/secrets/saml/secretId.js +39 -0
- package/api/paths/apps/appId/secrets/saml.d.ts +2 -0
- package/api/paths/apps/appId/secrets/saml.js +54 -0
- package/api/paths/apps/appId/secrets/scim.d.ts +2 -0
- package/api/paths/apps/appId/secrets/scim.js +43 -0
- package/api/paths/apps/appId/secrets/service/secretId.d.ts +2 -0
- package/api/paths/apps/appId/secrets/service/secretId.js +39 -0
- package/api/paths/apps/appId/secrets/service.d.ts +2 -0
- package/api/paths/apps/appId/secrets/service.js +54 -0
- package/api/paths/apps/appId/secrets/ssl.d.ts +2 -0
- package/api/paths/apps/appId/secrets/ssl.js +37 -0
- package/api/paths/apps/appId/snapshots/snapshotId.d.ts +2 -0
- package/api/paths/apps/appId/snapshots/snapshotId.js +47 -0
- package/api/paths/apps/appId/snapshots.d.ts +2 -0
- package/api/paths/apps/appId/snapshots.js +40 -0
- package/api/paths/apps/appId/style/block/organizationId/blockId.d.ts +2 -0
- package/api/paths/apps/appId/style/block/organizationId/blockId.js +53 -0
- package/api/paths/apps/appId/style/core.d.ts +2 -0
- package/api/paths/apps/appId/style/core.js +17 -0
- package/api/paths/apps/appId/style/shared.d.ts +2 -0
- package/api/paths/apps/appId/style/shared.js +17 -0
- package/api/paths/apps/appId/subscriptions.d.ts +2 -0
- package/api/paths/apps/appId/subscriptions.js +91 -0
- package/api/paths/apps/appId/variables/variableId.d.ts +2 -0
- package/api/paths/apps/appId/variables/variableId.js +39 -0
- package/api/paths/apps/appId/variables.d.ts +2 -0
- package/api/paths/apps/appId/variables.js +53 -0
- package/api/paths/apps/appId.d.ts +2 -0
- package/api/paths/apps/appId.js +175 -0
- package/api/paths/apps.d.ts +1 -1
- package/api/paths/apps.js +95 -1518
- package/api/paths/auth/email/login.d.ts +2 -0
- package/api/paths/auth/email/login.js +10 -0
- package/api/paths/auth/email/register.d.ts +2 -0
- package/api/paths/auth/email/register.js +45 -0
- package/api/paths/auth/email/requestResetPassword.d.ts +2 -0
- package/api/paths/auth/email/requestResetPassword.js +30 -0
- package/api/paths/auth/email/resendVerification.d.ts +2 -0
- package/api/paths/auth/email/resendVerification.js +31 -0
- package/api/paths/auth/email/resetPassword.d.ts +2 -0
- package/api/paths/auth/email/resetPassword.js +33 -0
- package/api/paths/auth/email/verify.d.ts +2 -0
- package/api/paths/auth/email/verify.js +30 -0
- package/api/paths/auth/oauth2/authorizations/connect.d.ts +2 -0
- package/api/paths/auth/oauth2/authorizations/connect.js +45 -0
- package/api/paths/auth/oauth2/authorizations/register.d.ts +2 -0
- package/api/paths/auth/oauth2/authorizations/register.js +32 -0
- package/api/paths/auth/refreshToken.d.ts +2 -0
- package/api/paths/auth/refreshToken.js +26 -0
- package/api/paths/blocks/organizationId/blockId/versions/list.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId/versions/list.js +27 -0
- package/api/paths/blocks/organizationId/blockId/versions/version/asset.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId/versions/version/asset.js +24 -0
- package/api/paths/blocks/organizationId/blockId/versions/version/icon.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId/versions/version/icon.js +18 -0
- package/api/paths/blocks/organizationId/blockId/versions/version/messages/language.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId/versions/version/messages/language.js +37 -0
- package/api/paths/blocks/organizationId/blockId/versions/version.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId/versions/version.js +29 -0
- package/api/paths/blocks/organizationId/blockId/versions.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId/versions.js +27 -0
- package/api/paths/blocks/organizationId/blockId.d.ts +2 -0
- package/api/paths/blocks/organizationId/blockId.js +18 -0
- package/api/paths/blocks/versions/blockVersion.js +21 -0
- package/api/paths/blocks.d.ts +1 -1
- package/api/paths/blocks.js +29 -204
- package/api/paths/containerLogs.d.ts +1 -1
- package/api/paths/containerLogs.js +28 -30
- package/api/paths/group-invites/token/respond.d.ts +2 -0
- package/api/paths/group-invites/token/respond.js +42 -0
- package/api/paths/group-invites/token.d.ts +2 -0
- package/api/paths/group-invites/token.js +23 -0
- package/api/paths/group-members/groupMemberId/role.d.ts +2 -0
- package/api/paths/group-members/groupMemberId/role.js +40 -0
- package/api/paths/group-members/groupMemberId.d.ts +2 -0
- package/api/paths/group-members/groupMemberId.js +34 -0
- package/api/paths/groups/groupId/invites.d.ts +2 -0
- package/api/paths/groups/groupId/invites.js +87 -0
- package/api/paths/groups/groupId/members.d.ts +2 -0
- package/api/paths/groups/groupId/members.js +34 -0
- package/api/paths/groups/groupId.d.ts +2 -0
- package/api/paths/groups/groupId.js +86 -0
- package/api/paths/health.d.ts +1 -1
- package/api/paths/health.js +12 -66
- package/api/paths/index.d.ts +145 -136
- package/api/paths/index.js +294 -58
- package/api/paths/messages/language.d.ts +2 -0
- package/api/paths/messages/language.js +21 -0
- package/api/paths/messages.d.ts +2 -0
- package/api/paths/messages.js +26 -0
- package/api/paths/organization-invites/token/respond.d.ts +2 -0
- package/api/paths/organization-invites/token/respond.js +42 -0
- package/api/paths/organization-invites/token.d.ts +2 -0
- package/api/paths/organization-invites/token.js +23 -0
- package/api/paths/organizations/organizationId/appCollections.d.ts +2 -0
- package/api/paths/organizations/organizationId/appCollections.js +76 -0
- package/api/paths/organizations/organizationId/apps/import.d.ts +2 -0
- package/api/paths/organizations/organizationId/apps/import.js +26 -0
- package/api/paths/organizations/organizationId/apps.d.ts +2 -0
- package/api/paths/organizations/organizationId/apps.js +33 -0
- package/api/paths/organizations/organizationId/blocks.d.ts +2 -0
- package/api/paths/organizations/organizationId/blocks.js +25 -0
- package/api/paths/organizations/organizationId/icon.d.ts +2 -0
- package/api/paths/organizations/organizationId/icon.js +14 -0
- package/api/paths/organizations/organizationId/invites/resend.d.ts +2 -0
- package/api/paths/organizations/organizationId/invites/resend.js +32 -0
- package/api/paths/organizations/organizationId/invites.d.ts +2 -0
- package/api/paths/organizations/organizationId/invites.js +108 -0
- package/api/paths/organizations/organizationId/members/memberId/role.d.ts +2 -0
- package/api/paths/organizations/organizationId/members/memberId/role.js +50 -0
- package/api/paths/organizations/organizationId/members/memberId.d.ts +2 -0
- package/api/paths/organizations/organizationId/members/memberId.js +25 -0
- package/api/paths/organizations/organizationId/members.d.ts +2 -0
- package/api/paths/organizations/organizationId/members.js +25 -0
- package/api/paths/organizations/organizationId.d.ts +2 -0
- package/api/paths/organizations/organizationId.js +67 -0
- package/api/paths/organizations.d.ts +1 -1
- package/api/paths/organizations.js +46 -452
- package/api/paths/ssl.d.ts +2 -0
- package/api/paths/ssl.js +31 -0
- package/api/paths/timezones.d.ts +2 -0
- package/api/paths/timezones.js +23 -0
- package/api/paths/trainingBlocks/trainingBlockId.d.ts +2 -0
- package/api/paths/trainingBlocks/trainingBlockId.js +41 -0
- package/api/paths/trainings/trainingId/blocks.d.ts +2 -0
- package/api/paths/trainings/trainingId/blocks.js +51 -0
- package/api/paths/trainings/trainingId/users/current.d.ts +2 -0
- package/api/paths/trainings/trainingId/users/current.js +62 -0
- package/api/paths/trainings/trainingId/users.d.ts +2 -0
- package/api/paths/trainings/trainingId/users.js +25 -0
- package/api/paths/trainings/trainingId.d.ts +2 -0
- package/api/paths/trainings/trainingId.js +85 -0
- package/api/paths/trainings.d.ts +1 -1
- package/api/paths/trainings.js +26 -287
- package/api/paths/users/current/apps/accounts.d.ts +2 -0
- package/api/paths/users/current/apps/accounts.js +24 -0
- package/api/paths/users/current/apps/appId/account.d.ts +2 -0
- package/api/paths/users/current/apps/appId/account.js +65 -0
- package/api/paths/users/current/apps.d.ts +2 -0
- package/api/paths/users/current/apps.js +32 -0
- package/api/paths/users/current/auth/oauth2/apps/appId/consent/agree.d.ts +2 -0
- package/api/paths/users/current/auth/oauth2/apps/appId/consent/agree.js +12 -0
- package/api/paths/users/current/auth/oauth2/apps/appId/consent/verify.d.ts +2 -0
- package/api/paths/users/current/auth/oauth2/apps/appId/consent/verify.js +12 -0
- package/api/paths/users/current/auth/oauth2/authorizations.d.ts +2 -0
- package/api/paths/users/current/auth/oauth2/authorizations.js +43 -0
- package/api/paths/users/current/auth/oauth2/clientCredentials/clientId.d.ts +2 -0
- package/api/paths/users/current/auth/oauth2/clientCredentials/clientId.js +23 -0
- package/api/paths/users/current/auth/oauth2/clientCredentials.d.ts +2 -0
- package/api/paths/users/current/auth/oauth2/clientCredentials.js +53 -0
- package/api/paths/users/current/emails.d.ts +2 -0
- package/api/paths/users/current/emails.js +73 -0
- package/api/paths/users/current/organizations.d.ts +2 -0
- package/api/paths/users/current/organizations.js +29 -0
- package/api/paths/users/current/unsubscribe.d.ts +2 -0
- package/api/paths/users/current/unsubscribe.js +29 -0
- package/api/paths/users/current.d.ts +2 -0
- package/api/paths/users/current.js +43 -0
- package/api/paths/users/subscribed.d.ts +2 -0
- package/api/paths/users/subscribed.js +12 -0
- package/api/tags/index.d.ts +2 -1
- package/api/tags/index.js +170 -8
- package/appMembers.d.ts +1 -0
- package/appMembers.js +9 -0
- package/authorization.d.ts +12 -0
- package/authorization.js +171 -0
- package/constants/index.d.ts +0 -2
- package/constants/index.js +0 -2
- package/constants/scopes.d.ts +1 -1
- package/constants/scopes.js +2 -2
- package/examples.js +42 -14
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/reference-schemas/remappers/arrays.js +31 -0
- package/reference-schemas/remappers/data.js +23 -38
- package/reference-schemas/remappers/unsorted.js +18 -0
- package/remap.d.ts +3 -7
- package/remap.js +24 -2
- package/remap.test.js +79 -9
- package/validation.js +396 -83
- package/validation.test.js +1039 -230
- package/api/components/parameters/$team.d.ts +0 -2
- package/api/components/parameters/$team.js +0 -8
- package/api/components/parameters/appServiceId.d.ts +0 -2
- package/api/components/parameters/memberEmail.d.ts +0 -2
- package/api/components/parameters/memberEmail.js +0 -8
- package/api/components/schemas/TabsPageActionsDefinition.d.ts +0 -2
- package/api/components/schemas/TeamInviteActionDefinition.d.ts +0 -1
- package/api/components/schemas/TeamJoinActionDefinition.d.ts +0 -1
- package/api/components/schemas/TeamJoinActionDefinition.js +0 -14
- package/api/components/schemas/TeamListActionDefinition.d.ts +0 -1
- package/api/components/schemas/TeamListActionDefinition.js +0 -14
- package/api/components/schemas/TeamMembersActionDefinition.d.ts +0 -1
- package/api/components/schemas/TeamsDefinition.d.ts +0 -2
- package/api/components/schemas/TeamsDefinition.js +0 -28
- package/api/components/schemas/UserCreateActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserCreateActionDefinition.js +0 -33
- package/api/components/schemas/UserLoginActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserLoginActionDefinition.js +0 -22
- package/api/components/schemas/UserLogoutActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserPropertyDefinition.d.ts +0 -2
- package/api/components/schemas/UserQueryActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserQueryActionDefinition.js +0 -20
- package/api/components/schemas/UserRegisterActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserRegisterActionDefinition.js +0 -37
- package/api/components/schemas/UserRemoveActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserRemoveActionDefinition.js +0 -20
- package/api/components/schemas/UserUpdateActionDefinition.d.ts +0 -1
- package/api/components/schemas/UserUpdateActionDefinition.js +0 -36
- package/api/components/schemas/UsersDefinition.d.ts +0 -2
- package/api/components/schemas/UsersDefinition.js +0 -17
- package/api/paths/appMessages.d.ts +0 -2
- package/api/paths/appMessages.js +0 -120
- package/api/paths/appOAuth2Secrets.d.ts +0 -2
- package/api/paths/appOAuth2Secrets.js +0 -161
- package/api/paths/appQuotas.d.ts +0 -2
- package/api/paths/appQuotas.js +0 -38
- package/api/paths/appSSLSecrets.d.ts +0 -2
- package/api/paths/appSSLSecrets.js +0 -39
- package/api/paths/appSamlSecrets.d.ts +0 -2
- package/api/paths/appSamlSecrets.js +0 -94
- package/api/paths/appScimEndpoints.d.ts +0 -2
- package/api/paths/appScimEndpoints.js +0 -260
- package/api/paths/appScimSecrets.d.ts +0 -2
- package/api/paths/appScimSecrets.js +0 -45
- package/api/paths/appServiceSecrets.d.ts +0 -2
- package/api/paths/appServiceSecrets.js +0 -94
- package/api/paths/appVariables.d.ts +0 -2
- package/api/paths/appVariables.js +0 -93
- package/api/paths/appsembleMessages.d.ts +0 -2
- package/api/paths/appsembleMessages.js +0 -48
- package/api/paths/assets.d.ts +0 -2
- package/api/paths/assets.js +0 -213
- package/api/paths/emails.d.ts +0 -2
- package/api/paths/emails.js +0 -167
- package/api/paths/invite.d.ts +0 -2
- package/api/paths/invite.js +0 -25
- package/api/paths/oauth2ClientCredentials.d.ts +0 -2
- package/api/paths/oauth2ClientCredentials.js +0 -77
- package/api/paths/oauth2Login.d.ts +0 -2
- package/api/paths/oauth2Login.js +0 -119
- package/api/paths/oauth2Provider.d.ts +0 -2
- package/api/paths/oauth2Provider.js +0 -75
- package/api/paths/resourceHistory.d.ts +0 -2
- package/api/paths/resourceHistory.js +0 -31
- package/api/paths/resources.d.ts +0 -2
- package/api/paths/resources.js +0 -395
- package/api/paths/saml.d.ts +0 -2
- package/api/paths/saml.js +0 -126
- package/api/paths/templates.d.ts +0 -2
- package/api/paths/templates.js +0 -96
- package/api/paths/user.d.ts +0 -2
- package/api/paths/user.js +0 -649
- package/api/tags/app.d.ts +0 -2
- package/api/tags/app.js +0 -5
- package/api/tags/appMember.d.ts +0 -2
- package/api/tags/appMember.js +0 -5
- package/api/tags/asset.d.ts +0 -2
- package/api/tags/asset.js +0 -5
- package/api/tags/auth.d.ts +0 -2
- package/api/tags/auth.js +0 -5
- package/api/tags/language.d.ts +0 -2
- package/api/tags/language.js +0 -5
- package/api/tags/organization.d.ts +0 -2
- package/api/tags/organization.js +0 -5
- package/api/tags/resource.d.ts +0 -2
- package/api/tags/resource.js +0 -5
- package/api/tags/template.d.ts +0 -2
- package/api/tags/template.js +0 -5
- package/api/tags/user.d.ts +0 -2
- package/api/tags/user.js +0 -5
- package/appSecurity.d.ts +0 -9
- package/appSecurity.js +0 -41
- package/appSecurity.test.d.ts +0 -1
- package/appSecurity.test.js +0 -114
- package/checkAppRole.d.ts +0 -11
- package/checkAppRole.js +0 -34
- package/constants/Permission.d.ts +0 -114
- package/constants/Permission.js +0 -116
- package/constants/roles.d.ts +0 -16
- package/constants/roles.js +0 -58
- /package/api/paths/{action.d.ts → blocks/versions/blockVersion.d.ts} +0 -0
package/authorization.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { appOrganizationPermissionMapping, AppPermission, PredefinedAppRole, predefinedAppRolePermissions, predefinedOrganizationRolePermissions, } from '@appsemble/types';
|
|
2
|
+
function checkAppPermissions(acquiredPermissions, requiredPermissions) {
|
|
3
|
+
const customAppResourcePermissionPattern = /^\$resource:[^:]+:(get|query|create|delete|patch|update)$/;
|
|
4
|
+
const customAppOwnResourcePermissionPattern = /^\$resource:[^:]+:own:(get|query|delete|patch|update)$/;
|
|
5
|
+
const customAppResourceViewPermissionPattern = /^\$resource:[^:]+:(get|query):[^:]+$/;
|
|
6
|
+
return requiredPermissions.every((p) => {
|
|
7
|
+
if (acquiredPermissions.includes(p)) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
if (customAppResourcePermissionPattern.test(p)) {
|
|
11
|
+
const [, , resourceAction] = p.split(':');
|
|
12
|
+
return acquiredPermissions.includes(`$resource:all:${resourceAction}`);
|
|
13
|
+
}
|
|
14
|
+
if (customAppOwnResourcePermissionPattern.test(p)) {
|
|
15
|
+
const [, resourceName, , resourceAction] = p.split(':');
|
|
16
|
+
return (acquiredPermissions.includes(`$resource:all:${resourceAction}`) ||
|
|
17
|
+
acquiredPermissions.includes(`$resource:all:own:${resourceAction}`) ||
|
|
18
|
+
acquiredPermissions.includes(`$resource:${resourceName}:${resourceAction}`));
|
|
19
|
+
}
|
|
20
|
+
if (customAppResourceViewPermissionPattern.test(p)) {
|
|
21
|
+
const [, resourceName, resourceAction, view] = p.split(':');
|
|
22
|
+
return (acquiredPermissions.includes(`$resource:${resourceName}:${resourceAction}`) ||
|
|
23
|
+
acquiredPermissions.includes(`$resource:all:${resourceAction}`) ||
|
|
24
|
+
acquiredPermissions.includes(`$resource:all:${resourceAction}:${view}`));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export function getAppInheritedRoles(appSecurityDefinition, roles, accumulatedRoles = []) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!appSecurityDefinition || !roles) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
for (const role of roles) {
|
|
34
|
+
if (!accumulatedRoles.includes(role)) {
|
|
35
|
+
accumulatedRoles.push(role);
|
|
36
|
+
const roleDefinition = (_a = appSecurityDefinition.roles) === null || _a === void 0 ? void 0 : _a[role];
|
|
37
|
+
if (roleDefinition && roleDefinition.inherits) {
|
|
38
|
+
accumulatedRoles.push(...getAppInheritedRoles(appSecurityDefinition, roleDefinition.inherits, accumulatedRoles));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return Array.from(new Set(accumulatedRoles));
|
|
43
|
+
}
|
|
44
|
+
export function getAppRolePermissions(appSecurityDefinition, roles) {
|
|
45
|
+
var _a;
|
|
46
|
+
const accumulatedPermissions = [];
|
|
47
|
+
const inheritedRoles = getAppInheritedRoles(appSecurityDefinition, roles);
|
|
48
|
+
for (const role of inheritedRoles) {
|
|
49
|
+
const roleDefinition = (_a = appSecurityDefinition.roles) === null || _a === void 0 ? void 0 : _a[role];
|
|
50
|
+
if (roleDefinition) {
|
|
51
|
+
const rolePermissions = roleDefinition.permissions;
|
|
52
|
+
if (rolePermissions) {
|
|
53
|
+
accumulatedPermissions.push(...rolePermissions);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const predefinedRolePermissions = predefinedAppRolePermissions[role];
|
|
58
|
+
if (predefinedRolePermissions) {
|
|
59
|
+
accumulatedPermissions.push(...predefinedRolePermissions);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return Array.from(new Set(accumulatedPermissions));
|
|
64
|
+
}
|
|
65
|
+
export function getGuestAppPermissions(appSecurityDefinition) {
|
|
66
|
+
if (!appSecurityDefinition || !appSecurityDefinition.guest) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
return [
|
|
70
|
+
...(appSecurityDefinition.guest.permissions || []),
|
|
71
|
+
...getAppRolePermissions(appSecurityDefinition, appSecurityDefinition.guest.inherits),
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
export function checkGuestAppPermissions(appSecurityDefinition, requiredPermissions) {
|
|
75
|
+
const guestPermissions = getGuestAppPermissions(appSecurityDefinition);
|
|
76
|
+
return checkAppPermissions(guestPermissions, requiredPermissions);
|
|
77
|
+
}
|
|
78
|
+
export function getAppRoles(appSecurityDefinition) {
|
|
79
|
+
return Array.from(new Set([
|
|
80
|
+
...Object.keys((appSecurityDefinition === null || appSecurityDefinition === void 0 ? void 0 : appSecurityDefinition.roles) || {}),
|
|
81
|
+
...Object.keys(PredefinedAppRole),
|
|
82
|
+
]));
|
|
83
|
+
}
|
|
84
|
+
export function getAppPossibleGuestPermissions(appDefinition) {
|
|
85
|
+
const possibleAllViews = {};
|
|
86
|
+
const resourceDefinitions = Object.values(appDefinition.resources || {});
|
|
87
|
+
for (const resourceDefinition of resourceDefinitions) {
|
|
88
|
+
for (const view of Object.keys(resourceDefinition.views || {})) {
|
|
89
|
+
possibleAllViews[view] = true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const view of Object.keys(possibleAllViews)) {
|
|
93
|
+
if (resourceDefinitions.some((resourceDefinition) => { var _a; return !((_a = resourceDefinition.views) === null || _a === void 0 ? void 0 : _a[view]); })) {
|
|
94
|
+
possibleAllViews[view] = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const view in possibleAllViews) {
|
|
98
|
+
if (!possibleAllViews[view]) {
|
|
99
|
+
delete possibleAllViews[view];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return [
|
|
103
|
+
...Object.values(AppPermission),
|
|
104
|
+
...Object.entries(appDefinition.resources || {}).flatMap(([resourceName, resourceDefinition]) => [
|
|
105
|
+
`$resource:${resourceName}:create`,
|
|
106
|
+
`$resource:${resourceName}:query`,
|
|
107
|
+
`$resource:${resourceName}:get`,
|
|
108
|
+
`$resource:${resourceName}:update`,
|
|
109
|
+
`$resource:${resourceName}:patch`,
|
|
110
|
+
`$resource:${resourceName}:delete`,
|
|
111
|
+
...Object.keys(resourceDefinition.views || {}).flatMap((resourceView) => [
|
|
112
|
+
`$resource:${resourceName}:query:${resourceView}`,
|
|
113
|
+
`$resource:${resourceName}:get:${resourceView}`,
|
|
114
|
+
]),
|
|
115
|
+
...Object.keys(possibleAllViews).flatMap((view) => [
|
|
116
|
+
`$resource:all:query:${view}`,
|
|
117
|
+
`$resource:all:get:${view}`,
|
|
118
|
+
]),
|
|
119
|
+
]),
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
export function getAppPossiblePermissions(appDefinition) {
|
|
123
|
+
return [
|
|
124
|
+
...getAppPossibleGuestPermissions(appDefinition),
|
|
125
|
+
...Object.keys(appDefinition.resources || {}).flatMap((resourceName) => [
|
|
126
|
+
`$resource:${resourceName}:own:query`,
|
|
127
|
+
`$resource:${resourceName}:own:get`,
|
|
128
|
+
`$resource:${resourceName}:own:update`,
|
|
129
|
+
`$resource:${resourceName}:own:patch`,
|
|
130
|
+
`$resource:${resourceName}:own:delete`,
|
|
131
|
+
]),
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
export function getAppRolesByPermissions(appSecurityDefinition, requiredPermissions) {
|
|
135
|
+
const roles = getAppRoles(appSecurityDefinition);
|
|
136
|
+
const compliantRoles = [];
|
|
137
|
+
for (const role of roles) {
|
|
138
|
+
if (checkAppPermissions(getAppRolePermissions(appSecurityDefinition, [role]), requiredPermissions)) {
|
|
139
|
+
compliantRoles.push(role);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (checkAppPermissions(getGuestAppPermissions(appSecurityDefinition), requiredPermissions)) {
|
|
143
|
+
compliantRoles.push('Guest');
|
|
144
|
+
}
|
|
145
|
+
return compliantRoles;
|
|
146
|
+
}
|
|
147
|
+
export function checkAppRoleAppPermissions(appSecurityDefinition, appRole, requiredPermissions) {
|
|
148
|
+
const appRolePermissions = getAppRolePermissions(appSecurityDefinition, [appRole]);
|
|
149
|
+
return checkAppPermissions(appRolePermissions, requiredPermissions);
|
|
150
|
+
}
|
|
151
|
+
export function checkOrganizationRoleAppPermissions(organizationRole, requiredPermissions) {
|
|
152
|
+
if (!organizationRole) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
const organizationRolePermissions = predefinedOrganizationRolePermissions[organizationRole];
|
|
156
|
+
return requiredPermissions.every((p) => {
|
|
157
|
+
let mappedPermission = appOrganizationPermissionMapping[p];
|
|
158
|
+
if (!mappedPermission) {
|
|
159
|
+
const customAppPermission = p;
|
|
160
|
+
if (customAppPermission.startsWith('$resource')) {
|
|
161
|
+
mappedPermission =
|
|
162
|
+
appOrganizationPermissionMapping[p.replace(/:[^:]*:/, ':all:')];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return organizationRolePermissions.includes(mappedPermission);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
export function checkOrganizationRoleOrganizationPermissions(organizationRole, requiredPermissions) {
|
|
169
|
+
return requiredPermissions.every((p) => predefinedOrganizationRolePermissions[organizationRole].includes(p));
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=authorization.js.map
|
package/constants/index.d.ts
CHANGED
package/constants/index.js
CHANGED
package/constants/scopes.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* All known OAuth2 scopes for client credentials.
|
|
3
3
|
*/
|
|
4
|
-
export declare const scopes: readonly ["apps:export", "apps:write", "apps:delete", "blocks:write", "blocks:delete", "organizations:write", "resources:read", "resources:write", "assets:write", "
|
|
4
|
+
export declare const scopes: readonly ["apps:export", "apps:write", "apps:delete", "blocks:write", "blocks:delete", "organizations:write", "resources:read", "resources:write", "assets:write", "groups:read", "groups:write"];
|
package/constants/scopes.js
CHANGED
package/examples.js
CHANGED
|
@@ -27,12 +27,17 @@ export const examples = {
|
|
|
27
27
|
},
|
|
28
28
|
result: 'https://example-app.example-organization.example.com',
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
'app.member': {
|
|
31
31
|
input: null,
|
|
32
32
|
remapper: {},
|
|
33
33
|
result: {},
|
|
34
34
|
skip: true,
|
|
35
35
|
},
|
|
36
|
+
type: {
|
|
37
|
+
input: [1, 2, 3],
|
|
38
|
+
remapper: { type: null },
|
|
39
|
+
result: 'array',
|
|
40
|
+
},
|
|
36
41
|
array: {
|
|
37
42
|
input: ['a', 'b', 'c'],
|
|
38
43
|
remapper: {
|
|
@@ -112,6 +117,30 @@ export const examples = {
|
|
|
112
117
|
},
|
|
113
118
|
],
|
|
114
119
|
},
|
|
120
|
+
'array.filter': {
|
|
121
|
+
input: [
|
|
122
|
+
{
|
|
123
|
+
name: 'Peter',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'Louis',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'Brian',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
remapper: {
|
|
133
|
+
'array.filter': {
|
|
134
|
+
equals: [
|
|
135
|
+
{
|
|
136
|
+
prop: 'name',
|
|
137
|
+
},
|
|
138
|
+
'Louis',
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
result: [{ name: 'Louis' }],
|
|
143
|
+
},
|
|
115
144
|
'array.find': {
|
|
116
145
|
input: [
|
|
117
146
|
{
|
|
@@ -649,12 +678,6 @@ export const examples = {
|
|
|
649
678
|
result: {},
|
|
650
679
|
skip: true,
|
|
651
680
|
},
|
|
652
|
-
user: {
|
|
653
|
-
input: null,
|
|
654
|
-
remapper: {},
|
|
655
|
-
result: {},
|
|
656
|
-
skip: true,
|
|
657
|
-
},
|
|
658
681
|
container: {
|
|
659
682
|
input: null,
|
|
660
683
|
remapper: {},
|
|
@@ -689,18 +712,23 @@ export function createExampleContext(url, lang, userInfo, history) {
|
|
|
689
712
|
getVariable: (name) => (name === 'MY_VARIABLE' ? 'variable value' : null),
|
|
690
713
|
url: String(url),
|
|
691
714
|
appUrl: `${url.protocol}//example-app.example-organization.${url.host}`,
|
|
692
|
-
userInfo: userInfo !== null && userInfo !== void 0 ? userInfo : {
|
|
693
|
-
sub: 'default-example-sub',
|
|
694
|
-
name: 'default-example-name',
|
|
695
|
-
email: 'default@example.com',
|
|
696
|
-
email_verified: false,
|
|
697
|
-
},
|
|
698
715
|
context: {},
|
|
699
716
|
history: history !== null && history !== void 0 ? history : ['Default example value'],
|
|
700
717
|
appId: 0,
|
|
701
718
|
locale: 'en',
|
|
702
719
|
pageData: { default: 'Page data' },
|
|
703
|
-
|
|
720
|
+
appMemberInfo: {
|
|
721
|
+
sub: 'default-example-id',
|
|
722
|
+
email: 'default-app-member@example.com',
|
|
723
|
+
email_verified: true,
|
|
724
|
+
name: 'default-example-name',
|
|
725
|
+
demo: false,
|
|
726
|
+
role: 'Member',
|
|
727
|
+
zoneinfo: 'Europe/Amsterdam',
|
|
728
|
+
properties: {
|
|
729
|
+
completedExamples: [],
|
|
730
|
+
},
|
|
731
|
+
},
|
|
704
732
|
};
|
|
705
733
|
}
|
|
706
734
|
//# sourceMappingURL=examples.js.map
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import './types.js';
|
|
2
2
|
export * from './api/index.js';
|
|
3
3
|
export * from './appMessages.js';
|
|
4
|
-
export * from './appSecurity.js';
|
|
5
4
|
export * from './blockUtils.js';
|
|
6
5
|
export * from './compare.js';
|
|
7
6
|
export * from './constants/index.js';
|
|
@@ -11,7 +10,6 @@ export * from './noop.js';
|
|
|
11
10
|
export * from './normalize.js';
|
|
12
11
|
export * from './validateStyle.js';
|
|
13
12
|
export * from './prefix.js';
|
|
14
|
-
export * from './checkAppRole.js';
|
|
15
13
|
export * from './formatRequestAction.js';
|
|
16
14
|
export * from './iterApp.js';
|
|
17
15
|
export * from './jsonschema.js';
|
|
@@ -29,6 +27,8 @@ export * from './serverActions.js';
|
|
|
29
27
|
export * from './validation.js';
|
|
30
28
|
export * from './serializeResource.js';
|
|
31
29
|
export * from './convertToCsv.js';
|
|
30
|
+
export * from './authorization.js';
|
|
31
|
+
export * from './appMembers.js';
|
|
32
32
|
export * from './assets.js';
|
|
33
33
|
export * from './validateAppMessages.js';
|
|
34
34
|
export * from './findPageByName.js';
|
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import './types.js';
|
|
2
2
|
export * from './api/index.js';
|
|
3
3
|
export * from './appMessages.js';
|
|
4
|
-
export * from './appSecurity.js';
|
|
5
4
|
export * from './blockUtils.js';
|
|
6
5
|
export * from './compare.js';
|
|
7
6
|
export * from './constants/index.js';
|
|
@@ -11,7 +10,6 @@ export * from './noop.js';
|
|
|
11
10
|
export * from './normalize.js';
|
|
12
11
|
export * from './validateStyle.js';
|
|
13
12
|
export * from './prefix.js';
|
|
14
|
-
export * from './checkAppRole.js';
|
|
15
13
|
export * from './formatRequestAction.js';
|
|
16
14
|
export * from './iterApp.js';
|
|
17
15
|
export * from './jsonschema.js';
|
|
@@ -29,6 +27,8 @@ export * from './serverActions.js';
|
|
|
29
27
|
export * from './validation.js';
|
|
30
28
|
export * from './serializeResource.js';
|
|
31
29
|
export * from './convertToCsv.js';
|
|
30
|
+
export * from './authorization.js';
|
|
31
|
+
export * from './appMembers.js';
|
|
32
32
|
export * from './assets.js';
|
|
33
33
|
export * from './validateAppMessages.js';
|
|
34
34
|
export * from './findPageByName.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.2",
|
|
4
4
|
"description": "Utility functions used in Appsemble internally",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"test": "vitest"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@appsemble/types": "0.
|
|
40
|
+
"@appsemble/types": "0.30.2",
|
|
41
41
|
"axios": "^1.0.0",
|
|
42
42
|
"cron-parser": "^4.0.0",
|
|
43
43
|
"date-fns": "^2.0.0",
|
|
@@ -100,6 +100,37 @@ remapper is a filtered list:
|
|
|
100
100
|
"age": 20
|
|
101
101
|
}
|
|
102
102
|
]
|
|
103
|
+
\`\`\`
|
|
104
|
+
`,
|
|
105
|
+
},
|
|
106
|
+
'array.filter': {
|
|
107
|
+
$ref: '#/components/schemas/RemapperDefinition',
|
|
108
|
+
description: `
|
|
109
|
+
Filters out values based on the input conditions provided.
|
|
110
|
+
|
|
111
|
+
For example:
|
|
112
|
+
|
|
113
|
+
${schemaExample('array.filter')}
|
|
114
|
+
|
|
115
|
+
Example of how it can be used to filter a number array.
|
|
116
|
+
|
|
117
|
+
Input:
|
|
118
|
+
|
|
119
|
+
\`\`\`json
|
|
120
|
+
[1,2,1,3,4,1,5]
|
|
121
|
+
\`\`\`
|
|
122
|
+
|
|
123
|
+
\`\`\`yaml
|
|
124
|
+
array.filter:
|
|
125
|
+
equals:
|
|
126
|
+
- array: item
|
|
127
|
+
- 1
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
Result:
|
|
131
|
+
|
|
132
|
+
\`\`\`json
|
|
133
|
+
[1,1,1]
|
|
103
134
|
\`\`\`
|
|
104
135
|
`,
|
|
105
136
|
},
|
|
@@ -304,22 +304,34 @@ parameters:
|
|
|
304
304
|
|
|
305
305
|
`,
|
|
306
306
|
},
|
|
307
|
-
|
|
308
|
-
enum: [
|
|
307
|
+
'app.member': {
|
|
308
|
+
enum: [
|
|
309
|
+
'sub',
|
|
310
|
+
'name',
|
|
311
|
+
'email',
|
|
312
|
+
'email_verified',
|
|
313
|
+
'picture',
|
|
314
|
+
'locale',
|
|
315
|
+
'zoneinfo',
|
|
316
|
+
'role',
|
|
317
|
+
'properties',
|
|
318
|
+
],
|
|
309
319
|
description: `
|
|
310
|
-
> **Note:** For this remapper to work, the
|
|
320
|
+
> **Note:** For this remapper to work, the app member that activated the remapper has to be logged in to
|
|
311
321
|
> the app
|
|
312
322
|
|
|
313
|
-
Provides some fields of
|
|
323
|
+
Provides some fields of app member information taken from the OpenID user info. These fields are:
|
|
314
324
|
|
|
315
|
-
- \`
|
|
316
|
-
- \`
|
|
317
|
-
- \`
|
|
325
|
+
- \`sub\`: The app member’s identifier
|
|
326
|
+
- \`name\`: The app member’s name
|
|
327
|
+
- \`email\`: The app member’s **primary** email address
|
|
328
|
+
- \`email_verified\`: Whether the app member’s primary email address is verified or not (\`boolean\`)
|
|
329
|
+
- \`picture\`: Full URL to the app member’s profile picture web address
|
|
330
|
+
- \`locale\`: The app member’s default language [\`BCP47\`](https://en.wikipedia.org/wiki/IETF_language_tag)
|
|
318
331
|
language tag (ex. \`en\`) (Broken)
|
|
319
|
-
- \`
|
|
320
|
-
- \`
|
|
321
|
-
- \`
|
|
322
|
-
- \`properties\`: Custom properties defined on the user
|
|
332
|
+
- \`zoneinfo\`: The app member’s timezone
|
|
333
|
+
- \`role\`: The role of the app member in the app
|
|
334
|
+
- \`properties\`: Custom properties defined on the app member
|
|
323
335
|
|
|
324
336
|
Example:
|
|
325
337
|
|
|
@@ -333,33 +345,6 @@ Example:
|
|
|
333
345
|
"sub": "5c6270e2-ad31-414f-bcab-6752a2c4dcfd",
|
|
334
346
|
"properties": {}
|
|
335
347
|
}
|
|
336
|
-
\`\`\`
|
|
337
|
-
`,
|
|
338
|
-
},
|
|
339
|
-
appMember: {
|
|
340
|
-
enum: ['userId', 'memberId', 'name', 'primary_email', 'role'],
|
|
341
|
-
description: `
|
|
342
|
-
> **Note:** For this remapper to work, the user that activated the remapper has to be logged in to
|
|
343
|
-
> the app
|
|
344
|
-
|
|
345
|
-
Provides some fields of the appMember object.
|
|
346
|
-
|
|
347
|
-
- \`userId\`: The id of the user to which the appMember object belongs.
|
|
348
|
-
- \`memberId\`: The id of the appMember object itself. This value should be used when fetching resources created by the current user.
|
|
349
|
-
- \`primary_email\`: User’s **primary** email address.
|
|
350
|
-
- \`name\`: The user’s name.
|
|
351
|
-
- \`role\`: User's role in the context of the app.
|
|
352
|
-
|
|
353
|
-
Example:
|
|
354
|
-
|
|
355
|
-
\`\`\`json
|
|
356
|
-
{
|
|
357
|
-
"memberId": "1f433c7a-54ea-466e-89f7-5dbb8f324b12",
|
|
358
|
-
"name": "Test User"
|
|
359
|
-
"primaryEmail": "example@hotmail.nl",
|
|
360
|
-
"role": "Medewerker",
|
|
361
|
-
"userId": "5c6270e2-ad31-414f-bcab-6752a2c4dcfd"
|
|
362
|
-
}
|
|
363
348
|
\`\`\`
|
|
364
349
|
`,
|
|
365
350
|
},
|
|
@@ -145,6 +145,24 @@ object will be checked. The result looks like this:
|
|
|
145
145
|
},
|
|
146
146
|
],
|
|
147
147
|
},
|
|
148
|
+
type: {
|
|
149
|
+
enum: [null],
|
|
150
|
+
description: `Returns the type of the input object
|
|
151
|
+
|
|
152
|
+
For example, with the following input value:
|
|
153
|
+
\`\`\`json
|
|
154
|
+
[0, 5, 7, 8]
|
|
155
|
+
\`\`\`
|
|
156
|
+
\`\`\`yaml
|
|
157
|
+
type: null
|
|
158
|
+
\`\`\`
|
|
159
|
+
|
|
160
|
+
The result will be:
|
|
161
|
+
\`\`\`json
|
|
162
|
+
"array"
|
|
163
|
+
\`\`\`
|
|
164
|
+
`,
|
|
165
|
+
},
|
|
148
166
|
log: {
|
|
149
167
|
enum: ['info', 'warn', 'error'],
|
|
150
168
|
description: `Logs in the browser's console and returns the incoming data and the remapper function's context.
|
package/remap.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AppMemberInfo, type Remapper, type ValueFromProcess } from '@appsemble/types';
|
|
2
2
|
import { type IntlMessageFormat } from 'intl-messageformat';
|
|
3
3
|
export interface IntlMessage {
|
|
4
4
|
id?: string;
|
|
@@ -46,17 +46,13 @@ export interface RemapperContext {
|
|
|
46
46
|
*/
|
|
47
47
|
pageData?: unknown;
|
|
48
48
|
/**
|
|
49
|
-
* The OpenID compatible userinfo object for the current
|
|
49
|
+
* The OpenID compatible userinfo object for the current app member.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
appMemberInfo: AppMemberInfo;
|
|
52
52
|
/**
|
|
53
53
|
* A custom context passed to the remap function.
|
|
54
54
|
*/
|
|
55
55
|
context: Record<string, any>;
|
|
56
|
-
/**
|
|
57
|
-
* The appMember object for the current user in the app.
|
|
58
|
-
*/
|
|
59
|
-
appMember: AppMember;
|
|
60
56
|
}
|
|
61
57
|
interface InternalContext extends RemapperContext {
|
|
62
58
|
root?: unknown;
|
package/remap.js
CHANGED
|
@@ -194,6 +194,16 @@ const mapperImplementations = {
|
|
|
194
194
|
}
|
|
195
195
|
return result;
|
|
196
196
|
},
|
|
197
|
+
type(args, input) {
|
|
198
|
+
// eslint-disable-next-line eqeqeq
|
|
199
|
+
if (input === null) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
if (Array.isArray(input)) {
|
|
203
|
+
return 'array';
|
|
204
|
+
}
|
|
205
|
+
return typeof input;
|
|
206
|
+
},
|
|
197
207
|
'array.map': (mapper, input, context) => {
|
|
198
208
|
var _a;
|
|
199
209
|
return (_a = input === null || input === void 0 ? void 0 : input.map((item, index) => remap(mapper, item, {
|
|
@@ -221,6 +231,19 @@ const mapperImplementations = {
|
|
|
221
231
|
});
|
|
222
232
|
},
|
|
223
233
|
array: (prop, input, context) => { var _a; return (_a = context.array) === null || _a === void 0 ? void 0 : _a[prop]; },
|
|
234
|
+
'array.filter'(mapper, input, context) {
|
|
235
|
+
if (!Array.isArray(input)) {
|
|
236
|
+
console.error(`${input} is not an array!`);
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
return input === null || input === void 0 ? void 0 : input.filter((item, index) => {
|
|
240
|
+
const remapped = remap(mapper, item, {
|
|
241
|
+
...context,
|
|
242
|
+
array: { index, length: input.length, item },
|
|
243
|
+
});
|
|
244
|
+
return remapped;
|
|
245
|
+
});
|
|
246
|
+
},
|
|
224
247
|
'array.find'(mapper, input, context) {
|
|
225
248
|
var _a;
|
|
226
249
|
if (!Array.isArray(input)) {
|
|
@@ -413,8 +436,7 @@ const mapperImplementations = {
|
|
|
413
436
|
const message = context.getMessage({ id: messageId });
|
|
414
437
|
return message.format() || `{${messageId}}`;
|
|
415
438
|
},
|
|
416
|
-
|
|
417
|
-
appMember: (property, input, context) => { var _a, _b; return (_b = (_a = context.userInfo) === null || _a === void 0 ? void 0 : _a.appMember) === null || _b === void 0 ? void 0 : _b[property]; },
|
|
439
|
+
'app.member': (property, input, context) => { var _a; return (_a = context.appMemberInfo) === null || _a === void 0 ? void 0 : _a[property]; },
|
|
418
440
|
container(property, input, context) {
|
|
419
441
|
// This value is replaced when the request is made
|
|
420
442
|
// By using the value of the release name
|