@commercelayer/cli-plugin-provisioning 1.0.1 → 2.0.0-oclif3.1

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.
@@ -4,14 +4,14 @@ 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/parser").CustomOptions>;
8
- page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- pageSize: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- sort: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
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/parser").CustomOptions>;
14
- fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").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>;
@@ -7,6 +7,60 @@ 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
+ };
10
64
  async run() {
11
65
  const { args, flags } = await this.parse(ProvisioningList);
12
66
  const resource = this.checkResource(args.resource);
@@ -80,58 +134,4 @@ class ProvisioningList extends base_1.default {
80
134
  }
81
135
  }
82
136
  }
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
137
  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/parser").CustomOptions>;
9
- page: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- pageSize: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- sort: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- extract: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
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/parser").CustomOptions>;
15
- fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
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/parser").Arg<string, Record<string, unknown>>;
24
- relationship: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
25
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
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
+ ...base_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/parser").CustomOptions>;
8
- include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
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/parser").Arg<string | undefined, Record<string, unknown>>;
18
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
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/parser").CustomOptions>;
8
- object: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- relationship: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- metadata: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- 'metadata-replace': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- data: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
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/parser").Arg<string | undefined, Record<string, unknown>>;
23
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
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;
@@ -163,6 +163,7 @@
163
163
  "pluginName": "@commercelayer/cli-plugin-provisioning",
164
164
  "pluginType": "core",
165
165
  "strict": true,
166
+ "enableJsonFlag": false,
166
167
  "isESM": false,
167
168
  "relativePath": [
168
169
  "lib",
@@ -292,6 +293,7 @@
292
293
  "pluginName": "@commercelayer/cli-plugin-provisioning",
293
294
  "pluginType": "core",
294
295
  "strict": true,
296
+ "enableJsonFlag": false,
295
297
  "isESM": false,
296
298
  "relativePath": [
297
299
  "lib",
@@ -364,6 +366,7 @@
364
366
  "pluginName": "@commercelayer/cli-plugin-provisioning",
365
367
  "pluginType": "core",
366
368
  "strict": true,
369
+ "enableJsonFlag": false,
367
370
  "isESM": false,
368
371
  "relativePath": [
369
372
  "lib",
@@ -548,6 +551,7 @@
548
551
  "pluginName": "@commercelayer/cli-plugin-provisioning",
549
552
  "pluginType": "core",
550
553
  "strict": false,
554
+ "enableJsonFlag": false,
551
555
  "isESM": false,
552
556
  "relativePath": [
553
557
  "lib",
@@ -732,6 +736,7 @@
732
736
  "pluginName": "@commercelayer/cli-plugin-provisioning",
733
737
  "pluginType": "core",
734
738
  "strict": false,
739
+ "enableJsonFlag": false,
735
740
  "isESM": false,
736
741
  "relativePath": [
737
742
  "lib",
@@ -911,6 +916,7 @@
911
916
  "pluginName": "@commercelayer/cli-plugin-provisioning",
912
917
  "pluginType": "core",
913
918
  "strict": true,
919
+ "enableJsonFlag": false,
914
920
  "isESM": false,
915
921
  "relativePath": [
916
922
  "lib",
@@ -931,6 +937,7 @@
931
937
  "pluginName": "@commercelayer/cli-plugin-provisioning",
932
938
  "pluginType": "core",
933
939
  "strict": true,
940
+ "enableJsonFlag": false,
934
941
  "isESM": false,
935
942
  "relativePath": [
936
943
  "lib",
@@ -1120,6 +1127,7 @@
1120
1127
  "pluginName": "@commercelayer/cli-plugin-provisioning",
1121
1128
  "pluginType": "core",
1122
1129
  "strict": true,
1130
+ "enableJsonFlag": false,
1123
1131
  "isESM": false,
1124
1132
  "relativePath": [
1125
1133
  "lib",
@@ -1155,6 +1163,7 @@
1155
1163
  "pluginName": "@commercelayer/cli-plugin-provisioning",
1156
1164
  "pluginType": "core",
1157
1165
  "strict": true,
1166
+ "enableJsonFlag": false,
1158
1167
  "isESM": false,
1159
1168
  "relativePath": [
1160
1169
  "lib",
@@ -1296,6 +1305,7 @@
1296
1305
  "pluginName": "@commercelayer/cli-plugin-provisioning",
1297
1306
  "pluginType": "core",
1298
1307
  "strict": true,
1308
+ "enableJsonFlag": false,
1299
1309
  "isESM": false,
1300
1310
  "relativePath": [
1301
1311
  "lib",
@@ -1489,6 +1499,7 @@
1489
1499
  "pluginName": "@commercelayer/cli-plugin-provisioning",
1490
1500
  "pluginType": "core",
1491
1501
  "strict": true,
1502
+ "enableJsonFlag": false,
1492
1503
  "isESM": false,
1493
1504
  "relativePath": [
1494
1505
  "lib",
@@ -1498,5 +1509,5 @@
1498
1509
  ]
1499
1510
  }
1500
1511
  },
1501
- "version": "1.0.1"
1512
+ "version": "2.0.0-oclif3.1"
1502
1513
  }