Skip to content

Commit

Permalink
Merge pull request #4366 from activepieces/feat/project-pieces
Browse files Browse the repository at this point in the history
feat: the ability to restrict pieces for each project
  • Loading branch information
abuaboud committed Apr 7, 2024
2 parents 7834210 + cb934e7 commit ecc01db
Show file tree
Hide file tree
Showing 53 changed files with 949 additions and 368 deletions.
176 changes: 104 additions & 72 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,34 @@
"projectId": {
"type": "string"
},
"stripeCustomerId": {
"type": "string"
},
"stripeSubscriptionId": {
"type": "string",
"nullable": true
},
"subscriptionStartDatetime": {
"type": "string"
},
"flowPlanName": {
"name": {
"type": "string"
},
"minimumPollingInterval": {
"type": "number"
},
"piecesFilterType": {
"anyOf": [
{
"type": "string",
"enum": [
"NONE"
]
},
{
"type": "string",
"enum": [
"ALLOWED"
]
}
]
},
"pieces": {
"type": "array",
"items": {
"type": "string"
}
},
"connections": {
"type": "number"
},
Expand All @@ -187,21 +199,17 @@
},
"tasks": {
"type": "number"
},
"tasksPerDay": {
"type": "number",
"nullable": true
}
},
"required": [
"id",
"created",
"updated",
"projectId",
"stripeCustomerId",
"subscriptionStartDatetime",
"flowPlanName",
"name",
"minimumPollingInterval",
"piecesFilterType",
"pieces",
"connections",
"teamMembers",
"tasks"
Expand Down Expand Up @@ -7775,22 +7783,34 @@
"projectId": {
"type": "string"
},
"stripeCustomerId": {
"type": "string"
},
"stripeSubscriptionId": {
"type": "string",
"nullable": true
},
"subscriptionStartDatetime": {
"type": "string"
},
"flowPlanName": {
"name": {
"type": "string"
},
"minimumPollingInterval": {
"type": "number"
},
"piecesFilterType": {
"anyOf": [
{
"type": "string",
"enum": [
"NONE"
]
},
{
"type": "string",
"enum": [
"ALLOWED"
]
}
]
},
"pieces": {
"type": "array",
"items": {
"type": "string"
}
},
"connections": {
"type": "number"
},
Expand All @@ -7799,21 +7819,17 @@
},
"tasks": {
"type": "number"
},
"tasksPerDay": {
"type": "number",
"nullable": true
}
},
"required": [
"id",
"created",
"updated",
"projectId",
"stripeCustomerId",
"subscriptionStartDatetime",
"flowPlanName",
"name",
"minimumPollingInterval",
"piecesFilterType",
"pieces",
"connections",
"teamMembers",
"tasks"
Expand Down Expand Up @@ -7953,22 +7969,34 @@
"projectId": {
"type": "string"
},
"stripeCustomerId": {
"type": "string"
},
"stripeSubscriptionId": {
"type": "string",
"nullable": true
},
"subscriptionStartDatetime": {
"type": "string"
},
"flowPlanName": {
"name": {
"type": "string"
},
"minimumPollingInterval": {
"type": "number"
},
"piecesFilterType": {
"anyOf": [
{
"type": "string",
"enum": [
"NONE"
]
},
{
"type": "string",
"enum": [
"ALLOWED"
]
}
]
},
"pieces": {
"type": "array",
"items": {
"type": "string"
}
},
"connections": {
"type": "number"
},
Expand All @@ -7977,21 +8005,17 @@
},
"tasks": {
"type": "number"
},
"tasksPerDay": {
"type": "number",
"nullable": true
}
},
"required": [
"id",
"created",
"updated",
"projectId",
"stripeCustomerId",
"subscriptionStartDatetime",
"flowPlanName",
"name",
"minimumPollingInterval",
"piecesFilterType",
"pieces",
"connections",
"teamMembers",
"tasks"
Expand Down Expand Up @@ -8177,22 +8201,34 @@
"projectId": {
"type": "string"
},
"stripeCustomerId": {
"type": "string"
},
"stripeSubscriptionId": {
"type": "string",
"nullable": true
},
"subscriptionStartDatetime": {
"type": "string"
},
"flowPlanName": {
"name": {
"type": "string"
},
"minimumPollingInterval": {
"type": "number"
},
"piecesFilterType": {
"anyOf": [
{
"type": "string",
"enum": [
"NONE"
]
},
{
"type": "string",
"enum": [
"ALLOWED"
]
}
]
},
"pieces": {
"type": "array",
"items": {
"type": "string"
}
},
"connections": {
"type": "number"
},
Expand All @@ -8201,21 +8237,17 @@
},
"tasks": {
"type": "number"
},
"tasksPerDay": {
"type": "number",
"nullable": true
}
},
"required": [
"id",
"created",
"updated",
"projectId",
"stripeCustomerId",
"subscriptionStartDatetime",
"flowPlanName",
"name",
"minimumPollingInterval",
"piecesFilterType",
"pieces",
"connections",
"teamMembers",
"tasks"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="ap-pl-16 lg:ap-px-12 ">
<div class="ap-flex ap-flex-col ap-gap-1 ap-justify-center ap-h-full">
<div class="ap-typography-body-1 ap-font-semibold">
{{project.plan.flowPlanName | planName}}
{{project.plan.name| planName}}
</div>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions packages/ee/shared/src/lib/billing/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PiecesFilterType } from '@activepieces/shared'

