sf-plugin-cms 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +277 -0
- package/lib/commands/cms/command-base.d.ts +16 -0
- package/lib/commands/cms/command-base.js +42 -0
- package/lib/commands/cms/command-base.js.map +1 -0
- package/lib/commands/cms/export/workspace.d.ts +14 -0
- package/lib/commands/cms/export/workspace.js +42 -0
- package/lib/commands/cms/export/workspace.js.map +1 -0
- package/lib/commands/cms/get/channel.d.ts +13 -0
- package/lib/commands/cms/get/channel.js +23 -0
- package/lib/commands/cms/get/channel.js.map +1 -0
- package/lib/commands/cms/get/content.d.ts +17 -0
- package/lib/commands/cms/get/content.js +35 -0
- package/lib/commands/cms/get/content.js.map +1 -0
- package/lib/commands/cms/get/variant.d.ts +13 -0
- package/lib/commands/cms/get/variant.js +23 -0
- package/lib/commands/cms/get/variant.js.map +1 -0
- package/lib/commands/cms/get/workspace.d.ts +13 -0
- package/lib/commands/cms/get/workspace.js +23 -0
- package/lib/commands/cms/get/workspace.js.map +1 -0
- package/lib/commands/cms/import/workspace.d.ts +18 -0
- package/lib/commands/cms/import/workspace.js +77 -0
- package/lib/commands/cms/import/workspace.js.map +1 -0
- package/lib/commands/cms/info.d.ts +12 -0
- package/lib/commands/cms/info.js +13 -0
- package/lib/commands/cms/info.js.map +1 -0
- package/lib/commands/cms/list/channel.d.ts +15 -0
- package/lib/commands/cms/list/channel.js +28 -0
- package/lib/commands/cms/list/channel.js.map +1 -0
- package/lib/commands/cms/list/workspace.d.ts +15 -0
- package/lib/commands/cms/list/workspace.js +27 -0
- package/lib/commands/cms/list/workspace.js.map +1 -0
- package/lib/generated/operations.d.ts +233 -0
- package/lib/generated/operations.js +317 -0
- package/lib/generated/operations.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/openapi/generate.d.ts +30 -0
- package/lib/openapi/generate.js +150 -0
- package/lib/openapi/generate.js.map +1 -0
- package/lib/openapi/intake.d.ts +26 -0
- package/lib/openapi/intake.js +176 -0
- package/lib/openapi/intake.js.map +1 -0
- package/lib/openapi/selected.d.ts +11 -0
- package/lib/openapi/selected.js +49 -0
- package/lib/openapi/selected.js.map +1 -0
- package/lib/services/export-workspace.d.ts +37 -0
- package/lib/services/export-workspace.js +214 -0
- package/lib/services/export-workspace.js.map +1 -0
- package/lib/services/import-workspace.d.ts +112 -0
- package/lib/services/import-workspace.js +570 -0
- package/lib/services/import-workspace.js.map +1 -0
- package/lib/services/read.d.ts +20 -0
- package/lib/services/read.js +73 -0
- package/lib/services/read.js.map +1 -0
- package/lib/services/write.d.ts +27 -0
- package/lib/services/write.js +21 -0
- package/lib/services/write.js.map +1 -0
- package/lib/transport/json-mutation.d.ts +15 -0
- package/lib/transport/json-mutation.js +81 -0
- package/lib/transport/json-mutation.js.map +1 -0
- package/lib/transport/json-request.d.ts +26 -0
- package/lib/transport/json-request.js +135 -0
- package/lib/transport/json-request.js.map +1 -0
- package/lib/transport/redact-secrets.d.ts +6 -0
- package/lib/transport/redact-secrets.js +31 -0
- package/lib/transport/redact-secrets.js.map +1 -0
- package/messages/cms.export.workspace.md +29 -0
- package/messages/cms.get.channel.md +25 -0
- package/messages/cms.get.content.md +41 -0
- package/messages/cms.get.variant.md +25 -0
- package/messages/cms.get.workspace.md +25 -0
- package/messages/cms.import.workspace.md +45 -0
- package/messages/cms.list.channel.md +33 -0
- package/messages/cms.list.workspace.md +32 -0
- package/package.json +98 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type WorkspaceImportResult } from '../../../services/import-workspace.js';
|
|
2
|
+
import { CmsCommand } from '../command-base.js';
|
|
3
|
+
export default class ImportWorkspace extends CmsCommand<WorkspaceImportResult> {
|
|
4
|
+
static readonly summary = "Safely plan or apply a create-only import into a CMS workspace.";
|
|
5
|
+
static readonly description = "Validates an exported workspace package locally, checks every content key for destination conflicts, and defaults to a non-mutating dry run. Pass --apply with a new --report-dir to create content.";
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'workspace-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'source-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
apply: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'allow-partial': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'report-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<WorkspaceImportResult>;
|
|
17
|
+
private showPlan;
|
|
18
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Flags } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { executeWorkspaceImport, loadWorkspaceExport, } from '../../../services/import-workspace.js';
|
|
3
|
+
import { getWorkspace } from '../../../services/read.js';
|
|
4
|
+
import { apiVersionFlag, CmsCommand, targetOrgFlag } from '../command-base.js';
|
|
5
|
+
export default class ImportWorkspace extends CmsCommand {
|
|
6
|
+
static summary = 'Safely plan or apply a create-only import into a CMS workspace.';
|
|
7
|
+
static description = 'Validates an exported workspace package locally, checks every content key for destination conflicts, and defaults to a non-mutating dry run. Pass --apply with a new --report-dir to create content.';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> cms import workspace --target-org my-org --workspace-id 0Zu... --source-dir ./cms-export',
|
|
10
|
+
'<%= config.bin %> cms import workspace --target-org my-org --workspace-id 0Zu... --source-dir ./cms-export --apply --report-dir ./cms-import-report',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
'target-org': targetOrgFlag,
|
|
14
|
+
'api-version': apiVersionFlag,
|
|
15
|
+
'workspace-id': Flags.string({ required: true, summary: 'Destination CMS workspace ID.' }),
|
|
16
|
+
'source-dir': Flags.directory({
|
|
17
|
+
exists: true,
|
|
18
|
+
required: true,
|
|
19
|
+
summary: 'Workspace export directory containing manifest.json and items/.',
|
|
20
|
+
}),
|
|
21
|
+
apply: Flags.boolean({
|
|
22
|
+
default: false,
|
|
23
|
+
summary: 'Create the planned content after all validation and conflict checks pass.',
|
|
24
|
+
}),
|
|
25
|
+
'allow-partial': Flags.boolean({
|
|
26
|
+
default: false,
|
|
27
|
+
summary: 'Accept an export whose manifest records omissions or incomplete coverage.',
|
|
28
|
+
}),
|
|
29
|
+
'report-dir': Flags.directory({
|
|
30
|
+
dependsOn: ['apply'],
|
|
31
|
+
exists: false,
|
|
32
|
+
summary: 'New directory for the durable applied-import run report.',
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
async run() {
|
|
36
|
+
const { flags } = await this.parse(ImportWorkspace);
|
|
37
|
+
if (flags.apply && flags['report-dir'] === undefined) {
|
|
38
|
+
throw new Error('--report-dir is required when --apply is set.');
|
|
39
|
+
}
|
|
40
|
+
// Reject malformed, unsafe, or disallowed partial packages before contacting the org.
|
|
41
|
+
await loadWorkspaceExport(flags['source-dir'], { allowPartial: flags['allow-partial'] });
|
|
42
|
+
const { connection, orgId } = await this.getOrgContext(flags['target-org'], flags['api-version']);
|
|
43
|
+
const workspace = await getWorkspace(connection, flags['workspace-id']);
|
|
44
|
+
const result = await executeWorkspaceImport({
|
|
45
|
+
allowPartial: flags['allow-partial'],
|
|
46
|
+
connection,
|
|
47
|
+
destinationOrgId: orgId,
|
|
48
|
+
destinationWorkspace: workspace,
|
|
49
|
+
dryRun: !flags.apply,
|
|
50
|
+
reportDirectory: flags['report-dir'],
|
|
51
|
+
sourceDirectory: flags['source-dir'],
|
|
52
|
+
workspaceId: flags['workspace-id'],
|
|
53
|
+
});
|
|
54
|
+
if (!this.jsonEnabled())
|
|
55
|
+
this.showPlan(result);
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
showPlan(result) {
|
|
59
|
+
const primaryCount = result.plan.groups.length;
|
|
60
|
+
const variantCount = result.plan.groups.reduce((count, group) => count + group.variants.length, 0);
|
|
61
|
+
this.log(`Mode: ${result.dryRun ? 'dry-run (no mutations)' : 'apply (create-only)'}`);
|
|
62
|
+
this.log(`Destination workspace: ${result.plan.destinationWorkspaceId}`);
|
|
63
|
+
this.log(`Destination root folder: ${result.plan.rootFolderId}`);
|
|
64
|
+
this.log(`Planned new content: ${primaryCount} parent(s), ${variantCount} child variant(s)`);
|
|
65
|
+
for (const group of result.plan.groups) {
|
|
66
|
+
const childLanguages = group.variants.map(({ language }) => language).join(', ') || 'none';
|
|
67
|
+
this.log(`- ${group.contentKey}: primary ${group.primary.language}; child languages ${childLanguages}`);
|
|
68
|
+
}
|
|
69
|
+
if (result.dryRun) {
|
|
70
|
+
this.log('No content was created. Re-run with --apply and a new --report-dir to mutate.');
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this.log(`Run report: ${result.reportFile ?? ''}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/commands/cms/import/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GAEpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE/E,MAAM,CAAC,OAAO,OAAO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C,GAAG,CAAC,4BAA4B,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,GAAG,CAAC,wBAAwB,YAAY,eAAe,YAAY,mBAAmB,CAAC,CAAC;QAC7F,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACvC,MAAM,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;YAC3F,IAAI,CAAC,GAAG,CACN,KAAK,KAAK,CAAC,UAAU,aAAa,KAAK,CAAC,OAAO,CAAC,QAAQ,qBAAqB,cAAc,EAAE,CAC9F,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,IAAI,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QAC5F,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type InfoResult = {
|
|
3
|
+
name: string;
|
|
4
|
+
status: 'scaffold';
|
|
5
|
+
};
|
|
6
|
+
/** Reports that the CMS plugin scaffold is installed. */
|
|
7
|
+
export default class Info extends SfCommand<InfoResult> {
|
|
8
|
+
static readonly summary = "Show CMS plugin scaffold information.";
|
|
9
|
+
static readonly description = "Confirms that the sf-plugin-cms command entrypoint can be loaded without making org calls.";
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
run(): Promise<InfoResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
/** Reports that the CMS plugin scaffold is installed. */
|
|
3
|
+
export default class Info extends SfCommand {
|
|
4
|
+
static summary = 'Show CMS plugin scaffold information.';
|
|
5
|
+
static description = 'Confirms that the sf-plugin-cms command entrypoint can be loaded without making org calls.';
|
|
6
|
+
static examples = ['<%= config.bin %> cms info'];
|
|
7
|
+
async run() {
|
|
8
|
+
const result = { name: 'sf-plugin-cms', status: 'scaffold' };
|
|
9
|
+
this.logJson(result);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../src/commands/cms/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOxD,yDAAyD;AACzD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAqB;IAC9C,MAAM,CAAU,OAAO,GAAG,uCAAuC,CAAC;IAClE,MAAM,CAAU,WAAW,GAChC,4FAA4F,CAAC;IACxF,MAAM,CAAU,QAAQ,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAE1D,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAe,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACzE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CmsPage } from '../../../services/read.js';
|
|
2
|
+
import { CmsCommand } from '../command-base.js';
|
|
3
|
+
export default class ListChannel extends CmsCommand<CmsPage> {
|
|
4
|
+
static readonly summary = "List channels assigned to a CMS workspace.";
|
|
5
|
+
static readonly description = "Retrieves one page of channels for an explicit workspace.";
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'workspace-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
page: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'page-size': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<CmsPage>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Flags } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { listWorkspaceChannels } from '../../../services/read.js';
|
|
3
|
+
import { apiVersionFlag, CmsCommand, pageFlag, pageSizeFlag, targetOrgFlag, } from '../command-base.js';
|
|
4
|
+
export default class ListChannel extends CmsCommand {
|
|
5
|
+
static summary = 'List channels assigned to a CMS workspace.';
|
|
6
|
+
static description = 'Retrieves one page of channels for an explicit workspace.';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> cms list channel --target-org my-org --workspace-id 0Zu...',
|
|
9
|
+
];
|
|
10
|
+
static flags = {
|
|
11
|
+
'target-org': targetOrgFlag,
|
|
12
|
+
'api-version': apiVersionFlag,
|
|
13
|
+
'workspace-id': Flags.string({ required: true, summary: 'CMS workspace content-space ID.' }),
|
|
14
|
+
page: pageFlag,
|
|
15
|
+
'page-size': pageSizeFlag,
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { flags } = await this.parse(ListChannel);
|
|
19
|
+
const connection = await this.getConnection(flags['target-org'], flags['api-version']);
|
|
20
|
+
const result = await listWorkspaceChannels(connection, flags['workspace-id'], {
|
|
21
|
+
page: flags.page,
|
|
22
|
+
pageSize: flags['page-size'],
|
|
23
|
+
});
|
|
24
|
+
this.showPage('CMS channels', result);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../../src/commands/cms/list/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAgB,MAAM,2BAA2B,CAAC;AAChF,OAAO,EACL,cAAc,EACd,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAmB;IACnD,MAAM,CAAU,OAAO,GAAG,4CAA4C,CAAC;IACvE,MAAM,CAAU,WAAW,GAAG,2DAA2D,CAAC;IAC1F,MAAM,CAAU,QAAQ,GAAG;QAChC,8EAA8E;KAC/E,CAAC;IACK,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,aAAa;QAC3B,aAAa,EAAE,cAAc;QAC7B,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;QAC5F,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,YAAY;KAC1B,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACvF,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,EAAE;YAC5E,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC;SAC7B,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CmsPage } from '../../../services/read.js';
|
|
2
|
+
import { CmsCommand } from '../command-base.js';
|
|
3
|
+
export default class ListWorkspace extends CmsCommand<CmsPage> {
|
|
4
|
+
static readonly summary = "List Marketing Cloud CMS workspaces.";
|
|
5
|
+
static readonly description = "Lists one bounded page of CMS workspaces through the authenticated Salesforce connection.";
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'name-fragment': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
page: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'page-size': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<CmsPage>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flags } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { listWorkspaces } from '../../../services/read.js';
|
|
3
|
+
import { apiVersionFlag, CmsCommand, pageFlag, pageSizeFlag, targetOrgFlag, } from '../command-base.js';
|
|
4
|
+
export default class ListWorkspace extends CmsCommand {
|
|
5
|
+
static summary = 'List Marketing Cloud CMS workspaces.';
|
|
6
|
+
static description = 'Lists one bounded page of CMS workspaces through the authenticated Salesforce connection.';
|
|
7
|
+
static examples = ['<%= config.bin %> cms list workspace --target-org my-org'];
|
|
8
|
+
static flags = {
|
|
9
|
+
'target-org': targetOrgFlag,
|
|
10
|
+
'api-version': apiVersionFlag,
|
|
11
|
+
'name-fragment': Flags.string({ summary: 'Return workspaces whose names contain this value.' }),
|
|
12
|
+
page: pageFlag,
|
|
13
|
+
'page-size': pageSizeFlag,
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(ListWorkspace);
|
|
17
|
+
const connection = await this.getConnection(flags['target-org'], flags['api-version']);
|
|
18
|
+
const result = await listWorkspaces(connection, {
|
|
19
|
+
nameFragment: flags['name-fragment'],
|
|
20
|
+
page: flags.page,
|
|
21
|
+
pageSize: flags['page-size'],
|
|
22
|
+
});
|
|
23
|
+
this.showPage('CMS workspaces', result);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/commands/cms/list/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAgB,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,cAAc,EACd,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAmB;IACrD,MAAM,CAAU,OAAO,GAAG,sCAAsC,CAAC;IACjE,MAAM,CAAU,WAAW,GAChC,2FAA2F,CAAC;IACvF,MAAM,CAAU,QAAQ,GAAG,CAAC,0DAA0D,CAAC,CAAC;IACxF,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,aAAa;QAC3B,aAAa,EAAE,cAAc;QAC7B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,mDAAmD,EAAE,CAAC;QAC/F,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,YAAY;KAC1B,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACvF,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,UAAU,EAAE;YAC9C,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC;SAC7B,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
export declare const SELECTED_OPERATIONS: readonly [{
|
|
2
|
+
readonly localKey: "channel.get";
|
|
3
|
+
readonly method: "GET";
|
|
4
|
+
readonly operationId: "getManagedContentChannel";
|
|
5
|
+
readonly parameters: readonly [{
|
|
6
|
+
readonly location: "path";
|
|
7
|
+
readonly name: "channelId";
|
|
8
|
+
readonly required: true;
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
}];
|
|
11
|
+
readonly path: "/connect/cms/channels/{channelId}";
|
|
12
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
13
|
+
readonly requestBodyPresent: false;
|
|
14
|
+
readonly responses: readonly [{
|
|
15
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
16
|
+
readonly status: "200";
|
|
17
|
+
}];
|
|
18
|
+
}, {
|
|
19
|
+
readonly localKey: "content.create";
|
|
20
|
+
readonly method: "POST";
|
|
21
|
+
readonly operationId: "postManagedContentDocumentCreate";
|
|
22
|
+
readonly parameters: readonly [];
|
|
23
|
+
readonly path: "/connect/cms/contents";
|
|
24
|
+
readonly requestBodyMediaTypes: readonly ["application/json", "multipart/form-data"];
|
|
25
|
+
readonly requestBodyPresent: true;
|
|
26
|
+
readonly responses: readonly [{
|
|
27
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
28
|
+
readonly status: "200";
|
|
29
|
+
}];
|
|
30
|
+
}, {
|
|
31
|
+
readonly localKey: "content.get";
|
|
32
|
+
readonly method: "GET";
|
|
33
|
+
readonly operationId: "getManagedContentDocument";
|
|
34
|
+
readonly parameters: readonly [{
|
|
35
|
+
readonly location: "path";
|
|
36
|
+
readonly name: "contentKeyOrId";
|
|
37
|
+
readonly required: true;
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
}, {
|
|
40
|
+
readonly location: "query";
|
|
41
|
+
readonly name: "contentVersion";
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
}, {
|
|
45
|
+
readonly location: "query";
|
|
46
|
+
readonly name: "language";
|
|
47
|
+
readonly required: false;
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
}, {
|
|
50
|
+
readonly location: "query";
|
|
51
|
+
readonly name: "variantVersion";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
}, {
|
|
55
|
+
readonly location: "query";
|
|
56
|
+
readonly name: "version";
|
|
57
|
+
readonly required: false;
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
}];
|
|
60
|
+
readonly path: "/connect/cms/contents/{contentKeyOrId}";
|
|
61
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
62
|
+
readonly requestBodyPresent: false;
|
|
63
|
+
readonly responses: readonly [{
|
|
64
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
65
|
+
readonly status: "200";
|
|
66
|
+
}];
|
|
67
|
+
}, {
|
|
68
|
+
readonly localKey: "variant.create";
|
|
69
|
+
readonly method: "POST";
|
|
70
|
+
readonly operationId: "postManagedContentVariantCreate";
|
|
71
|
+
readonly parameters: readonly [];
|
|
72
|
+
readonly path: "/connect/cms/contents/variants";
|
|
73
|
+
readonly requestBodyMediaTypes: readonly ["application/json"];
|
|
74
|
+
readonly requestBodyPresent: true;
|
|
75
|
+
readonly responses: readonly [{
|
|
76
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
77
|
+
readonly status: "200";
|
|
78
|
+
}];
|
|
79
|
+
}, {
|
|
80
|
+
readonly localKey: "variant.delete";
|
|
81
|
+
readonly method: "DELETE";
|
|
82
|
+
readonly operationId: "deleteManagedContentVariant";
|
|
83
|
+
readonly parameters: readonly [{
|
|
84
|
+
readonly location: "path";
|
|
85
|
+
readonly name: "variantId";
|
|
86
|
+
readonly required: true;
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
}];
|
|
89
|
+
readonly path: "/connect/cms/contents/variants/{variantId}";
|
|
90
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
91
|
+
readonly requestBodyPresent: false;
|
|
92
|
+
readonly responses: readonly [{
|
|
93
|
+
readonly mediaTypes: readonly [];
|
|
94
|
+
readonly status: "200";
|
|
95
|
+
}];
|
|
96
|
+
}, {
|
|
97
|
+
readonly localKey: "variant.get";
|
|
98
|
+
readonly method: "GET";
|
|
99
|
+
readonly operationId: "getManagedContentVariant";
|
|
100
|
+
readonly parameters: readonly [{
|
|
101
|
+
readonly location: "path";
|
|
102
|
+
readonly name: "variantId";
|
|
103
|
+
readonly required: true;
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
}];
|
|
106
|
+
readonly path: "/connect/cms/contents/variants/{variantId}";
|
|
107
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
108
|
+
readonly requestBodyPresent: false;
|
|
109
|
+
readonly responses: readonly [{
|
|
110
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
111
|
+
readonly status: "200";
|
|
112
|
+
}];
|
|
113
|
+
}, {
|
|
114
|
+
readonly localKey: "workspace.channel.list";
|
|
115
|
+
readonly method: "GET";
|
|
116
|
+
readonly operationId: "getManagedContentSpaceChannels";
|
|
117
|
+
readonly parameters: readonly [{
|
|
118
|
+
readonly location: "path";
|
|
119
|
+
readonly name: "contentSpaceId";
|
|
120
|
+
readonly required: true;
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
}, {
|
|
123
|
+
readonly location: "query";
|
|
124
|
+
readonly name: "page";
|
|
125
|
+
readonly required: false;
|
|
126
|
+
readonly type: "integer";
|
|
127
|
+
}, {
|
|
128
|
+
readonly location: "query";
|
|
129
|
+
readonly name: "pageSize";
|
|
130
|
+
readonly required: false;
|
|
131
|
+
readonly type: "integer";
|
|
132
|
+
}];
|
|
133
|
+
readonly path: "/connect/cms/spaces/{contentSpaceId}/channels";
|
|
134
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
135
|
+
readonly requestBodyPresent: false;
|
|
136
|
+
readonly responses: readonly [{
|
|
137
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
138
|
+
readonly status: "200";
|
|
139
|
+
}];
|
|
140
|
+
}, {
|
|
141
|
+
readonly localKey: "workspace.get";
|
|
142
|
+
readonly method: "GET";
|
|
143
|
+
readonly operationId: "getManagedContentSpace";
|
|
144
|
+
readonly parameters: readonly [{
|
|
145
|
+
readonly location: "path";
|
|
146
|
+
readonly name: "contentSpaceId";
|
|
147
|
+
readonly required: true;
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
}];
|
|
150
|
+
readonly path: "/connect/cms/spaces/{contentSpaceId}";
|
|
151
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
152
|
+
readonly requestBodyPresent: false;
|
|
153
|
+
readonly responses: readonly [{
|
|
154
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
155
|
+
readonly status: "200";
|
|
156
|
+
}];
|
|
157
|
+
}, {
|
|
158
|
+
readonly localKey: "workspace.list";
|
|
159
|
+
readonly method: "GET";
|
|
160
|
+
readonly operationId: "getManagedContentSpaceCollection";
|
|
161
|
+
readonly parameters: readonly [{
|
|
162
|
+
readonly location: "query";
|
|
163
|
+
readonly name: "nameFragment";
|
|
164
|
+
readonly required: false;
|
|
165
|
+
readonly type: "string";
|
|
166
|
+
}, {
|
|
167
|
+
readonly location: "query";
|
|
168
|
+
readonly name: "page";
|
|
169
|
+
readonly required: false;
|
|
170
|
+
readonly type: "integer";
|
|
171
|
+
}, {
|
|
172
|
+
readonly location: "query";
|
|
173
|
+
readonly name: "pageSize";
|
|
174
|
+
readonly required: false;
|
|
175
|
+
readonly type: "integer";
|
|
176
|
+
}];
|
|
177
|
+
readonly path: "/connect/cms/spaces";
|
|
178
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
179
|
+
readonly requestBodyPresent: false;
|
|
180
|
+
readonly responses: readonly [{
|
|
181
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
182
|
+
readonly status: "200";
|
|
183
|
+
}];
|
|
184
|
+
}, {
|
|
185
|
+
readonly localKey: "workspace.variant.search";
|
|
186
|
+
readonly method: "GET";
|
|
187
|
+
readonly operationId: "getManagedContentSearchItems";
|
|
188
|
+
readonly parameters: readonly [{
|
|
189
|
+
readonly location: "query";
|
|
190
|
+
readonly name: "contentSpaceOrFolderIds";
|
|
191
|
+
readonly required: true;
|
|
192
|
+
readonly type: "string-array";
|
|
193
|
+
}, {
|
|
194
|
+
readonly location: "query";
|
|
195
|
+
readonly name: "contentTypeFQN";
|
|
196
|
+
readonly required: false;
|
|
197
|
+
readonly type: "string";
|
|
198
|
+
}, {
|
|
199
|
+
readonly location: "query";
|
|
200
|
+
readonly name: "languages";
|
|
201
|
+
readonly required: false;
|
|
202
|
+
readonly type: "string-array";
|
|
203
|
+
}, {
|
|
204
|
+
readonly location: "query";
|
|
205
|
+
readonly name: "page";
|
|
206
|
+
readonly required: false;
|
|
207
|
+
readonly type: "integer";
|
|
208
|
+
}, {
|
|
209
|
+
readonly location: "query";
|
|
210
|
+
readonly name: "pageSize";
|
|
211
|
+
readonly required: false;
|
|
212
|
+
readonly type: "integer";
|
|
213
|
+
}, {
|
|
214
|
+
readonly location: "query";
|
|
215
|
+
readonly name: "queryTerm";
|
|
216
|
+
readonly required: true;
|
|
217
|
+
readonly type: "string";
|
|
218
|
+
}, {
|
|
219
|
+
readonly location: "query";
|
|
220
|
+
readonly name: "scope";
|
|
221
|
+
readonly required: false;
|
|
222
|
+
readonly type: "string";
|
|
223
|
+
}];
|
|
224
|
+
readonly path: "/connect/cms/items/search";
|
|
225
|
+
readonly requestBodyMediaTypes: readonly [];
|
|
226
|
+
readonly requestBodyPresent: false;
|
|
227
|
+
readonly responses: readonly [{
|
|
228
|
+
readonly mediaTypes: readonly ["application/json"];
|
|
229
|
+
readonly status: "200";
|
|
230
|
+
}];
|
|
231
|
+
}];
|
|
232
|
+
export type SelectedOperation = (typeof SELECTED_OPERATIONS)[number];
|
|
233
|
+
export type SelectedOperationId = SelectedOperation['operationId'];
|