From c53ea7d1eafbaf0afc66fb4960be4430bee8cfd2 Mon Sep 17 00:00:00 2001 From: Eirik Skogstad Date: Mon, 27 Feb 2023 16:48:36 -0800 Subject: [PATCH 01/10] feat(publish): adding job id to the publish command --- src/commands/community/publish.ts | 1 + src/shared/community/connect/CommunityPublishResource.ts | 7 +++++-- src/shared/community/defs/CommunityPublishResponse.ts | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/commands/community/publish.ts b/src/commands/community/publish.ts index 815e7573..787c4e5e 100644 --- a/src/commands/community/publish.ts +++ b/src/commands/community/publish.ts @@ -62,6 +62,7 @@ export class CommunityPublishCommand extends SfCommand name: { header: 'Name' }, status: { header: 'Status' }, url: { header: 'Url' }, + jobId: { header: 'JobId' }, }; this.styledHeader(messages.getMessage('response.styleHeader')); this.table([results], columns); diff --git a/src/shared/community/connect/CommunityPublishResource.ts b/src/shared/community/connect/CommunityPublishResource.ts index 3fb06807..2af852e5 100644 --- a/src/shared/community/connect/CommunityPublishResource.ts +++ b/src/shared/community/connect/CommunityPublishResource.ts @@ -28,7 +28,7 @@ export type CommunityPublishResourceOptions = { export class CommunityPublishResource implements ConnectResource { private info?: CommunityInfo; - public constructor(private options: CommunityPublishResourceOptions) {} + public constructor(private options: CommunityPublishResourceOptions) { } public async fetchRelativeConnectUrl(): Promise { return `/connect/communities/${await this.fetchCommunityId()}/publish`; @@ -44,13 +44,16 @@ export class CommunityPublishResource implements ConnectResource Date: Tue, 28 Feb 2023 14:04:48 -0800 Subject: [PATCH 02/10] feat(create): adding job id to the creaet command --- src/commands/community/create.ts | 2 ++ .../community/connect/CommunityCreateResource.ts | 13 ++++++++++--- .../community/defs/CommunityCreateResponse.ts | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/commands/community/create.ts b/src/commands/community/create.ts index 7e9130b6..5349716c 100644 --- a/src/commands/community/create.ts +++ b/src/commands/community/create.ts @@ -24,6 +24,7 @@ const messages = Messages.loadMessages('@salesforce/plugin-community', 'create') const MESSAGE_KEY = 'message'; const NAME_KEY = 'name'; +const JOBID_KEY = 'jobId'; const ACTION_KEY = 'action'; /** @@ -94,6 +95,7 @@ export class CommunityCreateCommand extends SfCommand { const columns = { [NAME_KEY]: { header: 'Name' }, [MESSAGE_KEY]: { header: 'Message' }, + [JOBID_KEY]: { header: 'JobId' }, [ACTION_KEY]: { header: 'Action' }, }; this.styledHeader(messages.getMessage('response.styleHeader')); diff --git a/src/shared/community/connect/CommunityCreateResource.ts b/src/shared/community/connect/CommunityCreateResource.ts index a8cd1c37..0965e5f0 100644 --- a/src/shared/community/connect/CommunityCreateResource.ts +++ b/src/shared/community/connect/CommunityCreateResource.ts @@ -14,18 +14,25 @@ import { ConnectResource } from '../../connect/services/ConnectResource'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/plugin-community', 'create'); +<<<<<<< HEAD +======= +const NAME_KEY = 'name'; +const JOBID_KEY = 'jobId'; + +>>>>>>> ba5156f (feat(create): adding job id to the creaet command) /** * A connect api resource for creating a community */ export class CommunityCreateResource implements ConnectResource { // eslint-disable-next-line @typescript-eslint/no-explicit-any - public constructor(private options: CommunityCreateParams) {} + public constructor(private options: CommunityCreateParams) { } // eslint-disable-next-line class-methods-use-this - public handleSuccess(result: JsonCollection & { name: string }): CommunityCreateResponse { + public handleSuccess(result: JsonCollection & { [NAME_KEY]?: string; jobId?: string }): CommunityCreateResponse { const response: CommunityCreateResponse = { message: messages.getMessage('response.createMessage'), - name: result.name, + name: result[NAME_KEY], + jobId: result[JOBID_KEY], action: messages.getMessage('response.action'), }; return response; diff --git a/src/shared/community/defs/CommunityCreateResponse.ts b/src/shared/community/defs/CommunityCreateResponse.ts index 4155fd01..5e069138 100644 --- a/src/shared/community/defs/CommunityCreateResponse.ts +++ b/src/shared/community/defs/CommunityCreateResponse.ts @@ -19,6 +19,11 @@ export type CommunityCreateResponse = { */ name: string; + /** + * id of the BackgroundOperation that runs the create job + */ + jobId: string; + /** * the next actions that user can do to check, if community is created or not. */ From 24d3a292fcfc4feadf78696916fa5e926e786677 Mon Sep 17 00:00:00 2001 From: Eirik Skogstad Date: Wed, 1 Mar 2023 16:44:42 -0800 Subject: [PATCH 03/10] feat(create): minor fix plus unit tests --- src/shared/community/connect/CommunityCreateResource.ts | 4 +++- .../community/connect/CommunityCreateResource.test.ts | 6 ++++-- .../community/connect/CommunityPublishResource.test.ts | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/shared/community/connect/CommunityCreateResource.ts b/src/shared/community/connect/CommunityCreateResource.ts index 0965e5f0..8d1cf37d 100644 --- a/src/shared/community/connect/CommunityCreateResource.ts +++ b/src/shared/community/connect/CommunityCreateResource.ts @@ -28,7 +28,9 @@ export class CommunityCreateResource implements ConnectResource { const urlPathPrefix = 'urlPathPrefix'; const templateName = 'templateName'; const description = 'description'; + const jobId = '000xx0000000000000'; let table: sinon.SinonStub; let styledHeader: sinon.SinonStub; @@ -68,14 +69,15 @@ describe('CommunityCreateResource', () => { describe('handleSuccess', () => { it('should return community info', () => { - const connectResponse = { - message: 'message', + const connectResponse: JsonCollection = { name: communityName, + jobId, }; const result: CommunityCreateResponse = communityCreateResource.handleSuccess(connectResponse); expect(result.message).to.equal(messages.getMessage('response.createMessage')); expect(result.name).to.equal(communityName); + expect(result.jobId).to.equal(jobId); expect(result.action).to.equal(messages.getMessage('response.action')); }); }); diff --git a/test/shared/community/connect/CommunityPublishResource.test.ts b/test/shared/community/connect/CommunityPublishResource.test.ts index 911a8f8b..ed80938f 100644 --- a/test/shared/community/connect/CommunityPublishResource.test.ts +++ b/test/shared/community/connect/CommunityPublishResource.test.ts @@ -21,6 +21,7 @@ describe('CommunityPublishResource', () => { let org: Org; let communityPublishResource: CommunityPublishResource; const communityName = 'communityName'; + const jobId = '000xx0000000000000'; const validCommunityId = '0DB0000000000'; let table: sinon.SinonStub; let styledHeader: sinon.SinonStub; @@ -104,6 +105,7 @@ describe('CommunityPublishResource', () => { message: 'message', name: communityName, url: 'http://someurl.com/s', + jobId, }; // This sets up CommunityInfo await communityPublishResource.fetchCommunityId(); @@ -115,6 +117,7 @@ describe('CommunityPublishResource', () => { expect(result.name).to.equal(communityName); expect(result.status).to.equal('UnderConstruction'); expect(result.url.toString()).to.equal('http://someurl.com/s'); + expect(result.jobId).to.equal(jobId); }); }); From 8050e4391bd0f95c6641eb6a916cfcaa5307cefe Mon Sep 17 00:00:00 2001 From: Eirik Skogstad Date: Thu, 20 Apr 2023 16:07:35 -0700 Subject: [PATCH 04/10] docs(create): update readme/description of create command --- README.md | 24 ++++++++++-------------- messages/create.md | 15 +++++++++------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d551f12b..048cf231 100644 --- a/README.md +++ b/README.md @@ -110,25 +110,21 @@ OPTIONS this command invocation DESCRIPTION - See 'Which Experience Cloud Template Should I Use?' in Salesforce Help for more information about the different - template types available for Experience Cloud. + Run the "community list template" command to see the templates available in your org. See 'Which Experience Cloud Template Should I Use?' in Salesforce Help for more information about the different template types available. + + When you create a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED or AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED. Name and values are case-sensitive. See 'DigitalExperienceBundle' in the Metadata API Developer Guide for more information. + + The site creation process is an async job that generates a jobId. To check the site creation status, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. - When creating a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using - the format templateParams.AuthenticationType=value, where value is AUTHENTICATED, UNAUTHENTICATED, or - AUTHENTICATED_WITH_PUBLIC_ACCESS. Name and values are case-sensitive. See 'ExperienceBundle' in the Metadata API - Developer Guide for more information. + If the job doesn’t complete within 10 minutes, it times out. You receive an error message and must restart the site creation process. Completed jobs expire after 24 hours and are removed from the database. - When you execute this command, it creates the site in preview status, which means that it isn't yet live. After you - finish building your site, you can make it live. + When you run this command, it creates the site in preview status, which means that the site isn't yet live. After you finish building your site, you can make it live. - If you have an Experience Builder site, publish the site using the sfdx force:community:publish command to make it - live. + If you have an Experience Builder site, publish the site using the "community publish" command to make it live. - If you have a Salesforce Tabs + Visualforce site, activate the site to make it live by updating the status field of - the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and - click Activate. + If you have a Salesforce Tabs + Visualforce site, to activate the site and make it live, update the status field of the Network type in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. - For Experience Builder sites, activating the site just sends out a welcome email to site members. + For Experience Builder sites, activating the site sends a welcome email to site members. EXAMPLES $ sfdx force:community:create --name 'My Customer Site' --templatename 'Customer Service' --urlpathprefix customers diff --git a/messages/create.md b/messages/create.md index 97aa9aa5..d27596c0 100644 --- a/messages/create.md +++ b/messages/create.md @@ -4,18 +4,21 @@ Create an Experience Cloud site using a template. # description -See 'Which Experience Cloud Template Should I Use?' (https://help.salesforce.com/s/articleView?id=sf.siteforce_commtemp_intro.htm&type=5) in Salesforce Help for more information about the different template -types available for Experience Cloud. +Run the "community list template" command to see the templates available in your org. See 'Which Experience Cloud Template Should I Use?' in Salesforce Help for more information about the different template types available. (https://help.salesforce.com/s/articleView?id=sf.siteforce_commtemp_intro.htm&type=5) -When creating a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED, UNAUTHENTICATED, or AUTHENTICATED_WITH_PUBLIC_ACCESS. Name and values are case-sensitive. See 'ExperienceBundle' in the Metadata API Developer Guide for more information. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_experiencebundle.htm) +When you create a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED or AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED. Name and values are case-sensitive. See 'DigitalExperienceBundle' in the Metadata API Developer Guide for more information. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_digitalexperiencebundle.htm) -When you execute this command, it creates the site in preview status, which means that it isn't yet live. After you finish building your site, you can make it live. +The site creation process is an async job that generates a jobId. To check the site creation status, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. (https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_backgroundoperation.htm) + +If the job doesn’t complete within 10 minutes, it times out. You receive an error message and must restart the site creation process. Completed jobs expire after 24 hours and are removed from the database. + +When you run this command, it creates the site in preview status, which means that the site isn't yet live. After you finish building your site, you can make it live. If you have an Experience Builder site, publish the site using the "community publish" command to make it live. -If you have a Salesforce Tabs + Visualforce site, activate the site to make it live by updating the status field of the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. +If you have a Salesforce Tabs + Visualforce site, to activate the site and make it live, update the status field of the Network type in Metadata API. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_network.htm) Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. -For Experience Builder sites, activating the site just sends out a welcome email to site members. +For Experience Builder sites, activating the site sends a welcome email to site members. # examples From 5680e21618d6adc94e46b3f06b2d86039d933c6c Mon Sep 17 00:00:00 2001 From: Eirik Skogstad Date: Fri, 21 Apr 2023 09:11:41 -0700 Subject: [PATCH 05/10] docs(publish): update readme/description of publish command --- README.md | 15 +++++---------- messages/publish.md | 8 ++++---- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 048cf231..fb6bab73 100644 --- a/README.md +++ b/README.md @@ -161,19 +161,14 @@ OPTIONS this command invocation DESCRIPTION - Each time you publish it, you update the live site with the most recent updates. - When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access - for site members. + Each time you publish a site, you update the live site with the most recent updates. When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access for site members. - Additionally, to send a welcome email to all site members, you must activate the site. (Activation is also required to - successfully set up SEO for Experience Builder sites.) To activate a site, update the status field of the Network - type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click - Activate. + In addition to publishing, you must activate a site to send a welcome email to all site members. Activation is also required to set up SEO for Experience Builder sites. To activate a site, update the status field of the Network type in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. - Subsequently, each time you publish the site, you update the live site with all changes made to the site since it was - last published. + An email notification informs you when your changes are live on the published site. The site publish process is an async job that generates a jobId. To check the site publish status manually, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. + + If the job doesn’t complete within 15 minutes, it times out. You receive an error message and must restart the site publish process. Completed jobs expire after 24 hours and are removed from the database. - An email notification informs you when your changes are live. EXAMPLE $ sfdx force:community:publish --name 'My Customer Site' diff --git a/messages/publish.md b/messages/publish.md index 990901c5..c9cbd2a4 100644 --- a/messages/publish.md +++ b/messages/publish.md @@ -4,13 +4,13 @@ Publish an Experience Builder site to make it live. # description -Each time you publish it, you update the live site with the most recent updates. When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access for site members. +Each time you publish a site, you update the live site with the most recent updates. When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access for site members. -Additionally, to send a welcome email to all site members, you must activate the site. (Activation is also required to successfully set up SEO for Experience Builder sites.) To activate a site, update the status field of the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. +In addition to publishing, you must activate a site to send a welcome email to all site members. Activation is also required to set up SEO for Experience Builder sites. To activate a site, update the status field of the Network type in Metadata API. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_network.htm)Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. -Subsequently, each time you publish the site, you update the live site with all changes made to the site since it was last published. +An email notification informs you when your changes are live on the published site. The site publish process is an async job that generates a jobId. To check the site publish status manually, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. (https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_backgroundoperation.htm) -An email notification informs you when your changes are live. +If the job doesn’t complete within 15 minutes, it times out. You receive an error message and must restart the site publish process. Completed jobs expire after 24 hours and are removed from the database. # examples From 108dc21175a5f6c75563df1e3378b2783e51f76b Mon Sep 17 00:00:00 2001 From: Eirik Skogstad Date: Fri, 21 Apr 2023 09:20:59 -0700 Subject: [PATCH 06/10] docs(readme): readme formatting --- README.md | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fb6bab73..8e173cef 100644 --- a/README.md +++ b/README.md @@ -110,19 +110,29 @@ OPTIONS this command invocation DESCRIPTION - Run the "community list template" command to see the templates available in your org. See 'Which Experience Cloud Template Should I Use?' in Salesforce Help for more information about the different template types available. + Run the "community list template" command to see the templates available in your org. See 'Which Experience Cloud + Template Should I Use?' in Salesforce Help for more information about the different template types available. - When you create a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED or AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED. Name and values are case-sensitive. See 'DigitalExperienceBundle' in the Metadata API Developer Guide for more information. + When you create a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value + using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED or + AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED. Name and values are case-sensitive. See 'DigitalExperienceBundle' in the + Metadata API Developer Guide for more information. - The site creation process is an async job that generates a jobId. To check the site creation status, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. + The site creation process is an async job that generates a jobId. To check the site creation status, query the + BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the + Salesforce Platform for more information. - If the job doesn’t complete within 10 minutes, it times out. You receive an error message and must restart the site creation process. Completed jobs expire after 24 hours and are removed from the database. + If the job doesn’t complete within 10 minutes, it times out. You receive an error message and must restart the site + creation process. Completed jobs expire after 24 hours and are removed from the database. - When you run this command, it creates the site in preview status, which means that the site isn't yet live. After you finish building your site, you can make it live. + When you run this command, it creates the site in preview status, which means that the site isn't yet live. After you + finish building your site, you can make it live. If you have an Experience Builder site, publish the site using the "community publish" command to make it live. - If you have a Salesforce Tabs + Visualforce site, to activate the site and make it live, update the status field of the Network type in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. + If you have a Salesforce Tabs + Visualforce site, to activate the site and make it live, update the status field of + the Network type in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click + Activate. For Experience Builder sites, activating the site sends a welcome email to site members. @@ -161,13 +171,20 @@ OPTIONS this command invocation DESCRIPTION - Each time you publish a site, you update the live site with the most recent updates. When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access for site members. + Each time you publish a site, you update the live site with the most recent updates. When you publish an Experience + Builder site for the first time, you make the site's URL live and enable login access for site members. - In addition to publishing, you must activate a site to send a welcome email to all site members. Activation is also required to set up SEO for Experience Builder sites. To activate a site, update the status field of the Network type in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. + In addition to publishing, you must activate a site to send a welcome email to all site members. Activation is also + required to set up SEO for Experience Builder sites. To activate a site, update the status field of the Network type + in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. - An email notification informs you when your changes are live on the published site. The site publish process is an async job that generates a jobId. To check the site publish status manually, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. + An email notification informs you when your changes are live on the published site. The site publish process is an + async job that generates a jobId. To check the site publish status manually, query the BackgroundOperation object and + enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more + information. - If the job doesn’t complete within 15 minutes, it times out. You receive an error message and must restart the site publish process. Completed jobs expire after 24 hours and are removed from the database. + If the job doesn’t complete within 15 minutes, it times out. You receive an error message and must restart the site + publish process. Completed jobs expire after 24 hours and are removed from the database. EXAMPLE From ffd9a17816c65836f1619c2771a90d0dd1d7233c Mon Sep 17 00:00:00 2001 From: Eirik Skogstad Date: Fri, 21 Apr 2023 09:24:56 -0700 Subject: [PATCH 07/10] docs(create): new response action message for create --- messages/create.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/messages/create.md b/messages/create.md index d27596c0..4d6aa974 100644 --- a/messages/create.md +++ b/messages/create.md @@ -64,8 +64,7 @@ The description displays in Digital Experiences - All Sites in Setup and helps w # response.action -We’re creating your site. Run sfdx force:org:open -p \_ui/networks/setup/SetupNetworksPage to view a list of your sites, -and to confirm when this site is ready. +Site creation is under way. To track its status, query the BackgroundOperation object and include the jobId. # response.styleHeader From b398153724b18eb90f13aa0ea6725d5376ad3279 Mon Sep 17 00:00:00 2001 From: eskogstad Date: Wed, 24 May 2023 14:14:05 -0700 Subject: [PATCH 08/10] fix: update branch --- src/shared/community/connect/CommunityCreateResource.ts | 5 +---- .../shared/community/connect/CommunityCreateResource.test.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/shared/community/connect/CommunityCreateResource.ts b/src/shared/community/connect/CommunityCreateResource.ts index 8d1cf37d..56b806d5 100644 --- a/src/shared/community/connect/CommunityCreateResource.ts +++ b/src/shared/community/connect/CommunityCreateResource.ts @@ -14,18 +14,15 @@ import { ConnectResource } from '../../connect/services/ConnectResource'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/plugin-community', 'create'); -<<<<<<< HEAD -======= const NAME_KEY = 'name'; const JOBID_KEY = 'jobId'; ->>>>>>> ba5156f (feat(create): adding job id to the creaet command) /** * A connect api resource for creating a community */ export class CommunityCreateResource implements ConnectResource { // eslint-disable-next-line @typescript-eslint/no-explicit-any - public constructor(private options: CommunityCreateParams) { } + public constructor(private options: CommunityCreateParams) {} // eslint-disable-next-line class-methods-use-this public handleSuccess( diff --git a/test/shared/community/connect/CommunityCreateResource.test.ts b/test/shared/community/connect/CommunityCreateResource.test.ts index fc44d8a9..8555765f 100644 --- a/test/shared/community/connect/CommunityCreateResource.test.ts +++ b/test/shared/community/connect/CommunityCreateResource.test.ts @@ -69,7 +69,7 @@ describe('CommunityCreateResource', () => { describe('handleSuccess', () => { it('should return community info', () => { - const connectResponse: JsonCollection = { + const connectResponse: JsonMap = { name: communityName, jobId, }; From a4403767e3e4f70c1e10aa3e7e2f98566f3c5c58 Mon Sep 17 00:00:00 2001 From: eskogstad Date: Wed, 24 May 2023 14:23:44 -0700 Subject: [PATCH 09/10] fix: update params --- src/shared/community/connect/CommunityCreateResource.ts | 4 +--- src/shared/community/connect/CommunityPublishResource.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/shared/community/connect/CommunityCreateResource.ts b/src/shared/community/connect/CommunityCreateResource.ts index 56b806d5..4f105474 100644 --- a/src/shared/community/connect/CommunityCreateResource.ts +++ b/src/shared/community/connect/CommunityCreateResource.ts @@ -25,9 +25,7 @@ export class CommunityCreateResource implements ConnectResource { private info?: CommunityInfo; - public constructor(private options: CommunityPublishResourceOptions) { } + public constructor(private options: CommunityPublishResourceOptions) {} public async fetchRelativeConnectUrl(): Promise { return `/connect/communities/${await this.fetchCommunityId()}/publish`; @@ -45,7 +45,7 @@ export class CommunityPublishResource implements ConnectResource Date: Wed, 24 May 2023 14:34:11 -0700 Subject: [PATCH 10/10] fix: update schemas --- schemas/community-create.json | 4 ++++ schemas/community-publish.json | 4 ++++ src/shared/community/defs/CommunityCreateResponse.ts | 2 +- src/shared/community/defs/CommunityPublishResponse.ts | 2 +- test/shared/community/connect/CommunityCreateResource.test.ts | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/schemas/community-create.json b/schemas/community-create.json index f0660469..b9cf9aff 100644 --- a/schemas/community-create.json +++ b/schemas/community-create.json @@ -13,6 +13,10 @@ "type": "string", "description": "name of the community" }, + "jobId": { + "type": "string", + "description": "id of the BackgroundOperation that runs the create job" + }, "action": { "type": "string", "description": "the next actions that user can do to check, if community is created or not." diff --git a/schemas/community-publish.json b/schemas/community-publish.json index c309844a..8205821c 100644 --- a/schemas/community-publish.json +++ b/schemas/community-publish.json @@ -24,6 +24,10 @@ "url": { "type": "string", "description": "url to access the community" + }, + "jobId": { + "type": "string", + "description": "id of the BackgroundOperation that runs the publish job" } }, "required": ["id", "message", "name", "url"], diff --git a/src/shared/community/defs/CommunityCreateResponse.ts b/src/shared/community/defs/CommunityCreateResponse.ts index 5e069138..e0d98aaf 100644 --- a/src/shared/community/defs/CommunityCreateResponse.ts +++ b/src/shared/community/defs/CommunityCreateResponse.ts @@ -22,7 +22,7 @@ export type CommunityCreateResponse = { /** * id of the BackgroundOperation that runs the create job */ - jobId: string; + jobId?: string; /** * the next actions that user can do to check, if community is created or not. diff --git a/src/shared/community/defs/CommunityPublishResponse.ts b/src/shared/community/defs/CommunityPublishResponse.ts index 2b6e628a..dc961c37 100644 --- a/src/shared/community/defs/CommunityPublishResponse.ts +++ b/src/shared/community/defs/CommunityPublishResponse.ts @@ -38,5 +38,5 @@ export type CommunityPublishResponse = { /** * id of the BackgroundOperation that runs the publish job */ - jobId: string; + jobId?: string; }; diff --git a/test/shared/community/connect/CommunityCreateResource.test.ts b/test/shared/community/connect/CommunityCreateResource.test.ts index 8555765f..00e868fb 100644 --- a/test/shared/community/connect/CommunityCreateResource.test.ts +++ b/test/shared/community/connect/CommunityCreateResource.test.ts @@ -69,7 +69,7 @@ describe('CommunityCreateResource', () => { describe('handleSuccess', () => { it('should return community info', () => { - const connectResponse: JsonMap = { + const connectResponse = { name: communityName, jobId, };