export * from './project-stripe'


Expand All @@ -7,6 +9,8 @@ export type FlowPlanLimits = {
minimumPollingInterval: number
connections: number
teamMembers: number
pieces: string[]
piecesFilterType: PiecesFilterType
}

export const MAXIMUM_ALLOWED_TASKS = 200000
Expand All @@ -16,6 +20,8 @@ export const DEFAULT_FREE_PLAN_LIMIT = {
tasks: 1000,
teamMembers: 1,
connections: 200,
pieces: [],
piecesFilterType: PiecesFilterType.NONE,
minimumPollingInterval: 5,
}

Expand All @@ -24,6 +30,8 @@ export const DEFAULT_PLATFORM_LIMIT = {
connections: 200,
tasks: 50000,
teamMembers: 5,
pieces: [],
piecesFilterType: PiecesFilterType.NONE,
minimumPollingInterval: 1,
}

Expand Down
10 changes: 6 additions & 4 deletions packages/ee/shared/src/lib/project/project-requests.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Static, Type } from "@sinclair/typebox";
import { NotificationStatus } from "@activepieces/shared";
import { NotificationStatus, PiecesFilterType } from "@activepieces/shared";

export const UpdateProjectPlatformRequest = Type.Object({
notifyStatus: Type.Enum(NotificationStatus),
displayName: Type.String(),
notifyStatus: Type.Optional(Type.Enum(NotificationStatus)),
displayName: Type.Optional(Type.String()),
plan: Type.Optional(Type.Object({
teamMembers: Type.Optional(Type.Number({})),
tasks: Type.Number({}),
tasks: Type.Optional(Type.Number({})),
pieces: Type.Optional(Type.Array(Type.String({}))),
piecesFilterType: Type.Optional(Type.Enum(PiecesFilterType)),
})),
})

Expand Down
4 changes: 2 additions & 2 deletions packages/server/api/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ import { managedAuthnModule } from './ee/managed-authn/managed-authn-module'
import { oauthAppModule } from './ee/oauth-apps/oauth-app.module'
import { otpModule } from './ee/otp/otp-module'
import { adminPieceModule } from './ee/pieces/admin-piece-module'
import { enterprisePieceMetadataServiceHooks } from './ee/pieces/enterprise-piece-metadata-service-hooks'
import { platformPieceServiceHooks } from './ee/pieces/piece-service/platform-piece-service-hooks'
import { enterprisePieceMetadataServiceHooks } from './ee/pieces/filters/enterprise-piece-metadata-service-hooks'
import { platformPieceModule } from './ee/pieces/platform-piece-module'
import { platformPieceServiceHooks } from './ee/pieces/service/platform-piece-service-hooks'
import { adminPlatformPieceModule } from './ee/platform/admin-platform.controller'
import { projectMemberModule } from './ee/project-members/project-member.module'
import { platformProjectModule } from './ee/projects/platform-project-module'
Expand Down
Loading

0 comments on commit ecc01db

Please sign in to comment.