@commercelayer/cli-plugin-provisioning 1.0.1 → 2.0.0-oclif3.2
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/README.md +7 -6
- package/lib/base.d.ts +5 -5
- package/lib/base.js +92 -91
- package/lib/commands/provisioning/create.d.ts +7 -7
- package/lib/commands/provisioning/create.js +37 -37
- package/lib/commands/provisioning/delete.d.ts +4 -4
- package/lib/commands/provisioning/delete.js +13 -13
- package/lib/commands/provisioning/exec.d.ts +4 -4
- package/lib/commands/provisioning/exec.js +18 -18
- package/lib/commands/provisioning/fetch.d.ts +10 -9
- package/lib/commands/provisioning/fetch.js +19 -18
- package/lib/commands/provisioning/get.d.ts +9 -9
- package/lib/commands/provisioning/get.js +15 -15
- package/lib/commands/provisioning/list.d.ts +10 -7
- package/lib/commands/provisioning/list.js +57 -54
- package/lib/commands/provisioning/noc.js +2 -2
- package/lib/commands/provisioning/relationship.d.ts +10 -10
- package/lib/commands/provisioning/relationship.js +16 -16
- package/lib/commands/provisioning/resources.js +9 -9
- package/lib/commands/provisioning/retrieve.d.ts +5 -5
- package/lib/commands/provisioning/retrieve.js +35 -35
- package/lib/commands/provisioning/update.d.ts +10 -10
- package/lib/commands/provisioning/update.js +49 -49
- package/oclif.manifest.json +17 -1
- package/package.json +12 -12
|
@@ -5,6 +5,21 @@ const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
|
5
5
|
const retrieve_1 = tslib_1.__importDefault(require("./retrieve"));
|
|
6
6
|
const list_1 = tslib_1.__importDefault(require("./list"));
|
|
7
7
|
class ProvisioningGet extends base_1.default {
|
|
8
|
+
static description = 'retrieve a resource or list a set of resources';
|
|
9
|
+
static aliases = ['prov:get', 'pg', 'pget'];
|
|
10
|
+
static examples = [
|
|
11
|
+
'$ commercelayer provisioning:get roles',
|
|
12
|
+
'$ commercelayer prov:get roles',
|
|
13
|
+
'$ clayer prov:get roles/<roleId>',
|
|
14
|
+
'$ cl prov:get roles <roleId>',
|
|
15
|
+
];
|
|
16
|
+
static strict = false;
|
|
17
|
+
static flags = {
|
|
18
|
+
...list_1.default.flags,
|
|
19
|
+
};
|
|
20
|
+
static args = {
|
|
21
|
+
...retrieve_1.default.args,
|
|
22
|
+
};
|
|
8
23
|
async run() {
|
|
9
24
|
const { args } = await this.parse(ProvisioningGet);
|
|
10
25
|
const { id, singleton } = this.checkResourceId(args.resource, args.id, false);
|
|
@@ -13,19 +28,4 @@ class ProvisioningGet extends base_1.default {
|
|
|
13
28
|
return result;
|
|
14
29
|
}
|
|
15
30
|
}
|
|
16
|
-
ProvisioningGet.description = 'retrieve a resource or list a set of resources';
|
|
17
|
-
ProvisioningGet.aliases = ['prov:get', 'pg', 'pget'];
|
|
18
|
-
ProvisioningGet.examples = [
|
|
19
|
-
'$ commercelayer provisioning:get roles',
|
|
20
|
-
'$ commercelayer prov:get roles',
|
|
21
|
-
'$ clayer prov:get roles/<roleId>',
|
|
22
|
-
'$ cl prov:get roles <roleId>',
|
|
23
|
-
];
|
|
24
|
-
ProvisioningGet.strict = false;
|
|
25
|
-
ProvisioningGet.flags = {
|
|
26
|
-
...list_1.default.flags,
|
|
27
|
-
};
|
|
28
|
-
ProvisioningGet.args = {
|
|
29
|
-
...retrieve_1.default.args,
|
|
30
|
-
};
|
|
31
31
|
exports.default = ProvisioningGet;
|
|
@@ -4,19 +4,22 @@ export default class ProvisioningList extends Command {
|
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
-
where: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
8
|
-
page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces
|
|
9
|
-
pageSize: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces
|
|
10
|
-
sort: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
11
|
-
extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
7
|
+
where: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
pageSize: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
sort: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
'force-include': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
14
|
-
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
13
|
+
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
15
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
headers: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
19
|
'headers-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
20
|
};
|
|
21
|
+
static args: {
|
|
22
|
+
resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
23
|
+
};
|
|
21
24
|
run(): Promise<any>;
|
|
22
25
|
}
|
|
@@ -7,6 +7,63 @@ const base_1 = tslib_1.__importStar(require("../../base"));
|
|
|
7
7
|
const cli_core_1 = require("@commercelayer/cli-core");
|
|
8
8
|
const OPERATION = 'list';
|
|
9
9
|
class ProvisioningList extends base_1.default {
|
|
10
|
+
static description = 'fetch a collection of resources';
|
|
11
|
+
static aliases = ['pl', 'prov:list', 'plist', 'pls'];
|
|
12
|
+
static examples = [
|
|
13
|
+
'$ commercelayer provisioning:list roles -f id,name -i organization -s updated_at',
|
|
14
|
+
'$ cl prov:list roles -i organization -f name -f organizations/name -w organization_name_eq="ORG NAME"',
|
|
15
|
+
'$ cl prov:list roles -p 5 -n 10 -s -created_at --raw',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
...base_1.default.flags,
|
|
19
|
+
where: base_1.Flags.string({
|
|
20
|
+
char: 'w',
|
|
21
|
+
multiple: true,
|
|
22
|
+
description: 'comma separated list of query filters',
|
|
23
|
+
}),
|
|
24
|
+
page: base_1.Flags.integer({
|
|
25
|
+
char: 'p',
|
|
26
|
+
description: 'page number',
|
|
27
|
+
}),
|
|
28
|
+
pageSize: base_1.Flags.integer({
|
|
29
|
+
char: 'n',
|
|
30
|
+
description: 'number of elements per page',
|
|
31
|
+
}),
|
|
32
|
+
sort: base_1.Flags.string({
|
|
33
|
+
char: 's',
|
|
34
|
+
description: 'defines results ordering',
|
|
35
|
+
multiple: true,
|
|
36
|
+
}),
|
|
37
|
+
/*
|
|
38
|
+
save: Flags.string({
|
|
39
|
+
char: 'x',
|
|
40
|
+
description: 'save command output to file',
|
|
41
|
+
multiple: false,
|
|
42
|
+
exclusive: ['save-path'],
|
|
43
|
+
}),
|
|
44
|
+
'save-path': Flags.string({
|
|
45
|
+
char: 'X',
|
|
46
|
+
description: 'save command output to file and create missing path directories',
|
|
47
|
+
multiple: false,
|
|
48
|
+
exclusive: ['save'],
|
|
49
|
+
}),
|
|
50
|
+
*/
|
|
51
|
+
extract: base_1.Flags.string({
|
|
52
|
+
char: 'e',
|
|
53
|
+
description: 'extract subfields from object attributes',
|
|
54
|
+
multiple: true,
|
|
55
|
+
exclusive: ['raw'],
|
|
56
|
+
}),
|
|
57
|
+
'force-include': base_1.Flags.boolean({
|
|
58
|
+
char: 'I',
|
|
59
|
+
description: 'force resources inclusion beyound the 3rd level',
|
|
60
|
+
dependsOn: ['include'],
|
|
61
|
+
hidden: true,
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
static args = {
|
|
65
|
+
...base_1.default.args
|
|
66
|
+
};
|
|
10
67
|
async run() {
|
|
11
68
|
const { args, flags } = await this.parse(ProvisioningList);
|
|
12
69
|
const resource = this.checkResource(args.resource);
|
|
@@ -80,58 +137,4 @@ class ProvisioningList extends base_1.default {
|
|
|
80
137
|
}
|
|
81
138
|
}
|
|
82
139
|
}
|
|
83
|
-
ProvisioningList.description = 'fetch a collection of resources';
|
|
84
|
-
ProvisioningList.aliases = ['pl', 'prov:list', 'plist', 'pls'];
|
|
85
|
-
ProvisioningList.examples = [
|
|
86
|
-
'$ commercelayer provisioning:list roles -f id,name -i organization -s updated_at',
|
|
87
|
-
'$ cl prov:list roles -i organization -f name -f organizations/name -w organization_name_eq="ORG NAME"',
|
|
88
|
-
'$ cl prov:list roles -p 5 -n 10 -s -created_at --raw',
|
|
89
|
-
];
|
|
90
|
-
ProvisioningList.flags = {
|
|
91
|
-
...base_1.default.flags,
|
|
92
|
-
where: base_1.Flags.string({
|
|
93
|
-
char: 'w',
|
|
94
|
-
multiple: true,
|
|
95
|
-
description: 'comma separated list of query filters',
|
|
96
|
-
}),
|
|
97
|
-
page: base_1.Flags.integer({
|
|
98
|
-
char: 'p',
|
|
99
|
-
description: 'page number',
|
|
100
|
-
}),
|
|
101
|
-
pageSize: base_1.Flags.integer({
|
|
102
|
-
char: 'n',
|
|
103
|
-
description: 'number of elements per page',
|
|
104
|
-
}),
|
|
105
|
-
sort: base_1.Flags.string({
|
|
106
|
-
char: 's',
|
|
107
|
-
description: 'defines results ordering',
|
|
108
|
-
multiple: true,
|
|
109
|
-
}),
|
|
110
|
-
/*
|
|
111
|
-
save: Flags.string({
|
|
112
|
-
char: 'x',
|
|
113
|
-
description: 'save command output to file',
|
|
114
|
-
multiple: false,
|
|
115
|
-
exclusive: ['save-path'],
|
|
116
|
-
}),
|
|
117
|
-
'save-path': Flags.string({
|
|
118
|
-
char: 'X',
|
|
119
|
-
description: 'save command output to file and create missing path directories',
|
|
120
|
-
multiple: false,
|
|
121
|
-
exclusive: ['save'],
|
|
122
|
-
}),
|
|
123
|
-
*/
|
|
124
|
-
extract: base_1.Flags.string({
|
|
125
|
-
char: 'e',
|
|
126
|
-
description: 'extract subfields from object attributes',
|
|
127
|
-
multiple: true,
|
|
128
|
-
exclusive: ['raw'],
|
|
129
|
-
}),
|
|
130
|
-
'force-include': base_1.Flags.boolean({
|
|
131
|
-
char: 'I',
|
|
132
|
-
description: 'force resources inclusion beyound the 3rd level',
|
|
133
|
-
dependsOn: ['include'],
|
|
134
|
-
hidden: true,
|
|
135
|
-
}),
|
|
136
|
-
};
|
|
137
140
|
exports.default = ProvisioningList;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
class Noc extends core_1.Command {
|
|
5
|
+
static hidden = true;
|
|
6
|
+
static flags = {};
|
|
5
7
|
async run() {
|
|
6
8
|
const output = '-= NoC =-';
|
|
7
9
|
this.log(output);
|
|
8
10
|
return output;
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
Noc.hidden = true;
|
|
12
|
-
Noc.flags = {};
|
|
13
13
|
exports.default = Noc;
|
|
@@ -5,14 +5,14 @@ export default class ResourcesRelationship extends Command {
|
|
|
5
5
|
static hidden: boolean;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
where: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
9
|
-
page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces
|
|
10
|
-
pageSize: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces
|
|
11
|
-
sort: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
12
|
-
extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
8
|
+
where: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
pageSize: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
sort: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
13
|
'force-include': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
15
|
-
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
14
|
+
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
16
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -20,9 +20,9 @@ export default class ResourcesRelationship extends Command {
|
|
|
20
20
|
'headers-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
21
|
};
|
|
22
22
|
static args: {
|
|
23
|
-
id: import("@oclif/core/lib/interfaces
|
|
24
|
-
relationship: import("@oclif/core/lib/interfaces
|
|
25
|
-
resource: import("@oclif/core/lib/interfaces
|
|
23
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
24
|
+
relationship: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
25
|
+
resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
26
26
|
};
|
|
27
27
|
run(): Promise<any>;
|
|
28
28
|
private checkRelationship;
|
|
@@ -8,6 +8,22 @@ const list_1 = tslib_1.__importDefault(require("./list"));
|
|
|
8
8
|
const cli_core_1 = require("@commercelayer/cli-core");
|
|
9
9
|
// const OPERATION = 'relationship'
|
|
10
10
|
class ResourcesRelationship extends base_1.default {
|
|
11
|
+
static description = 'fetch a resource relationship';
|
|
12
|
+
static aliases = ['provisioning:rel', 'prov:rel', 'prov:relationship'];
|
|
13
|
+
static hidden = true;
|
|
14
|
+
static examples = [
|
|
15
|
+
'$ commercelayer provisioning:relationship roles <roleId> organization',
|
|
16
|
+
'$ clayer prov:relationship roles <roleId> permissions',
|
|
17
|
+
'$ cl prov:rel roles <roleId> permisions -w subject_eq=testsub'
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
...list_1.default.flags,
|
|
21
|
+
};
|
|
22
|
+
static args = {
|
|
23
|
+
...list_1.default.args,
|
|
24
|
+
id: base_1.Args.string({ name: 'id', description: 'id of the resource to retrieve', required: true }),
|
|
25
|
+
relationship: base_1.Args.string({ name: 'relationship', description: 'name of the relationship field', required: true }),
|
|
26
|
+
};
|
|
11
27
|
async run() {
|
|
12
28
|
const { args, flags } = await this.parse(ResourcesRelationship);
|
|
13
29
|
const { res: resName, id } = this.checkResourceId(args.resource, args.id);
|
|
@@ -95,20 +111,4 @@ class ResourcesRelationship extends base_1.default {
|
|
|
95
111
|
return (name === cli_core_1.clText.pluralize(name));
|
|
96
112
|
}
|
|
97
113
|
}
|
|
98
|
-
ResourcesRelationship.description = 'fetch a resource relationship';
|
|
99
|
-
ResourcesRelationship.aliases = ['provisioning:rel', 'prov:rel', 'prov:relationship'];
|
|
100
|
-
ResourcesRelationship.hidden = true;
|
|
101
|
-
ResourcesRelationship.examples = [
|
|
102
|
-
'$ commercelayer provisioning:relationship roles <roleId> organization',
|
|
103
|
-
'$ clayer prov:relationship roles <roleId> permissions',
|
|
104
|
-
'$ cl prov:rel roles <roleId> permisions -w subject_eq=testsub'
|
|
105
|
-
];
|
|
106
|
-
ResourcesRelationship.flags = {
|
|
107
|
-
...list_1.default.flags,
|
|
108
|
-
};
|
|
109
|
-
ResourcesRelationship.args = {
|
|
110
|
-
...base_1.default.args,
|
|
111
|
-
id: base_1.Args.string({ name: 'id', description: 'id of the resource to retrieve', required: true }),
|
|
112
|
-
relationship: base_1.Args.string({ name: 'relationship', description: 'name of the relationship field', required: true }),
|
|
113
|
-
};
|
|
114
114
|
exports.default = ResourcesRelationship;
|
|
@@ -4,6 +4,15 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const resources_1 = require("../../util/resources");
|
|
5
5
|
const cli_core_1 = require("@commercelayer/cli-core");
|
|
6
6
|
class ProvisioningResources extends core_1.Command {
|
|
7
|
+
static description = 'list all the available Provisioning API resources';
|
|
8
|
+
static aliases = ['prov:resources', 'pres'];
|
|
9
|
+
static examples = [
|
|
10
|
+
'$ commercelayer provisioning:resources',
|
|
11
|
+
'$ cl prov:resources',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
15
|
+
};
|
|
7
16
|
async run() {
|
|
8
17
|
await this.parse(ProvisioningResources);
|
|
9
18
|
this.log(cli_core_1.clColor.style.title('\n-= Provisioning API available resources =-\n'));
|
|
@@ -24,13 +33,4 @@ class ProvisioningResources extends core_1.Command {
|
|
|
24
33
|
return await super.catch(error);
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
|
-
ProvisioningResources.description = 'list all the available Provisioning API resources';
|
|
28
|
-
ProvisioningResources.aliases = ['prov:resources', 'pres'];
|
|
29
|
-
ProvisioningResources.examples = [
|
|
30
|
-
'$ commercelayer provisioning:resources',
|
|
31
|
-
'$ cl prov:resources',
|
|
32
|
-
];
|
|
33
|
-
ProvisioningResources.flags = {
|
|
34
|
-
help: core_1.Flags.help({ char: 'h' }),
|
|
35
|
-
};
|
|
36
36
|
exports.default = ProvisioningResources;
|
|
@@ -4,9 +4,9 @@ export default class ProvisioningRetrieve extends Command {
|
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
-
extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
8
|
-
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
9
|
-
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
7
|
+
extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -14,8 +14,8 @@ export default class ProvisioningRetrieve extends Command {
|
|
|
14
14
|
'headers-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
15
|
};
|
|
16
16
|
static args: {
|
|
17
|
-
id: import("@oclif/core/lib/interfaces
|
|
18
|
-
resource: import("@oclif/core/lib/interfaces
|
|
17
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
18
|
+
resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
19
19
|
};
|
|
20
20
|
run(): Promise<any>;
|
|
21
21
|
}
|
|
@@ -6,6 +6,41 @@ const base_1 = tslib_1.__importStar(require("../../base"));
|
|
|
6
6
|
// import { mergeCommandParams } from '../../commands'
|
|
7
7
|
const OPERATION = 'retrieve';
|
|
8
8
|
class ProvisioningRetrieve extends base_1.default {
|
|
9
|
+
static description = 'fetch a single resource';
|
|
10
|
+
static aliases = ['prov:retrieve', 'pr', 'pretrieve'];
|
|
11
|
+
static examples = [
|
|
12
|
+
'$ commercelayer provisioning:retrieve roles/<roleId>',
|
|
13
|
+
'$ commercelayer prov:retrieve roles <roleId>',
|
|
14
|
+
'$ cl prov:retrieve roles <roleId>',
|
|
15
|
+
'$ clayer pr roles/<roleId>',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
...base_1.default.flags,
|
|
19
|
+
/*
|
|
20
|
+
save: Flags.string({
|
|
21
|
+
char: 'x',
|
|
22
|
+
description: 'save command output to file',
|
|
23
|
+
multiple: false,
|
|
24
|
+
exclusive: ['save-path'],
|
|
25
|
+
}),
|
|
26
|
+
'save-path': Flags.string({
|
|
27
|
+
char: 'X',
|
|
28
|
+
description: 'save command output to file and create missing path directories',
|
|
29
|
+
multiple: false,
|
|
30
|
+
exclusive: ['save'],
|
|
31
|
+
}),
|
|
32
|
+
*/
|
|
33
|
+
extract: base_1.Flags.string({
|
|
34
|
+
char: 'e',
|
|
35
|
+
description: 'extract subfields from object attributes',
|
|
36
|
+
multiple: true,
|
|
37
|
+
exclusive: ['raw'],
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
static args = {
|
|
41
|
+
...base_1.default.args,
|
|
42
|
+
id: base_1.Args.string({ name: 'id', description: 'id of the resource to retrieve', required: false }),
|
|
43
|
+
};
|
|
9
44
|
async run() {
|
|
10
45
|
const { args, flags } = await this.parse(ProvisioningRetrieve);
|
|
11
46
|
const { res, id } = this.checkResourceId(args.resource, args.id);
|
|
@@ -57,39 +92,4 @@ class ProvisioningRetrieve extends base_1.default {
|
|
|
57
92
|
}
|
|
58
93
|
}
|
|
59
94
|
}
|
|
60
|
-
ProvisioningRetrieve.description = 'fetch a single resource';
|
|
61
|
-
ProvisioningRetrieve.aliases = ['prov:retrieve', 'pr', 'pretrieve'];
|
|
62
|
-
ProvisioningRetrieve.examples = [
|
|
63
|
-
'$ commercelayer provisioning:retrieve roles/<roleId>',
|
|
64
|
-
'$ commercelayer prov:retrieve roles <roleId>',
|
|
65
|
-
'$ cl prov:retrieve roles <roleId>',
|
|
66
|
-
'$ clayer pr roles/<roleId>',
|
|
67
|
-
];
|
|
68
|
-
ProvisioningRetrieve.flags = {
|
|
69
|
-
...base_1.default.flags,
|
|
70
|
-
/*
|
|
71
|
-
save: Flags.string({
|
|
72
|
-
char: 'x',
|
|
73
|
-
description: 'save command output to file',
|
|
74
|
-
multiple: false,
|
|
75
|
-
exclusive: ['save-path'],
|
|
76
|
-
}),
|
|
77
|
-
'save-path': Flags.string({
|
|
78
|
-
char: 'X',
|
|
79
|
-
description: 'save command output to file and create missing path directories',
|
|
80
|
-
multiple: false,
|
|
81
|
-
exclusive: ['save'],
|
|
82
|
-
}),
|
|
83
|
-
*/
|
|
84
|
-
extract: base_1.Flags.string({
|
|
85
|
-
char: 'e',
|
|
86
|
-
description: 'extract subfields from object attributes',
|
|
87
|
-
multiple: true,
|
|
88
|
-
exclusive: ['raw'],
|
|
89
|
-
}),
|
|
90
|
-
};
|
|
91
|
-
ProvisioningRetrieve.args = {
|
|
92
|
-
...base_1.default.args,
|
|
93
|
-
id: base_1.Args.string({ name: 'id', description: 'id of the resource to retrieve', required: false }),
|
|
94
|
-
};
|
|
95
95
|
exports.default = ProvisioningRetrieve;
|
|
@@ -4,14 +4,14 @@ export default class ProvisioningUpdate extends Command {
|
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
-
attribute: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
8
|
-
object: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
9
|
-
relationship: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
10
|
-
metadata: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
11
|
-
'metadata-replace': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
12
|
-
data: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces
|
|
13
|
-
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
14
|
-
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces
|
|
7
|
+
attribute: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
object: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
relationship: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
metadata: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'metadata-replace': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
data: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
15
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -19,8 +19,8 @@ export default class ProvisioningUpdate extends Command {
|
|
|
19
19
|
'headers-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
20
|
};
|
|
21
21
|
static args: {
|
|
22
|
-
id: import("@oclif/core/lib/interfaces
|
|
23
|
-
resource: import("@oclif/core/lib/interfaces
|
|
22
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
23
|
+
resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
24
24
|
};
|
|
25
25
|
run(): Promise<any>;
|
|
26
26
|
}
|
|
@@ -5,6 +5,55 @@ const base_1 = tslib_1.__importStar(require("../../base"));
|
|
|
5
5
|
const cli_core_1 = require("@commercelayer/cli-core");
|
|
6
6
|
const OPERATION = 'update';
|
|
7
7
|
class ProvisioningUpdate extends base_1.default {
|
|
8
|
+
static description = 'update an existing resource';
|
|
9
|
+
static aliases = ['prov:update', 'pu', 'pupdate', 'pupd'];
|
|
10
|
+
static examples = [
|
|
11
|
+
'$ commercelayer provisioning:update roles/<roleId> -a reference=referenceId',
|
|
12
|
+
'$ commercelayer prov:update roles <roleId> -a reference_origin="Ref Origin"',
|
|
13
|
+
'$ cl prov:update roles/<roleId> -m meta_key="meta value"',
|
|
14
|
+
'$ cl pu roles <roleId> -M meta_key="metadata overwrite',
|
|
15
|
+
'$ clayer prov:update roles <roleId> -D /path/to/data/file/data.json',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
...base_1.default.flags,
|
|
19
|
+
attribute: base_1.Flags.string({
|
|
20
|
+
char: 'a',
|
|
21
|
+
description: 'define a resource attribute',
|
|
22
|
+
multiple: true,
|
|
23
|
+
}),
|
|
24
|
+
object: base_1.Flags.string({
|
|
25
|
+
char: 'O',
|
|
26
|
+
description: 'define a resource object attribute',
|
|
27
|
+
multiple: true,
|
|
28
|
+
}),
|
|
29
|
+
relationship: base_1.Flags.string({
|
|
30
|
+
char: 'r',
|
|
31
|
+
description: 'define a relationship with another resource',
|
|
32
|
+
multiple: true,
|
|
33
|
+
}),
|
|
34
|
+
metadata: base_1.Flags.string({
|
|
35
|
+
char: 'm',
|
|
36
|
+
description: 'define a metadata attribute and merge it with the metadata already present in the remote resource',
|
|
37
|
+
multiple: true,
|
|
38
|
+
exclusive: ['metadata-replace'],
|
|
39
|
+
}),
|
|
40
|
+
'metadata-replace': base_1.Flags.string({
|
|
41
|
+
char: 'M',
|
|
42
|
+
description: 'define a metadata attribute and replace every item already present in the remote resource',
|
|
43
|
+
multiple: true,
|
|
44
|
+
exclusive: ['metadata'],
|
|
45
|
+
}),
|
|
46
|
+
data: base_1.Flags.string({
|
|
47
|
+
char: 'D',
|
|
48
|
+
description: 'the data file to use as request body',
|
|
49
|
+
multiple: false,
|
|
50
|
+
exclusive: ['attribute', 'relationship', 'metadata', 'metadata-replace', 'doc' /*, FLAG_LOAD_PARAMS, FLAG_SAVE_PARAMS */],
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
static args = {
|
|
54
|
+
...base_1.default.args,
|
|
55
|
+
id: base_1.Args.string({ name: 'id', description: 'id of the resource to update', required: false }),
|
|
56
|
+
};
|
|
8
57
|
async run() {
|
|
9
58
|
const { args, flags } = await this.parse(ProvisioningUpdate);
|
|
10
59
|
const { res, id } = this.checkResourceId(args.resource, args.id);
|
|
@@ -105,53 +154,4 @@ class ProvisioningUpdate extends base_1.default {
|
|
|
105
154
|
}
|
|
106
155
|
}
|
|
107
156
|
}
|
|
108
|
-
ProvisioningUpdate.description = 'update an existing resource';
|
|
109
|
-
ProvisioningUpdate.aliases = ['prov:update', 'pu', 'pupdate', 'pupd'];
|
|
110
|
-
ProvisioningUpdate.examples = [
|
|
111
|
-
'$ commercelayer provisioning:update roles/<roleId> -a reference=referenceId',
|
|
112
|
-
'$ commercelayer prov:update roles <roleId> -a reference_origin="Ref Origin"',
|
|
113
|
-
'$ cl prov:update roles/<roleId> -m meta_key="meta value"',
|
|
114
|
-
'$ cl pu roles <roleId> -M meta_key="metadata overwrite',
|
|
115
|
-
'$ clayer prov:update roles <roleId> -D /path/to/data/file/data.json',
|
|
116
|
-
];
|
|
117
|
-
ProvisioningUpdate.flags = {
|
|
118
|
-
...base_1.default.flags,
|
|
119
|
-
attribute: base_1.Flags.string({
|
|
120
|
-
char: 'a',
|
|
121
|
-
description: 'define a resource attribute',
|
|
122
|
-
multiple: true,
|
|
123
|
-
}),
|
|
124
|
-
object: base_1.Flags.string({
|
|
125
|
-
char: 'O',
|
|
126
|
-
description: 'define a resource object attribute',
|
|
127
|
-
multiple: true,
|
|
128
|
-
}),
|
|
129
|
-
relationship: base_1.Flags.string({
|
|
130
|
-
char: 'r',
|
|
131
|
-
description: 'define a relationship with another resource',
|
|
132
|
-
multiple: true,
|
|
133
|
-
}),
|
|
134
|
-
metadata: base_1.Flags.string({
|
|
135
|
-
char: 'm',
|
|
136
|
-
description: 'define a metadata attribute and merge it with the metadata already present in the remote resource',
|
|
137
|
-
multiple: true,
|
|
138
|
-
exclusive: ['metadata-replace'],
|
|
139
|
-
}),
|
|
140
|
-
'metadata-replace': base_1.Flags.string({
|
|
141
|
-
char: 'M',
|
|
142
|
-
description: 'define a metadata attribute and replace every item already present in the remote resource',
|
|
143
|
-
multiple: true,
|
|
144
|
-
exclusive: ['metadata'],
|
|
145
|
-
}),
|
|
146
|
-
data: base_1.Flags.string({
|
|
147
|
-
char: 'D',
|
|
148
|
-
description: 'the data file to use as request body',
|
|
149
|
-
multiple: false,
|
|
150
|
-
exclusive: ['attribute', 'relationship', 'metadata', 'metadata-replace', 'doc' /*, FLAG_LOAD_PARAMS, FLAG_SAVE_PARAMS */],
|
|
151
|
-
})
|
|
152
|
-
};
|
|
153
|
-
ProvisioningUpdate.args = {
|
|
154
|
-
...base_1.default.args,
|
|
155
|
-
id: base_1.Args.string({ name: 'id', description: 'id of the resource to update', required: false }),
|
|
156
|
-
};
|
|
157
157
|
exports.default = ProvisioningUpdate;
|