Leverage workspace activationStatus to decide if a workspace is activated or not (#6497)
An ACTIVE workspace is a workspace that has a complete workspaceSchema and is authorized to be browsed by users. In this PR, I'm: - introducing a new activationStatus: PENDING_CREATION (existing ACTIVE / INACTIVE) - removing workspaceService.isWorkspaceActivated (based on workspaceSchema existence which is not robust and checking activationStatus.ACTIVE instead) - removing dynamic activationStatus field on worksapce resolver (we can use the postgres column directly now that data has been migrated) - on user sign up creating the workspace in PENDING_CREATION, and on workspace activation setting it to ACTIVE - only re-activating a workspace if the current activationStatus is INACTIVE through billing webhooks (a PENDING_CREATION should stay PENDING and ACTIVE should stay ACTIVE)
This commit is contained in:
@ -162,6 +162,17 @@ export type ClientConfig = {
|
||||
telemetry: Telemetry;
|
||||
};
|
||||
|
||||
export type CreateServerlessFunctionFromFileInput = {
|
||||
description?: InputMaybe<Scalars['String']>;
|
||||
name: Scalars['String'];
|
||||
};
|
||||
|
||||
export type CreateServerlessFunctionInput = {
|
||||
code: Scalars['String'];
|
||||
description?: InputMaybe<Scalars['String']>;
|
||||
name: Scalars['String'];
|
||||
};
|
||||
|
||||
export type CursorPaging = {
|
||||
/** Paginate after opaque cursor */
|
||||
after?: InputMaybe<Scalars['ConnectionCursor']>;
|
||||
@ -178,6 +189,11 @@ export type DeleteOneObjectInput = {
|
||||
id: Scalars['UUID'];
|
||||
};
|
||||
|
||||
export type DeleteServerlessFunctionInput = {
|
||||
/** The id of the function. */
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
/** Schema update on a table */
|
||||
export enum DistantTableUpdate {
|
||||
ColumnsAdded = 'COLUMNS_ADDED',
|
||||
@ -310,14 +326,18 @@ export type Mutation = {
|
||||
checkoutSession: SessionEntity;
|
||||
createOneAppToken: AppToken;
|
||||
createOneObject: Object;
|
||||
createOneServerlessFunction: ServerlessFunction;
|
||||
createOneServerlessFunctionFromFile: ServerlessFunction;
|
||||
deleteCurrentWorkspace: Workspace;
|
||||
deleteOneObject: Object;
|
||||
deleteOneServerlessFunction: ServerlessFunction;
|
||||
deleteUser: User;
|
||||
disablePostgresProxy: PostgresCredentials;
|
||||
emailPasswordResetLink: EmailPasswordResetLink;
|
||||
enablePostgresProxy: PostgresCredentials;
|
||||
enableWorkflowTrigger: Scalars['Boolean'];
|
||||
exchangeAuthorizationCode: ExchangeAuthCode;
|
||||
executeOneServerlessFunction: ServerlessFunctionExecutionResult;
|
||||
generateApiKeyToken: ApiKeyToken;
|
||||
generateJWT: AuthTokens;
|
||||
generateTransientToken: TransientToken;
|
||||
@ -327,8 +347,10 @@ export type Mutation = {
|
||||
signUp: LoginToken;
|
||||
skipSyncEmailOnboardingStep: OnboardingStepSuccess;
|
||||
track: Analytics;
|
||||
triggerWorkflow: WorkflowTriggerResult;
|
||||
updateBillingSubscription: UpdateBillingEntity;
|
||||
updateOneObject: Object;
|
||||
updateOneServerlessFunction: ServerlessFunction;
|
||||
updatePasswordViaResetToken: InvalidatePassword;
|
||||
updateWorkspace: Workspace;
|
||||
uploadFile: Scalars['String'];
|
||||
@ -369,11 +391,27 @@ export type MutationCheckoutSessionArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateOneServerlessFunctionArgs = {
|
||||
input: CreateServerlessFunctionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateOneServerlessFunctionFromFileArgs = {
|
||||
file: Scalars['Upload'];
|
||||
input: CreateServerlessFunctionFromFileInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteOneObjectArgs = {
|
||||
input: DeleteOneObjectInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteOneServerlessFunctionArgs = {
|
||||
input: DeleteServerlessFunctionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationEmailPasswordResetLinkArgs = {
|
||||
email: Scalars['String'];
|
||||
};
|
||||
@ -391,6 +429,12 @@ export type MutationExchangeAuthorizationCodeArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationExecuteOneServerlessFunctionArgs = {
|
||||
id: Scalars['UUID'];
|
||||
payload?: InputMaybe<Scalars['JSON']>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationGenerateApiKeyTokenArgs = {
|
||||
apiKeyId: Scalars['String'];
|
||||
expiresAt: Scalars['String'];
|
||||
@ -431,11 +475,21 @@ export type MutationTrackArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationTriggerWorkflowArgs = {
|
||||
workflowVersionId: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateOneObjectArgs = {
|
||||
input: UpdateOneObjectInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateOneServerlessFunctionArgs = {
|
||||
input: UpdateServerlessFunctionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdatePasswordViaResetTokenArgs = {
|
||||
newPassword: Scalars['String'];
|
||||
passwordResetToken: Scalars['String'];
|
||||
@ -557,6 +611,8 @@ export type Query = {
|
||||
getTimelineThreadsFromPersonId: TimelineThreadsWithTotal;
|
||||
object: Object;
|
||||
objects: ObjectConnection;
|
||||
serverlessFunction: ServerlessFunction;
|
||||
serverlessFunctions: ServerlessFunctionConnection;
|
||||
validatePasswordResetToken: ValidatePasswordResetToken;
|
||||
};
|
||||
|
||||
@ -731,9 +787,21 @@ export type ServerlessFunctionEdge = {
|
||||
export type ServerlessFunctionExecutionResult = {
|
||||
__typename?: 'ServerlessFunctionExecutionResult';
|
||||
/** Execution result in JSON format */
|
||||
result: Scalars['JSON'];
|
||||
data?: Maybe<Scalars['JSON']>;
|
||||
/** Execution duration in milliseconds */
|
||||
duration: Scalars['Float'];
|
||||
/** Execution error in JSON format */
|
||||
error?: Maybe<Scalars['JSON']>;
|
||||
/** Execution status */
|
||||
status: ServerlessFunctionExecutionStatus;
|
||||
};
|
||||
|
||||
/** Status of the serverless function execution */
|
||||
export enum ServerlessFunctionExecutionStatus {
|
||||
Error = 'ERROR',
|
||||
Success = 'SUCCESS'
|
||||
}
|
||||
|
||||
/** SyncStatus of the serverlessFunction */
|
||||
export enum ServerlessFunctionSyncStatus {
|
||||
NotReady = 'NOT_READY',
|
||||
@ -896,6 +964,14 @@ export type UpdateOneObjectInput = {
|
||||
update: UpdateObjectPayload;
|
||||
};
|
||||
|
||||
export type UpdateServerlessFunctionInput = {
|
||||
code: Scalars['String'];
|
||||
description?: InputMaybe<Scalars['String']>;
|
||||
/** Id of the serverless function to execute */
|
||||
id: Scalars['UUID'];
|
||||
name: Scalars['String'];
|
||||
};
|
||||
|
||||
export type UpdateWorkspaceInput = {
|
||||
allowImpersonation?: InputMaybe<Scalars['Boolean']>;
|
||||
displayName?: InputMaybe<Scalars['String']>;
|
||||
@ -969,6 +1045,12 @@ export type Verify = {
|
||||
user: User;
|
||||
};
|
||||
|
||||
export type WorkflowTriggerResult = {
|
||||
__typename?: 'WorkflowTriggerResult';
|
||||
/** Execution result in JSON format */
|
||||
result?: Maybe<Scalars['JSON']>;
|
||||
};
|
||||
|
||||
export type Workspace = {
|
||||
__typename?: 'Workspace';
|
||||
activationStatus: WorkspaceActivationStatus;
|
||||
@ -1002,7 +1084,8 @@ export type WorkspaceFeatureFlagsArgs = {
|
||||
|
||||
export enum WorkspaceActivationStatus {
|
||||
Active = 'ACTIVE',
|
||||
Inactive = 'INACTIVE'
|
||||
Inactive = 'INACTIVE',
|
||||
PendingCreation = 'PENDING_CREATION'
|
||||
}
|
||||
|
||||
export type WorkspaceEdge = {
|
||||
|
||||
Reference in New Issue
Block a user