From d315c858fd9bc8b7d05bc2b63155d744157c1016 Mon Sep 17 00:00:00 2001 From: Jamie Barton Date: Wed, 26 Jan 2022 14:16:15 +0000 Subject: [PATCH] feat: add registerChanges method --- src/generated/schema.ts | 1112 ++++++++++++++++++++++++++++++++------- src/migration.ts | 13 + 2 files changed, 946 insertions(+), 179 deletions(-) diff --git a/src/generated/schema.ts b/src/generated/schema.ts index bfa9504..68d92c9 100644 --- a/src/generated/schema.ts +++ b/src/generated/schema.ts @@ -57,6 +57,19 @@ export type GraphQLFilestack = GraphQLIAssetConfig & { security: GraphQLFilestackSecurityOptions; }; +export type GraphQLCommonFilestackSecurityOptions = { + __typename?: "CommonFilestackSecurityOptions"; + enabled: Scalars["Boolean"]; + auth?: Maybe; +}; + +export type GraphQLCommonFilestack = { + __typename?: "CommonFilestack"; + apiKey: Scalars["String"]; + path: Scalars["String"]; + security: GraphQLCommonFilestackSecurityOptions; +}; + export type GraphQLUpdateFilestackSecurityOptionsInput = { environmentId: Scalars["ID"]; enabled?: Maybe; @@ -80,7 +93,9 @@ export type GraphQLUpdateFilestackSecurityOptionsPayload = { export type GraphQLContentModel = { __typename?: "ContentModel"; models: Array; + components: Array; model: GraphQLIModel; + component: GraphQLComponent; assetModel: GraphQLIModel; enumerations: Array; locales: Array; @@ -93,10 +108,18 @@ export type GraphQLContentModelModelsArgs = { includeSystemModels?: Maybe; }; +export type GraphQLContentModelComponentsArgs = { + includeSystemComponents?: Maybe; +}; + export type GraphQLContentModelModelArgs = { id: Scalars["ID"]; }; +export type GraphQLContentModelComponentArgs = { + id: Scalars["ID"]; +}; + export type GraphQLContentModelEnumerationsArgs = { includeSystemEnumerations?: Maybe; }; @@ -127,7 +150,6 @@ export type GraphQLContentView = { model: GraphQLIModel; type: GraphQLContentViewType; isSystem: Scalars["Boolean"]; - createdBy?: Maybe; orderBy?: Maybe; columns: Array; viewGroup: GraphQLViewGroup; @@ -478,6 +500,11 @@ export enum GraphQLPermissionAction { ModelRead = "MODEL_READ", ModelUpdate = "MODEL_UPDATE", ModelDelete = "MODEL_DELETE", + /** Components */ + ComponentCreate = "COMPONENT_CREATE", + ComponentRead = "COMPONENT_READ", + ComponentUpdate = "COMPONENT_UPDATE", + ComponentDelete = "COMPONENT_DELETE", /** Locales */ LocaleCreate = "LOCALE_CREATE", LocaleRead = "LOCALE_READ", @@ -559,6 +586,10 @@ export enum GraphQLPermissionAction { ExtensionRead = "EXTENSION_READ", ExtensionUpdate = "EXTENSION_UPDATE", ExtensionDelete = "EXTENSION_DELETE", + /** Sidebar elements */ + SidebarElementCreate = "SIDEBAR_ELEMENT_CREATE", + SidebarElementUpdate = "SIDEBAR_ELEMENT_UPDATE", + SidebarElementDelete = "SIDEBAR_ELEMENT_DELETE", } export type GraphQLPermanentAuthTokenDefaultsInput = { @@ -702,13 +733,10 @@ export type GraphQLAuditLogsPayload = { }; export enum GraphQLLifecycleStepType { - ModelCreated = "MODEL_CREATED", - FieldCreated = "FIELD_CREATED", - WebhookCreated = "WEBHOOK_CREATED", - UserInvited = "USER_INVITED", + SchemaSetup = "SCHEMA_SETUP", ContentAdded = "CONTENT_ADDED", + ExploreContentApi = "EXPLORE_CONTENT_API", ApiPermissionsSet = "API_PERMISSIONS_SET", - SchemaSetup = "SCHEMA_SETUP", ExternalTraffic = "EXTERNAL_TRAFFIC", } @@ -833,6 +861,15 @@ export type GraphQLUpsertTemplatePayload = { gcms?: Maybe; }; +export type GraphQLMaxComplexityInput = { + gcms?: Maybe; +}; + +export type GraphQLMaxComplexityPayload = { + __typename?: "MaxComplexityPayload"; + gcms?: Maybe; +}; + export type GraphQL_BookOverLimitInput = { gcms?: Maybe; }; @@ -951,6 +988,7 @@ export type GraphQLRegion = { name: Scalars["String"]; isBeta: Scalars["Boolean"]; pingUrl?: Maybe; + isReadOnly: Scalars["Boolean"]; }; export type GraphQLDeleteRolePayload = { @@ -1540,7 +1578,7 @@ export type GraphQLEnvironmentExtensionArgs = { }; export type GraphQLEnvironmentDiffArgs = { - environmentId: Scalars["ID"]; + environmentName: Scalars["String"]; }; export type GraphQLPublicContentApiDefauts = { @@ -1870,6 +1908,7 @@ export type GraphQLUserViewer = GraphQLIViewer & { pendingProject?: Maybe; projects: Array; project?: Maybe; + commonAssetConfig: GraphQLCommonFilestack; }; export type GraphQLUserViewerPendingInviteArgs = { @@ -1959,11 +1998,29 @@ export type GraphQLSetUserAnalyticsInput = { hubspotutk?: Maybe; }; +export enum GraphQLTrackEvent { + CreatedContent = "CREATED_CONTENT", + UsedPlayground = "USED_PLAYGROUND", + CheckedQuickstart = "CHECKED_QUICKSTART", +} + +export type GraphQLTrackInput = { + projectId: Scalars["ID"]; + event: GraphQLTrackEvent; + meta?: Maybe; +}; + +export type GraphQLTrackPayload = { + __typename?: "TrackPayload"; + success: Scalars["Boolean"]; +}; + export type GraphQLUpdateProfileInput = { name?: Maybe; company?: Maybe; jobTitle?: Maybe; jobRole?: Maybe; + picture?: Maybe; }; export enum GraphQLProfileJobRole { @@ -2088,26 +2145,109 @@ export type GraphQLWebhook = { * in the webhook payload or not */ includePayload: Scalars["Boolean"]; - /** Logs when the webhooks where called */ - logs: Array; hasSecretKey?: Maybe; + logs: GraphQLWebhookLogsPayload; + log?: Maybe; + triggerSources?: Maybe>; +}; + +export type GraphQLWebhookLogsArgs = { + where?: Maybe; + limit?: Maybe; + skip?: Maybe; + after?: Maybe; + orderBy?: Maybe; +}; + +export type GraphQLWebhookLogArgs = { + id: Scalars["String"]; +}; + +export enum GraphQLWebhookTriggerSource { + Pat = "PAT", + Member = "MEMBER", + Public = "PUBLIC", +} + +export type GraphQLWebhookLogsPayload = { + __typename?: "WebhookLogsPayload"; + total: Scalars["Int"]; + entries: Array; +}; + +export type GraphQLWebhookLogsWhereInput = { + action_eq?: Maybe; + modelId_eq?: Maybe; + status_eq?: Maybe; + status_in?: Maybe>>; + status_gt?: Maybe; + status_gte?: Maybe; + status_lt?: Maybe; + status_lte?: Maybe; }; +export enum GraphQLWebhookLogOrderByInput { + CalledAtAsc = "calledAt_ASC", + CalledAtDesc = "calledAt_DESC", +} + export type GraphQLWebhookLog = { __typename?: "WebhookLog"; id: Scalars["String"]; - /** Duration the request call took in milliseconds */ - duration: Scalars["Float"]; - /** Time when the webhook was called */ + /** + * """ + * Payload that was send as the payload + * """ + */ + requestPayload?: Maybe; + /** + * """ + * Payload that was return by the webhook + * """ + */ + responsePayload?: Maybe; + /** + * """ + * Size of the response payload in bytes + * """ + */ + responsePayloadSize?: Maybe; + /** + * """ + * Time when the webhook was called + * """ + */ calledAt: Scalars["DateTime"]; - /** Body that was send as the payload */ - requestBody: Scalars["JSON"]; - /** Body that was returned from the webhook */ - responseBody?: Maybe; - /** Status code of the response */ - responseStatusCode: Scalars["Int"]; - /** Headers of the response */ - responseHeaders?: Maybe; + /** + * """ + * Status code of the response + * """ + */ + statusCode: Scalars["Int"]; + /** + * """ + * Model on which the webhook was triggered + * """ + */ + model?: Maybe; + /** + * """ + * Action which triggered the webhook + * """ + */ + triggerAction: GraphQLWebhookTriggerAction; + /** + * """ + * In case of errors shows how many retry attempts happened + * """ + */ + attempts: Scalars["Int"]; + /** + * """ + * Duration the request call took in milliseconds + * """ + */ + duration: Scalars["Float"]; }; export type GraphQLCreateWebhookPayload = { @@ -2168,6 +2308,7 @@ export type GraphQLCreateWebhookInput = { triggerType: GraphQLWebhookTriggerType; triggerActions: Array; secretKey?: Maybe; + triggerSources?: Maybe>; }; export type GraphQLUpdateWebhookInput = { @@ -2183,12 +2324,23 @@ export type GraphQLUpdateWebhookInput = { triggerType?: Maybe; triggerActions?: Maybe>; secretKey?: Maybe; + triggerSources?: Maybe>; }; export type GraphQLDeleteWebhookInput = { webhookId: Scalars["ID"]; }; +export type GraphQLRetriggerWebhookInput = { + webhookId: Scalars["ID"]; + logId: Scalars["String"]; +}; + +export type GraphQLRetriggerWebhookPayload = { + __typename?: "RetriggerWebhookPayload"; + logId: Scalars["String"]; +}; + export enum GraphQLAvailableExtensionSrcType { Inline = "INLINE", Sdk = "SDK", @@ -2246,6 +2398,7 @@ export type GraphQLIExtension = { updatedBy?: Maybe; name?: Maybe; description?: Maybe; + apiId: Scalars["String"]; /** The type indicating where the source for the extension will be obtained from */ srcType: GraphQLExtensionSrcType; /** Location for the source if the source type is an external one */ @@ -2266,6 +2419,7 @@ export type GraphQLFieldExtension = GraphQLIExtension & { updatedBy?: Maybe; name?: Maybe; description?: Maybe; + apiId: Scalars["String"]; /** The type indicating where the source for the extension will be obtained from */ srcType: GraphQLExtensionSrcType; /** Location for the source if the source type is an external one */ @@ -2282,6 +2436,28 @@ export type GraphQLFieldExtension = GraphQLIExtension & { fields: Array; }; +export type GraphQLSidebarExtension = GraphQLIExtension & { + __typename?: "SidebarExtension"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + createdBy?: Maybe; + updatedBy?: Maybe; + name?: Maybe; + description?: Maybe; + apiId: Scalars["String"]; + /** The type indicating where the source for the extension will be obtained from */ + srcType: GraphQLExtensionSrcType; + /** Location for the source if the source type is an external one */ + src: Scalars["String"]; + environment: GraphQLEnvironment; + config: Scalars["JSON"]; + isActive: Scalars["Boolean"]; + meta?: Maybe; + neededPermissions: Array; + sidebarElements: Array; +}; + export type GraphQLCreateFieldExtensionPayload = { __typename?: "CreateFieldExtensionPayload"; createdExtension: GraphQLFieldExtension; @@ -2292,6 +2468,16 @@ export type GraphQLUpdateFieldExtensionPayload = { updatedExtension: GraphQLFieldExtension; }; +export type GraphQLCreateSidebarExtensionPayload = { + __typename?: "CreateSidebarExtensionPayload"; + createdExtension: GraphQLSidebarExtension; +}; + +export type GraphQLUpdateSidebarExtensionPayload = { + __typename?: "UpdateSidebarExtensionPayload"; + updatedExtension: GraphQLSidebarExtension; +}; + export type GraphQLDeleteExtensionPayload = { __typename?: "DeleteExtensionPayload"; deletedExtensionId: Scalars["ID"]; @@ -2301,6 +2487,7 @@ export type GraphQLCreateFieldExtensionInput = { environmentId: Scalars["ID"]; name?: Maybe; description?: Maybe; + apiId: Scalars["String"]; srcTypeId: Scalars["ID"]; src: Scalars["String"]; config: Scalars["JSON"]; @@ -2317,6 +2504,7 @@ export type GraphQLUpdateFieldExtensionInput = { extensionId: Scalars["ID"]; name?: Maybe; description?: Maybe; + apiId: Scalars["String"]; srcTypeId?: Maybe; src?: Maybe; config?: Maybe; @@ -2329,6 +2517,32 @@ export type GraphQLUpdateFieldExtensionInput = { neededPermissions?: Maybe>; }; +export type GraphQLCreateSidebarExtensionInput = { + environmentId: Scalars["ID"]; + name?: Maybe; + description?: Maybe; + apiId: Scalars["String"]; + srcTypeId: Scalars["ID"]; + src: Scalars["String"]; + config: Scalars["JSON"]; + isActive: Scalars["Boolean"]; + meta?: Maybe; + neededPermissions?: Maybe>; +}; + +export type GraphQLUpdateSidebarExtensionInput = { + extensionId: Scalars["ID"]; + name?: Maybe; + description?: Maybe; + apiId: Scalars["String"]; + srcTypeId?: Maybe; + src?: Maybe; + config?: Maybe; + isActive?: Maybe; + meta?: Maybe; + neededPermissions?: Maybe>; +}; + export type GraphQLDeleteExtensionInput = { extensionId: Scalars["ID"]; }; @@ -2427,7 +2641,7 @@ export type GraphQLFieldValidationRange = { export type GraphQLFieldValidationRegEx = { __typename?: "FieldValidationRegEx"; regex?: Maybe; - flags?: Maybe>>; + flags?: Maybe>; errorMessage?: Maybe; }; @@ -2476,7 +2690,12 @@ export type GraphQLIField = { /** @deprecated Use visibility instead */ isHidden: Scalars["Boolean"]; visibility: GraphQLVisibilityTypes; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; extensions?: Maybe; @@ -2511,6 +2730,10 @@ export enum GraphQLRelationalFieldType { Asset = "ASSET", } +export enum GraphQLComponentFieldType { + Component = "COMPONENT", +} + export enum GraphQLUnionFieldType { Union = "UNION", } @@ -2549,7 +2772,12 @@ export type GraphQLSimpleField = GraphQLIField & visibility: GraphQLVisibilityTypes; isLocalized: Scalars["Boolean"]; initialValue?: Maybe; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; isTitle: Scalars["Boolean"]; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; @@ -2557,6 +2785,8 @@ export type GraphQLSimpleField = GraphQLIField & validations?: Maybe; meta?: Maybe; embedsEnabled?: Maybe; + /** list of embeddable models */ + embeddableModels?: Maybe>; }; export type GraphQLRemoteTypeDefinition = { @@ -2594,7 +2824,12 @@ export type GraphQLRemoteField = GraphQLIField & { isHidden: Scalars["Boolean"]; visibility: GraphQLVisibilityTypes; isList: Scalars["Boolean"]; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; extensions?: Maybe; @@ -2625,7 +2860,12 @@ export type GraphQLEnumerableField = GraphQLIField & visibility: GraphQLVisibilityTypes; isLocalized: Scalars["Boolean"]; initialValue?: Maybe; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; isTitle: Scalars["Boolean"]; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; @@ -2651,7 +2891,12 @@ export type GraphQLRelationalField = GraphQLIField & /** @deprecated Use visibility instead */ isHidden: Scalars["Boolean"]; visibility: GraphQLVisibilityTypes; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; relatedModel: GraphQLIModel; @@ -2677,7 +2922,12 @@ export type GraphQLUniDirectionalRelationalField = GraphQLIField & /** @deprecated Use visibility instead */ isHidden: Scalars["Boolean"]; visibility: GraphQLVisibilityTypes; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; relatedModel: GraphQLIModel; @@ -2685,6 +2935,38 @@ export type GraphQLUniDirectionalRelationalField = GraphQLIField & meta?: Maybe; }; +export type GraphQLComponentField = GraphQLIField & + GraphQLIRequireableField & { + __typename?: "ComponentField"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + type: GraphQLComponentFieldType; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isSystem: Scalars["Boolean"]; + isList: Scalars["Boolean"]; + isRequired: Scalars["Boolean"]; + position: Scalars["Int"]; + /** @deprecated Use visibility instead */ + isHidden: Scalars["Boolean"]; + visibility: GraphQLVisibilityTypes; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ + model: GraphQLIModel; + parent: GraphQLIFieldParent; + hasEmptyValues: Scalars["Boolean"]; + tableConfig: GraphQLFieldConfig; + formConfig: GraphQLFieldConfig; + component: GraphQLComponent; + extensions?: Maybe; + meta?: Maybe; + }; + +/** rename to RelationUnionField maybe at some point */ export type GraphQLUnionField = GraphQLIField & GraphQLIUnionField & { __typename?: "UnionField"; @@ -2701,7 +2983,12 @@ export type GraphQLUnionField = GraphQLIField & /** @deprecated Use visibility instead */ isHidden: Scalars["Boolean"]; visibility: GraphQLVisibilityTypes; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ model: GraphQLIModel; + parent: GraphQLIFieldParent; tableConfig: GraphQLFieldConfig; formConfig: GraphQLFieldConfig; /** True if this field is the reverse side of the initally created union field */ @@ -2711,6 +2998,36 @@ export type GraphQLUnionField = GraphQLIField & meta?: Maybe; }; +/** TODO: ModularComponentField is the name the designs use right now?! */ +export type GraphQLComponentUnionField = GraphQLIField & + GraphQLIRequireableField & { + __typename?: "ComponentUnionField"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isSystem: Scalars["Boolean"]; + isList: Scalars["Boolean"]; + isRequired: Scalars["Boolean"]; + position: Scalars["Int"]; + /** @deprecated Use visibility instead */ + isHidden: Scalars["Boolean"]; + visibility: GraphQLVisibilityTypes; + /** + * This will throw a runtime error for fields that are on a component instead of model! + * @deprecated Use parent instead + */ + model: GraphQLIModel; + parent: GraphQLIFieldParent; + tableConfig: GraphQLFieldConfig; + formConfig: GraphQLFieldConfig; + components: Array; + extensions?: Maybe; + meta?: Maybe; + }; + export type GraphQLUnion = { __typename?: "Union"; id: Scalars["ID"]; @@ -2740,6 +3057,11 @@ export type GraphQLMoveFieldPayload = { movedFields: Array; }; +export type GraphQLMoveSidebarElementPayload = { + __typename?: "MoveSidebarElementPayload"; + movedSidebarElements: Array; +}; + export type GraphQLFieldValidationIntRangeInput = { min?: Maybe; max?: Maybe; @@ -2781,6 +3103,11 @@ export type GraphQLSimpleFieldValidationsInput = { String?: Maybe; }; +export type GraphQLEmbeddableModelsInput = { + modelsToAdd?: Maybe>; + modelsToRemove?: Maybe>; +}; + export type GraphQLUpdateSimpleFieldInput = { id: Scalars["ID"]; apiId?: Maybe; @@ -2801,6 +3128,8 @@ export type GraphQLUpdateSimpleFieldInput = { validations?: Maybe; meta?: Maybe; embedsEnabled?: Maybe; + /** id's of embeddable models. */ + embeddableModels?: Maybe; }; export type GraphQLUpdateEnumerableFieldInput = { @@ -2843,6 +3172,20 @@ export type GraphQLUpdateRelationalFieldInput = { meta?: Maybe; }; +export type GraphQLUpdateComponentFieldInput = { + id: Scalars["ID"]; + apiId?: Maybe; + displayName?: Maybe; + description?: Maybe; + isList?: Maybe; + visibility?: Maybe; + isRequired?: Maybe; + tableConfig?: Maybe; + formConfig?: Maybe; + extensions?: Maybe; + meta?: Maybe; +}; + export type GraphQLCreateMemberFieldInput = { /** ID of member model to add */ modelId: Scalars["ID"]; @@ -2894,7 +3237,12 @@ export type GraphQLFieldConfigUpdateInput = { }; export type GraphQLCreateSimpleFieldInput = { - modelId: Scalars["ID"]; + modelId?: Maybe; + /** + * This can be a model or component id, modelId must be empty when parentId is used + * either modelId or parentId needs to be set and is required via validation, it will be made required. + */ + parentId?: Maybe; apiId: Scalars["String"]; type: GraphQLSimpleFieldType; displayName: Scalars["String"]; @@ -2915,6 +3263,8 @@ export type GraphQLCreateSimpleFieldInput = { meta?: Maybe; position?: Maybe; embedsEnabled?: Maybe; + /** id's of embeddable models. Optional, but should be provided if embedsEnabled is true */ + embeddableModels?: Maybe>; }; export type GraphQLRemoteFieldConfigInput = { @@ -2981,7 +3331,12 @@ export type GraphQLBatchMigrationRemoteFieldConfigInput = { }; export type GraphQLCreateRemoteFieldInput = { - modelId: Scalars["ID"]; + modelId?: Maybe; + /** + * This can be a model or component id, modelId must be empty when parentId is used + * either modelId or parentId needs to be set and is required via validation, it will be made required. + */ + parentId?: Maybe; apiId: Scalars["String"]; type: GraphQLRemoteFieldType; remoteConfig: GraphQLRemoteFieldConfigInput; @@ -2997,7 +3352,12 @@ export type GraphQLCreateRemoteFieldInput = { }; export type GraphQLCreateEnumerableFieldInput = { - modelId: Scalars["ID"]; + modelId?: Maybe; + /** + * This can be a model or component id, modelId must be empty when parentId is used + * either modelId or parentId needs to be set and is required via validation, it will be made required. + */ + parentId?: Maybe; enumerationId: Scalars["ID"]; type: GraphQLEnumerableFieldType; apiId: Scalars["String"]; @@ -3038,7 +3398,12 @@ export type GraphQLCreateReverseRelationSide = { }; export type GraphQLCreateRelationalFieldInput = { - modelId: Scalars["ID"]; + modelId?: Maybe; + /** + * This can be a model or component id, modelId must be empty when parentId is used + * either modelId or parentId needs to be set and is required via validation, it will be made required. + */ + parentId?: Maybe; type: GraphQLRelationalFieldType; relationApiId?: Maybe; apiId: Scalars["String"]; @@ -3069,7 +3434,12 @@ export type GraphQLCreateUnionInput = { }; export type GraphQLCreateUnionFieldInput = { - modelId: Scalars["ID"]; + modelId?: Maybe; + /** + * This can be a model or component id, modelId must be empty when parentId is used + * either modelId or parentId needs to be set and is required via validation, it will be made required. + */ + parentId?: Maybe; type: GraphQLUnionFieldType; union: GraphQLCreateUnionInput; apiId: Scalars["String"]; @@ -3086,49 +3456,126 @@ export type GraphQLCreateUnionFieldInput = { position?: Maybe; }; +export type GraphQLCreateComponentFieldInput = { + /** This can be a model or component id */ + parentId: Scalars["ID"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isList: Scalars["Boolean"]; + visibility?: GraphQLVisibilityTypes; + isRequired: Scalars["Boolean"]; + component: Scalars["ID"]; + tableConfig?: Maybe; + formConfig?: Maybe; + extensions?: Maybe; + meta?: Maybe; + position?: Maybe; +}; + export type GraphQLMoveFieldInput = { id: Scalars["ID"]; position: Scalars["Int"]; }; -export type GraphQLDeleteFieldInput = { +export type GraphQLMoveSidebarElementInput = { id: Scalars["ID"]; + position: Scalars["Int"]; }; -/** - * This types holds a superset of the allowed read operations on a model. - * This means even if this states access is allowed, it could still potentially be denied. - */ -export type GraphQLModelViewerReadContentPermission = { - __typename?: "ModelViewerReadContentPermission"; - allowedWithCondition: Scalars["Boolean"]; - allowedLocales: Array; +export type GraphQLUpdateSidebarElementInput = { + id: Scalars["ID"]; + displayName?: Maybe; + description?: Maybe; + config?: Maybe; }; -export type GraphQLModelViewerReadContentPermissionByStage = { - __typename?: "ModelViewerReadContentPermissionByStage"; - stage: GraphQLStage; - /** - * If the current viewer is allowed to read this models content for the provided stage, - * this field will return the potential limitations that must be met. - * `null` means not allowed! - */ - allowed?: Maybe; +export type GraphQLResetSidebarElementsInput = { + modelId: Scalars["ID"]; }; -export type GraphQLModelViewerContentPermission = { - __typename?: "ModelViewerContentPermission"; - /** Lists all stages and the corresponding read permissions the user has on those stages. */ - readByStages: Array; - readVersion: Scalars["Boolean"]; +export type GraphQLResetSidebarElementsPayload = { + __typename?: "ResetSidebarElementsPayload"; + model?: Maybe; }; -/** Simplified computed version of the permissions the current viewer has on this model */ -export type GraphQLModelViewerPermission = { +export type GraphQLUpdateSidebarElementPayload = { + __typename?: "UpdateSidebarElementPayload"; + updatedSidebarElement: GraphQLISidebarElement; +}; + +export type GraphQLCreateCustomSidebarElementInput = { + modelId: Scalars["ID"]; + extensionId: Scalars["ID"]; + displayName: Scalars["String"]; + description?: Maybe; + config?: Maybe; +}; + +export type GraphQLCreateSystemSidebarElementInput = { + modelId: Scalars["ID"]; + type: GraphQLSystemSidebarElementType; + config?: Maybe; +}; + +export type GraphQLCreateSidebarElementPayload = { + __typename?: "CreateSidebarElementPayload"; + createdSidebarElement?: Maybe; +}; + +export type GraphQLDeleteSidebarElementInput = { + sidebarElementId: Scalars["ID"]; +}; + +export type GraphQLDeleteSidebarElementPayload = { + __typename?: "DeleteSidebarElementPayload"; + deletedSidebarElementId: Scalars["ID"]; +}; + +export type GraphQLDeleteFieldInput = { + id: Scalars["ID"]; +}; + +/** + * This types holds a superset of the allowed read operations on a model. + * This means even if this states access is allowed, it could still potentially be denied. + */ +export type GraphQLModelViewerReadContentPermission = { + __typename?: "ModelViewerReadContentPermission"; + allowedWithCondition: Scalars["Boolean"]; + allowedLocales: Array; +}; + +export type GraphQLModelViewerReadContentPermissionByStage = { + __typename?: "ModelViewerReadContentPermissionByStage"; + stage: GraphQLStage; + /** + * If the current viewer is allowed to read this models content for the provided stage, + * this field will return the potential limitations that must be met. + * `null` means not allowed! + */ + allowed?: Maybe; +}; + +export type GraphQLModelViewerContentPermission = { + __typename?: "ModelViewerContentPermission"; + /** Lists all stages and the corresponding read permissions the user has on those stages. */ + readByStages: Array; + readVersion: Scalars["Boolean"]; +}; + +/** Simplified computed version of the permissions the current viewer has on this model */ +export type GraphQLModelViewerPermission = { __typename?: "ModelViewerPermission"; content: GraphQLModelViewerContentPermission; }; +export type GraphQLIFieldParent = { + id: Scalars["ID"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; +}; + export type GraphQLIModel = { id: Scalars["ID"]; createdAt: Scalars["DateTime"]; @@ -3141,6 +3588,7 @@ export type GraphQLIModel = { isLocalized: Scalars["Boolean"]; titleFields: Array; fields: Array; + field: GraphQLIField; environment: GraphQLEnvironment; contentViews: Array; /** Model has at least one document */ @@ -3148,6 +3596,7 @@ export type GraphQLIModel = { isVersioned: Scalars["Boolean"]; previewURLs: Array; viewerPermission: GraphQLModelViewerPermission; + sidebarElements: Array; }; export type GraphQLIModelFieldsArgs = { @@ -3155,135 +3604,244 @@ export type GraphQLIModelFieldsArgs = { includeApiOnlyFields?: Maybe; }; +export type GraphQLIModelFieldArgs = { + id: Scalars["ID"]; +}; + export type GraphQLIModelContentViewsArgs = { includeSystemContentViews?: Maybe; filter?: Maybe; }; -export type GraphQLModel = GraphQLIModel & { - __typename?: "Model"; +export type GraphQLSidebarElements = + | GraphQLSystemSidebarElement + | GraphQLCustomSidebarElement; + +export type GraphQLISidebarElement = { id: Scalars["ID"]; createdAt: Scalars["DateTime"]; updatedAt: Scalars["DateTime"]; - apiId: Scalars["String"]; displayName: Scalars["String"]; description?: Maybe; - isSystem: Scalars["Boolean"]; - apiIdPlural: Scalars["String"]; - /** Is true when at least one field is marked as localized */ - isLocalized: Scalars["Boolean"]; - titleFields: Array; - fields: Array; - environment: GraphQLEnvironment; - contentViews: Array; - /** Model has at least one document */ - hasContent: Scalars["Boolean"]; - isVersioned: Scalars["Boolean"]; - previewURLs: Array; - viewerPermission: GraphQLModelViewerPermission; + config?: Maybe; + position: Scalars["Int"]; + isEnabled: Scalars["Boolean"]; + model: GraphQLIModel; +}; + +export enum GraphQLSystemSidebarElementType { + Information = "INFORMATION", + Stages = "STAGES", + Localizations = "LOCALIZATIONS", + Versions = "VERSIONS", + PreviewUrls = "PREVIEW_URLS", + Releases = "RELEASES", +} + +export type GraphQLSystemSidebarElement = GraphQLISidebarElement & { + __typename?: "SystemSidebarElement"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + displayName: Scalars["String"]; + description?: Maybe; + config?: Maybe; + position: Scalars["Int"]; + isEnabled: Scalars["Boolean"]; + model: GraphQLIModel; + type: GraphQLSystemSidebarElementType; +}; + +export type GraphQLCustomSidebarElement = GraphQLISidebarElement & { + __typename?: "CustomSidebarElement"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + displayName: Scalars["String"]; + description?: Maybe; + config?: Maybe; + position: Scalars["Int"]; + isEnabled: Scalars["Boolean"]; + model: GraphQLIModel; + extension: GraphQLSidebarExtension; }; +export type GraphQLModel = GraphQLIModel & + GraphQLIFieldParent & { + __typename?: "Model"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isSystem: Scalars["Boolean"]; + apiIdPlural: Scalars["String"]; + /** Is true when at least one field is marked as localized */ + isLocalized: Scalars["Boolean"]; + titleFields: Array; + fields: Array; + field: GraphQLIField; + environment: GraphQLEnvironment; + contentViews: Array; + /** Model has at least one document */ + hasContent: Scalars["Boolean"]; + isVersioned: Scalars["Boolean"]; + previewURLs: Array; + viewerPermission: GraphQLModelViewerPermission; + sidebarElements: Array; + }; + export type GraphQLModelFieldsArgs = { includeHiddenFields?: Maybe; includeApiOnlyFields?: Maybe; }; +export type GraphQLModelFieldArgs = { + id: Scalars["ID"]; +}; + export type GraphQLModelContentViewsArgs = { includeSystemContentViews?: Maybe; filter?: Maybe; }; -export type GraphQLAssetModel = GraphQLIModel & { - __typename?: "AssetModel"; +export type GraphQLComponent = GraphQLIFieldParent & { + __typename?: "Component"; id: Scalars["ID"]; createdAt: Scalars["DateTime"]; updatedAt: Scalars["DateTime"]; apiId: Scalars["String"]; + apiIdPlural: Scalars["String"]; + isSystem: Scalars["Boolean"]; displayName: Scalars["String"]; description?: Maybe; - isSystem: Scalars["Boolean"]; - apiIdPlural: Scalars["String"]; + /** Is true when at least one field is marked as localized */ isLocalized: Scalars["Boolean"]; titleFields: Array; fields: Array; environment: GraphQLEnvironment; - contentViews: Array; - /** Model has at least one document */ + /** Component has at least one instance in any of its usages */ hasContent: Scalars["Boolean"]; - isVersioned: Scalars["Boolean"]; - previewURLs: Array; - viewerPermission: GraphQLModelViewerPermission; }; +export type GraphQLComponentFieldsArgs = { + includeHiddenFields?: Maybe; + includeApiOnlyFields?: Maybe; +}; + +export type GraphQLAssetModel = GraphQLIModel & + GraphQLIFieldParent & { + __typename?: "AssetModel"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isSystem: Scalars["Boolean"]; + apiIdPlural: Scalars["String"]; + isLocalized: Scalars["Boolean"]; + titleFields: Array; + fields: Array; + field: GraphQLIField; + environment: GraphQLEnvironment; + contentViews: Array; + /** Model has at least one document */ + hasContent: Scalars["Boolean"]; + isVersioned: Scalars["Boolean"]; + previewURLs: Array; + viewerPermission: GraphQLModelViewerPermission; + sidebarElements: Array; + }; + export type GraphQLAssetModelFieldsArgs = { includeHiddenFields?: Maybe; includeApiOnlyFields?: Maybe; }; +export type GraphQLAssetModelFieldArgs = { + id: Scalars["ID"]; +}; + export type GraphQLAssetModelContentViewsArgs = { includeSystemContentViews?: Maybe; filter?: Maybe; }; -export type GraphQLUserModel = GraphQLIModel & { - __typename?: "UserModel"; - id: Scalars["ID"]; - createdAt: Scalars["DateTime"]; - updatedAt: Scalars["DateTime"]; - apiId: Scalars["String"]; - displayName: Scalars["String"]; - description?: Maybe; - isSystem: Scalars["Boolean"]; - apiIdPlural: Scalars["String"]; - isLocalized: Scalars["Boolean"]; - titleFields: Array; - fields: Array; - environment: GraphQLEnvironment; - contentViews: Array; - /** Model has at least one document */ - hasContent: Scalars["Boolean"]; - isVersioned: Scalars["Boolean"]; - previewURLs: Array; - viewerPermission: GraphQLModelViewerPermission; -}; +export type GraphQLUserModel = GraphQLIModel & + GraphQLIFieldParent & { + __typename?: "UserModel"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isSystem: Scalars["Boolean"]; + apiIdPlural: Scalars["String"]; + isLocalized: Scalars["Boolean"]; + titleFields: Array; + fields: Array; + field: GraphQLIField; + environment: GraphQLEnvironment; + contentViews: Array; + /** Model has at least one document */ + hasContent: Scalars["Boolean"]; + isVersioned: Scalars["Boolean"]; + previewURLs: Array; + viewerPermission: GraphQLModelViewerPermission; + sidebarElements: Array; + }; export type GraphQLUserModelFieldsArgs = { includeHiddenFields?: Maybe; includeApiOnlyFields?: Maybe; }; +export type GraphQLUserModelFieldArgs = { + id: Scalars["ID"]; +}; + export type GraphQLUserModelContentViewsArgs = { includeSystemContentViews?: Maybe; filter?: Maybe; }; -export type GraphQLSchedulingModel = GraphQLIModel & { - __typename?: "SchedulingModel"; - id: Scalars["ID"]; - createdAt: Scalars["DateTime"]; - updatedAt: Scalars["DateTime"]; - apiId: Scalars["String"]; - displayName: Scalars["String"]; - description?: Maybe; - isSystem: Scalars["Boolean"]; - apiIdPlural: Scalars["String"]; - isLocalized: Scalars["Boolean"]; - titleFields: Array; - fields: Array; - environment: GraphQLEnvironment; - contentViews: Array; - /** Model has at least one document */ - hasContent: Scalars["Boolean"]; - isVersioned: Scalars["Boolean"]; - previewURLs: Array; - viewerPermission: GraphQLModelViewerPermission; -}; +export type GraphQLSchedulingModel = GraphQLIModel & + GraphQLIFieldParent & { + __typename?: "SchedulingModel"; + id: Scalars["ID"]; + createdAt: Scalars["DateTime"]; + updatedAt: Scalars["DateTime"]; + apiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + isSystem: Scalars["Boolean"]; + apiIdPlural: Scalars["String"]; + isLocalized: Scalars["Boolean"]; + titleFields: Array; + fields: Array; + field: GraphQLIField; + environment: GraphQLEnvironment; + contentViews: Array; + /** Model has at least one document */ + hasContent: Scalars["Boolean"]; + isVersioned: Scalars["Boolean"]; + previewURLs: Array; + viewerPermission: GraphQLModelViewerPermission; + sidebarElements: Array; + }; export type GraphQLSchedulingModelFieldsArgs = { includeHiddenFields?: Maybe; includeApiOnlyFields?: Maybe; }; +export type GraphQLSchedulingModelFieldArgs = { + id: Scalars["ID"]; +}; + export type GraphQLSchedulingModelContentViewsArgs = { includeSystemContentViews?: Maybe; filter?: Maybe; @@ -3298,6 +3856,15 @@ export type GraphQLCreateModelInput = { previewURLs?: Maybe>; }; +export type GraphQLDuplicateModelInput = { + modelId: Scalars["ID"]; + apiId: Scalars["String"]; + apiIdPlural: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + previewURLs?: Maybe>; +}; + export type GraphQLUpdateModelInput = { id: Scalars["ID"]; /** @@ -3319,6 +3886,42 @@ export type GraphQLDeleteModelInput = { id: Scalars["ID"]; }; +export type GraphQLCreateComponentInput = { + environmentId: Scalars["ID"]; + apiId: Scalars["String"]; + apiIdPlural: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; +}; + +export type GraphQLDuplicateComponentInput = { + componentId: Scalars["ID"]; + apiId: Scalars["String"]; + apiIdPlural: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; +}; + +export type GraphQLUpdateComponentInput = { + id: Scalars["ID"]; + /** + * Rename singular API ID to + * specified value + */ + apiId?: Maybe; + /** + * Rename plural API ID to + * specified value + */ + apiIdPlural?: Maybe; + displayName?: Maybe; + description?: Maybe; +}; + +export type GraphQLDeleteComponentInput = { + id: Scalars["ID"]; +}; + export type GraphQLPreviewUrlInput = { name: Scalars["String"]; template: Scalars["String"]; @@ -3517,18 +4120,50 @@ export type GraphQLDeleteEnvironmentPayload = { deletedEnvironmentId: Scalars["ID"]; }; +/** Creating a model. */ +export type GraphQLBatchMigrationCreateModelInput = { + apiId: Scalars["String"]; + apiIdPlural: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + previewURLs?: Maybe>; +}; + +/** Updating a model. */ +export type GraphQLBatchMigrationUpdateModelInput = { + apiId: Scalars["String"]; + newApiId?: Maybe; + apiIdPlural?: Maybe; + displayName?: Maybe; + description?: Maybe; + previewURLs?: Maybe>; +}; + /** Deleting a model. */ export type GraphQLBatchMigrationDeleteModelInput = { apiId: Scalars["String"]; }; -/** Creating a model. */ -export type GraphQLBatchMigrationCreateModelInput = { +/** Creating a component. */ +export type GraphQLBatchMigrationCreateComponentInput = { apiId: Scalars["String"]; apiIdPlural: Scalars["String"]; displayName: Scalars["String"]; description?: Maybe; - previewURLs?: Maybe>; +}; + +/** Updating a component. */ +export type GraphQLBatchMigrationUpdateComponentInput = { + apiId: Scalars["String"]; + newApiId?: Maybe; + apiIdPlural?: Maybe; + displayName?: Maybe; + description?: Maybe; +}; + +/** Deleting a component. */ +export type GraphQLBatchMigrationDeleteComponentInput = { + apiId: Scalars["String"]; }; /** Creating a remote type definition */ @@ -3583,26 +4218,26 @@ export type GraphQLBatchMigrationCreateStageInput = { position?: Maybe; }; -/** Updating a model. */ -export type GraphQLBatchMigrationUpdateModelInput = { - apiId: Scalars["String"]; - newApiId?: Maybe; - apiIdPlural?: Maybe; - displayName?: Maybe; - description?: Maybe; - previewURLs?: Maybe>; -}; - /** Deleting a field. */ export type GraphQLBatchMigrationDeleteFieldInput = { apiId: Scalars["String"]; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; +}; + +/** Creating a simple field. */ +export type GraphQLBatchMigrationEmbeddableModelsInput = { + modelsToAdd?: Maybe>; + modelsToRemove?: Maybe>; }; /** Creating a simple field. */ export type GraphQLBatchMigrationCreateSimpleFieldInput = { apiId: Scalars["String"]; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; type: GraphQLSimpleFieldType; displayName: Scalars["String"]; description?: Maybe; @@ -3621,14 +4256,18 @@ export type GraphQLBatchMigrationCreateSimpleFieldInput = { isTitle?: Maybe; position?: Maybe; validations?: Maybe; - embedsEnabled?: Maybe; migrationValue?: Maybe; + embedsEnabled?: Maybe; + /** id's of embeddable models. Optional, but should be provided if embedsEnabled is true */ + embeddableModels?: Maybe>; }; /** Creating a remote field. */ export type GraphQLBatchMigrationCreateRemoteFieldInput = { apiId: Scalars["String"]; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; type: GraphQLRemoteFieldType; displayName: Scalars["String"]; description?: Maybe; @@ -3646,7 +4285,9 @@ export type GraphQLBatchMigrationCreateRemoteFieldInput = { /** Creating an enumerable field. */ export type GraphQLBatchMigrationCreateEnumerableFieldInput = { apiId: Scalars["String"]; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; enumerationApiId: Scalars["String"]; displayName: Scalars["String"]; description?: Maybe; @@ -3668,16 +4309,21 @@ export type GraphQLBatchMigrationCreateEnumerableFieldInput = { export type GraphQLBatchMigrationUpdateUnionFieldInput = { apiId: Scalars["String"]; newApiId?: Maybe; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; displayName?: Maybe; description?: Maybe; - reverseField: GraphQLBatchMigrationUpdateReverseUnionFieldInput; + visibility?: Maybe; + reverseField?: Maybe; }; /** Creating a union field */ export type GraphQLBatchMigrationCreateUnionFieldInput = { apiId: Scalars["String"]; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; displayName: Scalars["String"]; description?: Maybe; tableRenderer?: Maybe; @@ -3709,7 +4355,9 @@ export type GraphQLBatchMigrationUpdateReverseUnionFieldInput = { /** Creating a relational field */ export type GraphQLBatchMigrationCreateRelationalFieldInput = { apiId: Scalars["String"]; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; type: GraphQLRelationalFieldType; displayName: Scalars["String"]; description?: Maybe; @@ -3728,6 +4376,24 @@ export type GraphQLBatchMigrationCreateRelationalFieldInput = { reverseField: GraphQLBatchMigrationCreateReverseRelationalFieldInput; }; +/** Creating a component field */ +export type GraphQLBatchMigrationCreateComponentFieldInput = { + apiId: Scalars["String"]; + /** model or content */ + parentApiId: Scalars["String"]; + displayName: Scalars["String"]; + description?: Maybe; + tableRenderer?: Maybe; + formRenderer?: Maybe; + tableExtension?: Maybe; + formExtension?: Maybe; + isList?: Maybe; + isRequired?: Maybe; + visibility?: Maybe; + componentApiId: Scalars["String"]; + position?: Maybe; +}; + /** reverse field args */ export type GraphQLBatchMigrationCreateReverseRelationalFieldInput = { apiId: Scalars["String"]; @@ -3744,7 +4410,9 @@ export type GraphQLBatchMigrationCreateReverseRelationalFieldInput = { export type GraphQLBatchMigrationUpdateRelationalFieldInput = { apiId: Scalars["String"]; newApiId?: Maybe; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; displayName?: Maybe; description?: Maybe; isList?: Maybe; @@ -3758,11 +4426,25 @@ export type GraphQLBatchMigrationUpdateRelationalFieldInput = { isRequired?: Maybe; }; +/** Updating component field */ +export type GraphQLBatchMigrationUpdateComponentFieldInput = { + apiId: Scalars["String"]; + newApiId?: Maybe; + parentApiId: Scalars["String"]; + displayName?: Maybe; + description?: Maybe; + isList?: Maybe; + visibility?: Maybe; + isRequired?: Maybe; +}; + /** Updating simple field */ export type GraphQLBatchMigrationUpdateSimpleFieldInput = { apiId: Scalars["String"]; newApiId?: Maybe; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; displayName?: Maybe; description?: Maybe; isList?: Maybe; @@ -3783,13 +4465,17 @@ export type GraphQLBatchMigrationUpdateSimpleFieldInput = { formExtension?: Maybe; formConfig?: Maybe; tableConfig?: Maybe; + /** id's of embeddable models. */ + embeddableModels?: Maybe; }; /** Updating enumerable field */ export type GraphQLBatchMigrationUpdateEnumerableFieldInput = { apiId: Scalars["String"]; newApiId?: Maybe; - modelApiId: Scalars["String"]; + /** either modelApiId or parentApiId needs to be set */ + modelApiId?: Maybe; + parentApiId?: Maybe; displayName?: Maybe; description?: Maybe; isList?: Maybe; @@ -3841,8 +4527,8 @@ export type GraphQLBatchMigrationCreateEnumerationValueInput = { /** update enumeration value */ export type GraphQLBatchMigrationUpdateEnumerationValueInput = { apiId: Scalars["String"]; - newApiId: Scalars["String"]; - displayName: Scalars["String"]; + newApiId?: Maybe; + displayName?: Maybe; }; /** Creating locale */ @@ -3872,6 +4558,10 @@ export type GraphQLBatchMigrationChangeInput = { createModel?: Maybe; updateModel?: Maybe; deleteModel?: Maybe; + /** Components */ + createComponent?: Maybe; + updateComponent?: Maybe; + deleteComponent?: Maybe; /** Remote type defs */ createRemoteTypeDefinition?: Maybe< GraphQLBatchMigrationCreateRemoteTypeDefinitionInput @@ -3894,6 +4584,8 @@ export type GraphQLBatchMigrationChangeInput = { >; createUnionField?: Maybe; updateUnionField?: Maybe; + createComponentField?: Maybe; + updateComponentField?: Maybe; createEnumerableField?: Maybe< GraphQLBatchMigrationCreateEnumerableFieldInput >; @@ -3905,7 +4597,7 @@ export type GraphQLBatchMigrationChangeInput = { createEnumeration?: Maybe; updateEnumeration?: Maybe; deleteEnumeration?: Maybe; - /** State */ + /** Stage */ createStage?: Maybe; deleteStage?: Maybe; updateStage?: Maybe; @@ -3915,38 +4607,11 @@ export type GraphQLBatchMigrationChangeInput = { updateLocale?: Maybe; }; -export type GraphQLBatchMigrationChange = { - __typename?: "BatchMigrationChange"; - /** Models */ - createModel?: Maybe; - updateModel?: Maybe; - deleteModel?: Maybe; - /** Fields */ - createSimpleField?: Maybe; - updateSimpleField?: Maybe; - createRelationalField?: Maybe; - updateRelationalField?: Maybe; - deleteField?: Maybe; - /** Locale */ - createLocale?: Maybe; - deleteLocale?: Maybe; - updateLocale?: Maybe; -}; - -export type GraphQLExportEnvironmentInput = { - environmentId: Scalars["ID"]; -}; - -export type GraphQLExportEnvironmentPayload = { - __typename?: "ExportEnvironmentPayload"; - changes: Array; -}; - export type GraphQLDiffEnvironmentPayload = { __typename?: "DiffEnvironmentPayload"; environmentId: Scalars["ID"]; name?: Maybe; - changes: Array; + changes: Array; }; export type GraphQLBatchMigrationInput = { @@ -4186,6 +4851,15 @@ export type GraphQLEnableScheduledPublishingInput = { projectId: Scalars["ID"]; }; +export type GraphQLMigrateRichTextEmbedsInput = { + gcms?: Maybe; +}; + +export type GraphQLMigrationEnableSchedulingInput = { + projectId: Scalars["ID"]; + dryRun?: Maybe; +}; + export type GraphQLMutation = { __typename?: "Mutation"; createContentView: GraphQLCreateContentViewPayload; @@ -4232,11 +4906,13 @@ export type GraphQLMutation = { updateMemberRoles: GraphQLMember; removeMember: GraphQLRemoveMemberPayload; setUserAnalytics: GraphQLUserAnalytics; + track: GraphQLTrackPayload; deleteAccount: GraphQLDeleteAccountPayload; updateUserProfile: GraphQLUserViewer; createWebhook: GraphQLCreateWebhookPayload; updateWebhook: GraphQLUpdateWebhookPayload; deleteWebhook: GraphQLDeleteWebhookPayload; + retriggerWebhook: GraphQLRetriggerWebhookPayload; moveField: GraphQLMoveFieldPayload; createEnvironment: GraphQLCreateEnvironmentPayload; updateEnvironment: GraphQLUpdateEnvironmentPayload; @@ -4267,7 +4943,15 @@ export type GraphQLMutation = { >; createFieldExtension: GraphQLCreateFieldExtensionPayload; updateFieldExtension: GraphQLUpdateFieldExtensionPayload; + createSidebarExtension: GraphQLCreateSidebarExtensionPayload; + updateSidebarExtension: GraphQLUpdateSidebarExtensionPayload; deleteExtension: GraphQLDeleteExtensionPayload; + createCustomSidebarElement: GraphQLCreateSidebarElementPayload; + createSystemSidebarElement: GraphQLCreateSidebarElementPayload; + deleteSidebarElement: GraphQLDeleteSidebarElementPayload; + moveSidebarElement: GraphQLMoveSidebarElementPayload; + updateSidebarElement: GraphQLUpdateSidebarElementPayload; + resetSidebarElements: GraphQLResetSidebarElementsPayload; createStage: GraphQLAsyncOperationPayload; updateStage: GraphQLAsyncOperationPayload; deleteStage: GraphQLAsyncOperationPayload; @@ -4275,8 +4959,13 @@ export type GraphQLMutation = { updateLocale: GraphQLAsyncOperationPayload; deleteLocale: GraphQLAsyncOperationPayload; createModel: GraphQLAsyncOperationPayload; + duplicateModel: GraphQLAsyncOperationPayload; updateModel: GraphQLAsyncOperationPayload; deleteModel: GraphQLAsyncOperationPayload; + createComponent: GraphQLAsyncOperationPayload; + duplicateComponent: GraphQLAsyncOperationPayload; + updateComponent: GraphQLAsyncOperationPayload; + deleteComponent: GraphQLAsyncOperationPayload; createRemoteTypeDefinition: GraphQLAsyncOperationPayload; updateRemoteTypeDefinition: GraphQLAsyncOperationPayload; deleteRemoteTypeDefinition: GraphQLAsyncOperationPayload; @@ -4288,13 +4977,14 @@ export type GraphQLMutation = { createEnumerableField: GraphQLAsyncOperationPayload; createRelationalField: GraphQLAsyncOperationPayload; createUnionField: GraphQLAsyncOperationPayload; + createComponentField: GraphQLAsyncOperationPayload; updateSimpleField: GraphQLAsyncOperationPayload; updateEnumerableField: GraphQLAsyncOperationPayload; updateRelationalField: GraphQLAsyncOperationPayload; updateUnionField: GraphQLAsyncOperationPayload; + updateComponentField: GraphQLAsyncOperationPayload; deleteField: GraphQLAsyncOperationPayload; submitBatchChanges: GraphQLAsyncOperationPayload; - exportEnvironment: GraphQLExportEnvironmentPayload; enableScheduledPublishing: GraphQLProject; }; @@ -4474,6 +5164,10 @@ export type GraphQLMutationSetUserAnalyticsArgs = { data: GraphQLSetUserAnalyticsInput; }; +export type GraphQLMutationTrackArgs = { + data: GraphQLTrackInput; +}; + export type GraphQLMutationDeleteAccountArgs = { data?: Maybe; }; @@ -4494,6 +5188,10 @@ export type GraphQLMutationDeleteWebhookArgs = { data: GraphQLDeleteWebhookInput; }; +export type GraphQLMutationRetriggerWebhookArgs = { + data: GraphQLRetriggerWebhookInput; +}; + export type GraphQLMutationMoveFieldArgs = { data: GraphQLMoveFieldInput; }; @@ -4574,10 +5272,42 @@ export type GraphQLMutationUpdateFieldExtensionArgs = { data: GraphQLUpdateFieldExtensionInput; }; +export type GraphQLMutationCreateSidebarExtensionArgs = { + data: GraphQLCreateSidebarExtensionInput; +}; + +export type GraphQLMutationUpdateSidebarExtensionArgs = { + data: GraphQLUpdateSidebarExtensionInput; +}; + export type GraphQLMutationDeleteExtensionArgs = { data: GraphQLDeleteExtensionInput; }; +export type GraphQLMutationCreateCustomSidebarElementArgs = { + data: GraphQLCreateCustomSidebarElementInput; +}; + +export type GraphQLMutationCreateSystemSidebarElementArgs = { + data: GraphQLCreateSystemSidebarElementInput; +}; + +export type GraphQLMutationDeleteSidebarElementArgs = { + data: GraphQLDeleteSidebarElementInput; +}; + +export type GraphQLMutationMoveSidebarElementArgs = { + data: GraphQLMoveSidebarElementInput; +}; + +export type GraphQLMutationUpdateSidebarElementArgs = { + data: GraphQLUpdateSidebarElementInput; +}; + +export type GraphQLMutationResetSidebarElementsArgs = { + data: GraphQLResetSidebarElementsInput; +}; + export type GraphQLMutationCreateStageArgs = { data: GraphQLCreateStageInput; }; @@ -4606,6 +5336,10 @@ export type GraphQLMutationCreateModelArgs = { data: GraphQLCreateModelInput; }; +export type GraphQLMutationDuplicateModelArgs = { + data: GraphQLDuplicateModelInput; +}; + export type GraphQLMutationUpdateModelArgs = { data: GraphQLUpdateModelInput; }; @@ -4614,6 +5348,22 @@ export type GraphQLMutationDeleteModelArgs = { data: GraphQLDeleteModelInput; }; +export type GraphQLMutationCreateComponentArgs = { + data: GraphQLCreateComponentInput; +}; + +export type GraphQLMutationDuplicateComponentArgs = { + data: GraphQLDuplicateComponentInput; +}; + +export type GraphQLMutationUpdateComponentArgs = { + data: GraphQLUpdateComponentInput; +}; + +export type GraphQLMutationDeleteComponentArgs = { + data: GraphQLDeleteComponentInput; +}; + export type GraphQLMutationCreateRemoteTypeDefinitionArgs = { data: GraphQLCreateRemoteTypeDefinitionInput; }; @@ -4658,6 +5408,10 @@ export type GraphQLMutationCreateUnionFieldArgs = { data: GraphQLCreateUnionFieldInput; }; +export type GraphQLMutationCreateComponentFieldArgs = { + data: GraphQLCreateComponentFieldInput; +}; + export type GraphQLMutationUpdateSimpleFieldArgs = { data: GraphQLUpdateSimpleFieldInput; }; @@ -4674,6 +5428,10 @@ export type GraphQLMutationUpdateUnionFieldArgs = { data: GraphQLUpdateUnionFieldInput; }; +export type GraphQLMutationUpdateComponentFieldArgs = { + data: GraphQLUpdateComponentFieldInput; +}; + export type GraphQLMutationDeleteFieldArgs = { data: GraphQLDeleteFieldInput; }; @@ -4682,10 +5440,6 @@ export type GraphQLMutationSubmitBatchChangesArgs = { data: GraphQLBatchMigrationInput; }; -export type GraphQLMutationExportEnvironmentArgs = { - data: GraphQLExportEnvironmentInput; -}; - export type GraphQLMutationEnableScheduledPublishingArgs = { data: GraphQLEnableScheduledPublishingInput; }; diff --git a/src/migration.ts b/src/migration.ts index 3db36b2..f741b80 100644 --- a/src/migration.ts +++ b/src/migration.ts @@ -19,6 +19,7 @@ import { GraphQLBatchMigrationCreateRemoteTypeDefinitionInput, GraphQLBatchMigrationUpdateRemoteTypeDefinitionInput, GraphQLMigrationStatus, + GraphQLBatchMigrationChangeInput, } from "./generated/schema"; import { EnumerationCreate, @@ -203,6 +204,12 @@ interface Migration { * @param apiId the `apiId` of the locale to delete. */ deleteLocale(apiId: string): void; + + /** + * Add changes to the migration + * @param changes the `changes` input to add to the migration. + */ + registerChanges(changes: GraphQLBatchMigrationChangeInput[]): void; } /** @@ -419,6 +426,12 @@ class MigrationClass implements Migration, ChangeListener { registerChange(change: ChangeItem) { this.changeItems.push(change); } + + registerChanges(changes: GraphQLBatchMigrationChangeInput[]) { + for (const item of changes) { + changes.push(item); + } + } } /**