Skip to content

Commit 4e9519f

Browse files
committed
Adds 'spe containertype remove' command. Closes pnp#5992
1 parent add4854 commit 4e9519f

14 files changed

+554
-11
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const dictionary = [
2525
'comm',
2626
'command',
2727
'community',
28-
'containertype',
28+
'container',
2929
'content',
3030
'conversation',
3131
'custom',

docs/docs/cmd/spe/containertype/containertype-add.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,16 @@ m365 spe containertype add [options]
3838

3939
## Remarks
4040

41+
:::info
42+
43+
To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
44+
45+
:::
46+
4147
:::note
42-
You can only create one Trial Container per tenant, a single application registration can only contain one Container and a tenant can contain a maximum of five Containers in total.
48+
49+
You can only create one Trial container type per tenant, a single application registration can only contain one container type and a tenant can contain a maximum of five containers types in total.
50+
4351
:::
4452

4553
## Examples

docs/docs/cmd/spe/containertype/containertype-get.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ m365 containertype get [options]
2424

2525
<Global />
2626

27+
## Remarks
28+
29+
:::info
30+
31+
To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
32+
33+
:::
34+
2735
## Examples
2836

2937
Gets Container Type by id

docs/docs/cmd/spe/containertype/containertype-list.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ m365 spe containertype list [options]
1616

1717
<Global />
1818

19+
## Remarks
20+
21+
:::info
22+
23+
To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
24+
25+
:::
26+
1927
## Examples
2028

2129
Retrieves a list of Container Types created for a SharePoint Embedded Application from the tenant.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import Global from '/docs/cmd/_global.mdx';
2+
3+
# spe containertype remove
4+
5+
Remove a specific container type
6+
7+
## Usage
8+
9+
```sh
10+
m365 spe containertype remove [options]
11+
```
12+
13+
## Options
14+
15+
```md definition-list
16+
`-i, --id [id]`
17+
: The ID of the container type. Specify either `id` or `name` but not both.
18+
19+
`-n, --name [name]`
20+
: The container type name. Specify either `id` or `name` but not both.
21+
22+
`-f, --force`
23+
: Force removal of the container type without confirmation.
24+
```
25+
26+
<Global />
27+
28+
## Remarks
29+
30+
:::info
31+
32+
To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
33+
34+
:::
35+
36+
:::note
37+
38+
In SharePoint Embedded, only `trial` container types can be deleted.
39+
40+
:::
41+
42+
## Examples
43+
44+
Removes a container type by ID
45+
46+
```sh
47+
m365 spe containertype remove --id 4ec4aefd-4fa3-0e4a-20c3-6e68389e7138
48+
```
49+
50+
Removes a container type by name
51+
52+
```sh
53+
m365 spe containertype remove --name 'My container type'
54+
```
55+
56+
## Response
57+
58+
The command won't return a response on success.

docs/src/config/sidebars.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,6 +2136,11 @@ const sidebars: SidebarsConfig = {
21362136
type: 'doc',
21372137
label: 'containertype list',
21382138
id: 'cmd/spe/containertype/containertype-list'
2139+
},
2140+
{
2141+
type: 'doc',
2142+
label: 'containertype remove',
2143+
id: 'cmd/spe/containertype/containertype-remove'
21392144
}
21402145
]
21412146
}

src/m365/spe/commands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export default {
66
CONTAINER_LIST: `${prefix} container list`,
77
CONTAINERTYPE_ADD: `${prefix} containertype add`,
88
CONTAINERTYPE_GET: `${prefix} containertype get`,
9-
CONTAINERTYPE_LIST: `${prefix} containertype list`
9+
CONTAINERTYPE_LIST: `${prefix} containertype list`,
10+
CONTAINERTYPE_REMOVE: `${prefix} containertype remove`
1011
};

src/m365/spe/commands/containertype/containertype-add.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface Options extends GlobalOptions {
3535
region?: string;
3636
}
3737

38-
class SpeContainertypeAddCommand extends SpoCommand {
38+
class SpeContainerTypeAddCommand extends SpoCommand {
3939
public get name(): string {
4040
return commands.CONTAINERTYPE_ADD;
4141
}
@@ -151,7 +151,7 @@ class SpeContainertypeAddCommand extends SpoCommand {
151151
await logger.log(result);
152152
}
153153
catch (err: any) {
154-
this.handleRejectedPromise(err);
154+
this.handleRejectedODataJsonPromise(err);
155155
}
156156
}
157157

@@ -167,4 +167,4 @@ class SpeContainertypeAddCommand extends SpoCommand {
167167
}
168168
}
169169

170-
export default new SpeContainertypeAddCommand();
170+
export default new SpeContainerTypeAddCommand();

src/m365/spe/commands/containertype/containertype-get.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface Options extends GlobalOptions {
1616
name?: string;
1717
}
1818

19-
class SpeContainertypeGetCommand extends SpoCommand {
19+
class SpeContainerTypeGetCommand extends SpoCommand {
2020
public get name(): string {
2121
return commands.CONTAINERTYPE_GET;
2222
}
@@ -91,7 +91,7 @@ class SpeContainertypeGetCommand extends SpoCommand {
9191
await logger.log(allContainerTypes);
9292
}
9393
catch (err: any) {
94-
this.handleRejectedPromise(err);
94+
this.handleRejectedODataJsonPromise(err);
9595
}
9696
}
9797

@@ -136,4 +136,4 @@ class SpeContainertypeGetCommand extends SpoCommand {
136136
}
137137
}
138138

139-
export default new SpeContainertypeGetCommand();
139+
export default new SpeContainerTypeGetCommand();

src/m365/spe/commands/containertype/containertype-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SpoCommand from '../../../base/SpoCommand.js';
33
import commands from '../../commands.js';
44
import { ContainerTypeProperties, spo } from '../../../../utils/spo.js';
55

6-
class SpeContainertypeListCommand extends SpoCommand {
6+
class SpeContainerTypeListCommand extends SpoCommand {
77

88
public get name(): string {
99
return commands.CONTAINERTYPE_LIST;
@@ -34,4 +34,4 @@ class SpeContainertypeListCommand extends SpoCommand {
3434
}
3535
}
3636

37-
export default new SpeContainertypeListCommand();
37+
export default new SpeContainerTypeListCommand();

0 commit comments

Comments
 (0)