Skip to content

Commit

Permalink
New cli command to manage deployment previews configuration (#3541)
Browse files Browse the repository at this point in the history
* feat(mc-scripts): deployment previews management

* refactor(mc-scripts): clean up

* fix(mc-scripts): invalid graphql response handling

* feat(mc-scripts): add the new command to push deployments

* fix(mc-scripts): ts type issue

* refactor(mc-scripts): improve validations

* refactor(mc-scripts): renamed deployment preview command and include arguments

* refactor(mc-scripts): update messages

* refactor(mc-scripts): refactor validations

* refactor(mc-scripts): simplify validations

* refactor(mc-scripts): rename deployment previews command

* refactor(mc-scripts): update log message

* chore(mc-scripts): changeset added
  • Loading branch information
CarlosCortizasCT authored Jun 19, 2024
1 parent 4bd0fb6 commit df253eb
Show file tree
Hide file tree
Showing 18 changed files with 1,413 additions and 158 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-mugs-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-scripts': minor
---

Included a new command (`deployment-previews:set`) which allows to create [deployment previews](https://docs.commercetools.com/merchant-center-customizations/concepts/deployment-previews) for Custom Applications.
24 changes: 24 additions & 0 deletions @types-extensions/graphql-settings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ declare module '*/fetch-project-extensions-navbar.settings.graphql' {
export default defaultDocument;
}

declare module '*/create-custom-application-deployment-preview.settings.graphql' {
import { DocumentNode } from 'graphql';
const defaultDocument: DocumentNode;
export const CreateCustomApplicationDeploymentPreview: DocumentNode;

export default defaultDocument;
}

declare module '*/create-custom-application.settings.graphql' {
import { DocumentNode } from 'graphql';
const defaultDocument: DocumentNode;
Expand All @@ -42,6 +50,14 @@ declare module '*/create-custom-view.settings.graphql' {
export default defaultDocument;
}

declare module '*/delete-custom-application-deployment-preview.settings.graphql' {
import { DocumentNode } from 'graphql';
const defaultDocument: DocumentNode;
export const DeleteCustomApplicationDeploymentPreview: DocumentNode;

export default defaultDocument;
}

declare module '*/fetch-custom-application.settings.graphql' {
import { DocumentNode } from 'graphql';
const defaultDocument: DocumentNode;
Expand All @@ -58,6 +74,14 @@ declare module '*/fetch-custom-view.settings.graphql' {
export default defaultDocument;
}

declare module '*/update-custom-application-deployment-preview.settings.graphql' {
import { DocumentNode } from 'graphql';
const defaultDocument: DocumentNode;
export const UpdateCustomApplicationDeploymentPreview: DocumentNode;

export default defaultDocument;
}

declare module '*/update-custom-application.settings.graphql' {
import { DocumentNode } from 'graphql';
const defaultDocument: DocumentNode;
Expand Down
28 changes: 27 additions & 1 deletion packages/application-components/src/types/generated/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,15 @@ export type TFetchProjectExtensionsNavbarQueryVariables = Exact<{ [key: string]:

export type TFetchProjectExtensionsNavbarQuery = { __typename?: 'Query', projectExtension?: { __typename?: 'ProjectExtension', id: string, installedApplications: Array<{ __typename?: 'RestrictedCustomApplicationInstallationForProject', application: { __typename?: 'RestrictedCustomApplicationForProject', id: string, entryPointUriPath: string, icon: string, mainMenuLink: { __typename?: 'CustomApplicationMenuLink', id: string, permissions: Array<string>, defaultLabel: string, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }> }, submenuLinks: Array<{ __typename?: 'CustomApplicationSubmenuLink', id: string, uriPath: string, permissions: Array<string>, defaultLabel: string, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }> }> } }> } | null };

export type TCreateCustomApplicationDeploymentPreviewMutationVariables = Exact<{
organizationId: Scalars['String'];
applicationId: Scalars['ID'];
data: TCustomApplicationDeploymentPreviewCreateInput;
}>;


export type TCreateCustomApplicationDeploymentPreviewMutation = { __typename?: 'Mutation', createCustomApplicationDeploymentPreview: { __typename?: 'CustomApplicationDeploymentPreview', id: string, alias?: string | null, url: string } };

export type TCreateCustomApplicationFromCliMutationVariables = Exact<{
organizationId: Scalars['String'];
data: TCustomApplicationDraftDataInput;
Expand All @@ -2289,12 +2298,20 @@ export type TCreateCustomViewFromCliMutationVariables = Exact<{

export type TCreateCustomViewFromCliMutation = { __typename?: 'Mutation', createCustomView?: { __typename?: 'RestrictedCustomViewForOrganization', id: string } | null };

export type TDeleteCustomApplicationDeploymentPreviewMutationVariables = Exact<{
organizationId: Scalars['String'];
deploymentId: Scalars['ID'];
}>;


export type TDeleteCustomApplicationDeploymentPreviewMutation = { __typename?: 'Mutation', deleteCustomApplicationDeploymentPreview: { __typename?: 'CustomApplicationDeploymentPreview', id: string } };

export type TFetchCustomApplicationFromCliQueryVariables = Exact<{
entryPointUriPath: Scalars['String'];
}>;


export type TFetchCustomApplicationFromCliQuery = { __typename?: 'Query', organizationExtensionForCustomApplication?: { __typename?: 'OrganizationExtensionForCustomApplication', organizationId: string, application: { __typename?: 'RestrictedCustomApplicationForOrganization', id: string, entryPointUriPath: string, name: string, description?: string | null, url: string, icon: string, permissions: Array<{ __typename?: 'CustomApplicationPermission', name: string, oAuthScopes: Array<string> }>, mainMenuLink: { __typename?: 'CustomApplicationMenuLink', defaultLabel: string, permissions: Array<string>, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }> }, submenuLinks: Array<{ __typename?: 'CustomApplicationSubmenuLink', uriPath: string, defaultLabel: string, permissions: Array<string>, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }> }> } } | null };
export type TFetchCustomApplicationFromCliQuery = { __typename?: 'Query', organizationExtensionForCustomApplication?: { __typename?: 'OrganizationExtensionForCustomApplication', organizationId: string, application: { __typename?: 'RestrictedCustomApplicationForOrganization', id: string, entryPointUriPath: string, name: string, description?: string | null, url: string, icon: string, permissions: Array<{ __typename?: 'CustomApplicationPermission', name: string, oAuthScopes: Array<string> }>, mainMenuLink: { __typename?: 'CustomApplicationMenuLink', defaultLabel: string, permissions: Array<string>, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }> }, submenuLinks: Array<{ __typename?: 'CustomApplicationSubmenuLink', uriPath: string, defaultLabel: string, permissions: Array<string>, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }> }>, deployments: Array<{ __typename?: 'CustomApplicationDeploymentPreview', id: string, url: string, alias?: string | null }> } } | null };

export type TFetchCustomViewFromCliQueryVariables = Exact<{
customViewId: Scalars['String'];
Expand All @@ -2303,6 +2320,15 @@ export type TFetchCustomViewFromCliQueryVariables = Exact<{

export type TFetchCustomViewFromCliQuery = { __typename?: 'Query', organizationExtensionForCustomView?: { __typename?: 'OrganizationExtensionForCustomView', organizationId: string, customView?: { __typename?: 'RestrictedCustomViewForOrganization', id: string, defaultLabel: string, url: string, type: TCustomViewType, locators: Array<string>, labelAllLocales: Array<{ __typename?: 'LocalizedField', locale: string, value: string }>, typeSettings?: { __typename?: 'CustomViewTypeSettings', size?: TCustomViewSize | null } | null, permissions: Array<{ __typename?: 'CustomViewPermission', name: string, oAuthScopes: Array<string> }> } | null } | null };

export type TUpdateCustomApplicationDeploymentPreviewMutationVariables = Exact<{
organizationId: Scalars['String'];
deploymentId: Scalars['ID'];
data: TCustomApplicationDeploymentPreviewUpdateInput;
}>;


export type TUpdateCustomApplicationDeploymentPreviewMutation = { __typename?: 'Mutation', updateCustomApplicationDeploymentPreview: { __typename?: 'CustomApplicationDeploymentPreview', id: string, alias?: string | null, url: string } };

export type TUpdateCustomApplicationFromCliMutationVariables = Exact<{
organizationId: Scalars['String'];
data: TCustomApplicationDraftDataInput;
Expand Down
51 changes: 51 additions & 0 deletions packages/application-config/src/generated/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2244,6 +2244,22 @@ export type TFetchProjectExtensionsNavbarQuery = {
} | null;
};

export type TCreateCustomApplicationDeploymentPreviewMutationVariables = Exact<{
organizationId: Scalars['String'];
applicationId: Scalars['ID'];
data: TCustomApplicationDeploymentPreviewCreateInput;
}>;

export type TCreateCustomApplicationDeploymentPreviewMutation = {
__typename?: 'Mutation';
createCustomApplicationDeploymentPreview: {
__typename?: 'CustomApplicationDeploymentPreview';
id: string;
alias?: string | null;
url: string;
};
};

export type TCreateCustomApplicationFromCliMutationVariables = Exact<{
organizationId: Scalars['String'];
data: TCustomApplicationDraftDataInput;
Expand All @@ -2270,6 +2286,19 @@ export type TCreateCustomViewFromCliMutation = {
} | null;
};

export type TDeleteCustomApplicationDeploymentPreviewMutationVariables = Exact<{
organizationId: Scalars['String'];
deploymentId: Scalars['ID'];
}>;

export type TDeleteCustomApplicationDeploymentPreviewMutation = {
__typename?: 'Mutation';
deleteCustomApplicationDeploymentPreview: {
__typename?: 'CustomApplicationDeploymentPreview';
id: string;
};
};

export type TFetchCustomApplicationFromCliQueryVariables = Exact<{
entryPointUriPath: Scalars['String'];
}>;
Expand Down Expand Up @@ -2313,6 +2342,12 @@ export type TFetchCustomApplicationFromCliQuery = {
value: string;
}>;
}>;
deployments: Array<{
__typename?: 'CustomApplicationDeploymentPreview';
id: string;
url: string;
alias?: string | null;
}>;
};
} | null;
};
Expand Down Expand Up @@ -2351,6 +2386,22 @@ export type TFetchCustomViewFromCliQuery = {
} | null;
};

export type TUpdateCustomApplicationDeploymentPreviewMutationVariables = Exact<{
organizationId: Scalars['String'];
deploymentId: Scalars['ID'];
data: TCustomApplicationDeploymentPreviewUpdateInput;
}>;

export type TUpdateCustomApplicationDeploymentPreviewMutation = {
__typename?: 'Mutation';
updateCustomApplicationDeploymentPreview: {
__typename?: 'CustomApplicationDeploymentPreview';
id: string;
alias?: string | null;
url: string;
};
};

export type TUpdateCustomApplicationFromCliMutationVariables = Exact<{
organizationId: Scalars['String'];
data: TCustomApplicationDraftDataInput;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df253eb

Please sign in to comment.