@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 CHANGED
@@ -27,7 +27,7 @@ commercelayer [COMMAND] (--help | -h) for detailed information about plugin comm
27
27
  * [`commercelayer provisioning:create RESOURCE`](#commercelayer-provisioningcreate-resource)
28
28
  * [`commercelayer provisioning:delete RESOURCE [ID]`](#commercelayer-provisioningdelete-resource-id)
29
29
  * [`commercelayer provisioning:exec RESOURCE [ID] [ACTION]`](#commercelayer-provisioningexec-resource-id-action)
30
- * [`commercelayer provisioning:fetch PATH [ID]`](#commercelayer-provisioningfetch-path-id)
30
+ * [`commercelayer provisioning:fetch RESOURCE PATH [ID]`](#commercelayer-provisioningfetch-resource-path-id)
31
31
  * [`commercelayer provisioning:get RESOURCE [ID]`](#commercelayer-provisioningget-resource-id)
32
32
  * [`commercelayer provisioning:list RESOURCE`](#commercelayer-provisioninglist-resource)
33
33
  * [`commercelayer provisioning:resources`](#commercelayer-provisioningresources)
@@ -150,18 +150,19 @@ EXAMPLES
150
150
 
151
151
  _See code: [src/commands/provisioning/exec.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/exec.ts)_
152
152
 
153
- ### `commercelayer provisioning:fetch PATH [ID]`
153
+ ### `commercelayer provisioning:fetch RESOURCE PATH [ID]`
154
154
 
155
155
  Retrieve a resource or list a set of resources.
156
156
 
157
157
  ```sh-session
158
158
  USAGE
159
- $ commercelayer provisioning:fetch PATH [ID] [-i <value>] [-f <value>] [-u -j] [-H -R] [-Y ] [-e <value> | ] [-w
160
- <value>] [-p <value>] [-n <value>] [-s <value>]
159
+ $ commercelayer provisioning:fetch RESOURCE PATH [ID] [-i <value>] [-f <value>] [-u -j] [-H -R] [-Y ] [-e <value> | ]
160
+ [-w <value>] [-p <value>] [-n <value>] [-s <value>]
161
161
 
162
162
  ARGUMENTS
163
- PATH path (or URL) of the resource(s) to fetch
164
- ID resource id
163
+ RESOURCE the resource type
164
+ PATH path (or URL) of the resource(s) to fetch
165
+ ID resource id
165
166
 
166
167
  FLAGS
167
168
  -H, --headers show response headers
package/lib/base.d.ts CHANGED
@@ -5,8 +5,8 @@ import type { KeyValRel, KeyValObj, KeyValArray, KeyValString, KeyValSort, ResAt
5
5
  import type { CommandError } from '@oclif/core/lib/interfaces';
6
6
  export declare abstract class BaseCommand extends Command {
7
7
  static baseFlags: {
8
- domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
+ domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  };
11
11
  protected checkApplication(accessToken: string, kinds: string[]): boolean;
12
12
  checkResourceId(resource: string, resourceId?: string, required?: boolean): {
@@ -28,8 +28,8 @@ export declare abstract class BaseCommand extends Command {
28
28
  }
29
29
  export declare abstract class BaseFilterCommand extends BaseCommand {
30
30
  static flags: {
31
- include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
32
- fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
31
+ include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
32
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
33
33
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
34
34
  unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
35
35
  raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -53,7 +53,7 @@ export declare abstract class BaseFilterCommand extends BaseCommand {
53
53
  }
54
54
  export default abstract class extends BaseFilterCommand {
55
55
  static args: {
56
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
56
+ resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
57
57
  };
58
58
  }
59
59
  export { Flags, Args, cliux };
package/lib/base.js CHANGED
@@ -19,6 +19,19 @@ const pkg = require('../package.json');
19
19
  // export const FLAG_SAVE_PARAMS = 'save-args'
20
20
  // export const FLAG_LOAD_PARAMS = 'load-args'
21
21
  class BaseCommand extends core_1.Command {
22
+ static baseFlags = {
23
+ domain: core_1.Flags.string({
24
+ char: 'd',
25
+ required: false,
26
+ hidden: true,
27
+ env: 'CL_CLI_DOMAIN',
28
+ }),
29
+ accessToken: core_1.Flags.string({
30
+ hidden: true,
31
+ required: true,
32
+ env: 'CL_CLI_ACCESS_TOKEN',
33
+ })
34
+ };
22
35
  checkApplication(accessToken, kinds) {
23
36
  const info = cli_core_1.clToken.decodeAccessToken(accessToken);
24
37
  if (info === null)
@@ -146,20 +159,82 @@ class BaseCommand extends core_1.Command {
146
159
  }
147
160
  }
148
161
  exports.BaseCommand = BaseCommand;
149
- BaseCommand.baseFlags = {
150
- domain: core_1.Flags.string({
151
- char: 'd',
152
- required: false,
153
- hidden: true,
154
- env: 'CL_CLI_DOMAIN',
155
- }),
156
- accessToken: core_1.Flags.string({
157
- hidden: true,
158
- required: true,
159
- env: 'CL_CLI_ACCESS_TOKEN',
160
- })
161
- };
162
162
  class BaseFilterCommand extends BaseCommand {
163
+ static flags = {
164
+ include: core_1.Flags.string({
165
+ char: 'i',
166
+ multiple: true,
167
+ description: 'comma separated resources to include',
168
+ }),
169
+ fields: core_1.Flags.string({
170
+ char: 'f',
171
+ multiple: true,
172
+ description: 'comma separeted list of fields in the format [resourceType/]field1,field2...',
173
+ }),
174
+ json: core_1.Flags.boolean({
175
+ char: 'j',
176
+ description: 'convert output in standard JSON format',
177
+ }),
178
+ unformatted: core_1.Flags.boolean({
179
+ char: 'u',
180
+ description: 'print unformatted JSON output',
181
+ dependsOn: ['json'],
182
+ }),
183
+ raw: core_1.Flags.boolean({
184
+ char: 'R',
185
+ description: 'print out the raw API response',
186
+ hidden: false,
187
+ }),
188
+ /*
189
+ doc: Flags.boolean({
190
+ description: 'show the CLI command in a specific language',
191
+ exclusive: ['raw'],
192
+ helpGroup: 'documentation',
193
+ }),
194
+ lang: Flags.string({
195
+ char: 'l',
196
+ description: 'show the CLI command in the specified language syntax',
197
+ exclusive: availableLanguages,
198
+ options: availableLanguages,
199
+ dependsOn: ['doc'],
200
+ helpGroup: 'documentation',
201
+ }),
202
+ curl: Flags.boolean({
203
+ description: `show the equivalent ${languageInfo.curl.label} of the CLI command`,
204
+ exclusive: ['lang', ...availableLanguages.filter(l => l !== 'curl')],
205
+ parse: async (): Promise<string> => await Promise.resolve('curl'),
206
+ hidden: !availableLanguages.includes('curl'),
207
+ dependsOn: ['doc'],
208
+ helpGroup: 'documentation',
209
+ }),
210
+ node: Flags.boolean({
211
+ description: `show the equivalent ${languageInfo.node.label} of the CLI command`,
212
+ exclusive: ['lang', ...availableLanguages.filter(l => l !== 'node')],
213
+ parse: async (): Promise<string> => await Promise.resolve('node'),
214
+ hidden: !availableLanguages.includes('node'),
215
+ dependsOn: ['doc'],
216
+ helpGroup: 'documentation',
217
+ }),
218
+ [FLAG_SAVE_PARAMS]: Flags.string({
219
+ description: 'save command data to file for future use',
220
+ }),
221
+ [FLAG_LOAD_PARAMS]: Flags.string({
222
+ description: 'load previously saved command arguments',
223
+ }),
224
+ */
225
+ headers: core_1.Flags.boolean({
226
+ char: 'H',
227
+ description: 'show response headers',
228
+ dependsOn: ['raw'],
229
+ exclusive: ['headers-only'],
230
+ }),
231
+ 'headers-only': core_1.Flags.boolean({
232
+ char: 'Y',
233
+ description: 'show only response headers',
234
+ dependsOn: ['raw'],
235
+ exclusive: ['headers', 'fields', 'include'],
236
+ }),
237
+ };
163
238
  // INIT (override)
164
239
  async init() {
165
240
  // Check for plugin updates only if in visible mode
@@ -413,84 +488,10 @@ class BaseFilterCommand extends BaseCommand {
413
488
  }
414
489
  }
415
490
  exports.BaseFilterCommand = BaseFilterCommand;
416
- BaseFilterCommand.flags = {
417
- include: core_1.Flags.string({
418
- char: 'i',
419
- multiple: true,
420
- description: 'comma separated resources to include',
421
- }),
422
- fields: core_1.Flags.string({
423
- char: 'f',
424
- multiple: true,
425
- description: 'comma separeted list of fields in the format [resourceType/]field1,field2...',
426
- }),
427
- json: core_1.Flags.boolean({
428
- char: 'j',
429
- description: 'convert output in standard JSON format',
430
- }),
431
- unformatted: core_1.Flags.boolean({
432
- char: 'u',
433
- description: 'print unformatted JSON output',
434
- dependsOn: ['json'],
435
- }),
436
- raw: core_1.Flags.boolean({
437
- char: 'R',
438
- description: 'print out the raw API response',
439
- hidden: false,
440
- }),
441
- /*
442
- doc: Flags.boolean({
443
- description: 'show the CLI command in a specific language',
444
- exclusive: ['raw'],
445
- helpGroup: 'documentation',
446
- }),
447
- lang: Flags.string({
448
- char: 'l',
449
- description: 'show the CLI command in the specified language syntax',
450
- exclusive: availableLanguages,
451
- options: availableLanguages,
452
- dependsOn: ['doc'],
453
- helpGroup: 'documentation',
454
- }),
455
- curl: Flags.boolean({
456
- description: `show the equivalent ${languageInfo.curl.label} of the CLI command`,
457
- exclusive: ['lang', ...availableLanguages.filter(l => l !== 'curl')],
458
- parse: async (): Promise<string> => await Promise.resolve('curl'),
459
- hidden: !availableLanguages.includes('curl'),
460
- dependsOn: ['doc'],
461
- helpGroup: 'documentation',
462
- }),
463
- node: Flags.boolean({
464
- description: `show the equivalent ${languageInfo.node.label} of the CLI command`,
465
- exclusive: ['lang', ...availableLanguages.filter(l => l !== 'node')],
466
- parse: async (): Promise<string> => await Promise.resolve('node'),
467
- hidden: !availableLanguages.includes('node'),
468
- dependsOn: ['doc'],
469
- helpGroup: 'documentation',
470
- }),
471
- [FLAG_SAVE_PARAMS]: Flags.string({
472
- description: 'save command data to file for future use',
473
- }),
474
- [FLAG_LOAD_PARAMS]: Flags.string({
475
- description: 'load previously saved command arguments',
476
- }),
477
- */
478
- headers: core_1.Flags.boolean({
479
- char: 'H',
480
- description: 'show response headers',
481
- dependsOn: ['raw'],
482
- exclusive: ['headers-only'],
483
- }),
484
- 'headers-only': core_1.Flags.boolean({
485
- char: 'Y',
486
- description: 'show only response headers',
487
- dependsOn: ['raw'],
488
- exclusive: ['headers', 'fields', 'include'],
489
- }),
490
- };
491
491
  class default_1 extends BaseFilterCommand {
492
+ static args = {
493
+ ...BaseFilterCommand.args,
494
+ resource: core_1.Args.string({ name: 'resource', description: 'the resource type', required: true }),
495
+ };
492
496
  }
493
- default_1.args = {
494
- resource: core_1.Args.string({ name: 'resource', description: 'the resource type', required: true }),
495
- };
496
497
  exports.default = default_1;
@@ -4,13 +4,13 @@ export default class ProvisioningCreate 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
- data: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- 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
+ data: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
14
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
16
  raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -7,6 +7,43 @@ const cli_core_1 = require("@commercelayer/cli-core");
7
7
  // import { mergeCommandParams } from '../../commands'
8
8
  const OPERATION = 'create';
9
9
  class ProvisioningCreate extends base_1.default {
10
+ static description = 'create a new resource';
11
+ static aliases = ['prov:create', 'pc', 'pcreate'];
12
+ static examples = [
13
+ '$ commercelayer provisioning:create organizations -a name=MyOrg',
14
+ '$ clayer prov:create subscriptions -r plan=plans/<planId>',
15
+ '$ cl prov:create organization -a name=MyOrg -m meta_key="meta value"',
16
+ '$ cl pc roles -D /path/to/data/file/data.json',
17
+ ];
18
+ static flags = {
19
+ ...base_1.default.flags,
20
+ attribute: base_1.Flags.string({
21
+ char: 'a',
22
+ description: 'define a resource attribute',
23
+ multiple: true,
24
+ }),
25
+ object: base_1.Flags.string({
26
+ char: 'O',
27
+ description: 'define a resource object attribute',
28
+ multiple: true,
29
+ }),
30
+ relationship: base_1.Flags.string({
31
+ char: 'r',
32
+ description: 'define a relationship with another resource',
33
+ multiple: true,
34
+ }),
35
+ metadata: base_1.Flags.string({
36
+ char: 'm',
37
+ description: 'define a metadata attribute or a set of metadata attributes',
38
+ multiple: true,
39
+ }),
40
+ data: base_1.Flags.string({
41
+ char: 'D',
42
+ description: 'the data file to use as request body',
43
+ multiple: false,
44
+ exclusive: ['attribute', 'relationship', 'metadata', 'doc' /* , FLAG_LOAD_PARAMS, FLAG_SAVE_PARAMS */],
45
+ })
46
+ };
10
47
  async run() {
11
48
  const { args, flags } = await this.parse(ProvisioningCreate);
12
49
  const resource = this.checkResource(args.resource, { singular: true });
@@ -97,41 +134,4 @@ class ProvisioningCreate extends base_1.default {
97
134
  }
98
135
  }
99
136
  }
100
- ProvisioningCreate.description = 'create a new resource';
101
- ProvisioningCreate.aliases = ['prov:create', 'pc', 'pcreate'];
102
- ProvisioningCreate.examples = [
103
- '$ commercelayer provisioning:create organizations -a name=MyOrg',
104
- '$ clayer prov:create subscriptions -r plan=plans/<planId>',
105
- '$ cl prov:create organization -a name=MyOrg -m meta_key="meta value"',
106
- '$ cl pc roles -D /path/to/data/file/data.json',
107
- ];
108
- ProvisioningCreate.flags = {
109
- ...base_1.default.flags,
110
- attribute: base_1.Flags.string({
111
- char: 'a',
112
- description: 'define a resource attribute',
113
- multiple: true,
114
- }),
115
- object: base_1.Flags.string({
116
- char: 'O',
117
- description: 'define a resource object attribute',
118
- multiple: true,
119
- }),
120
- relationship: base_1.Flags.string({
121
- char: 'r',
122
- description: 'define a relationship with another resource',
123
- multiple: true,
124
- }),
125
- metadata: base_1.Flags.string({
126
- char: 'm',
127
- description: 'define a metadata attribute or a set of metadata attributes',
128
- multiple: true,
129
- }),
130
- data: base_1.Flags.string({
131
- char: 'D',
132
- description: 'the data file to use as request body',
133
- multiple: false,
134
- exclusive: ['attribute', 'relationship', 'metadata', 'doc' /* , FLAG_LOAD_PARAMS, FLAG_SAVE_PARAMS */],
135
- })
136
- };
137
137
  exports.default = ProvisioningCreate;
@@ -4,8 +4,8 @@ export default class ProvisioningDelete extends Command {
4
4
  static aliases: string[];
5
5
  static examples: string[];
6
6
  static flags: {
7
- include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
9
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
10
  unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  raw: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -13,8 +13,8 @@ export default class ProvisioningDelete extends Command {
13
13
  'headers-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
14
  };
15
15
  static args: {
16
- id: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
17
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
16
+ id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
17
+ resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
18
18
  };
19
19
  run(): Promise<any>;
20
20
  }
@@ -6,6 +6,19 @@ const base_1 = tslib_1.__importStar(require("../../base"));
6
6
  const cli_core_1 = require("@commercelayer/cli-core");
7
7
  const OPERATION = 'delete';
8
8
  class ProvisioningDelete extends base_1.default {
9
+ static description = 'delete an existing resource';
10
+ static aliases = ['prov:delete', 'pd', 'pdelete', 'pdel'];
11
+ static examples = [
12
+ '$ commercelayer provisioning:delete api_credentials/<id>',
13
+ '$ cl prov:delete api_credentials <id>',
14
+ ];
15
+ static flags = {
16
+ ...(cli_core_1.clCommand.commandFlags(base_1.default.flags, ['save-params', 'load-params']))
17
+ };
18
+ static args = {
19
+ ...base_1.default.args,
20
+ id: base_1.Args.string({ name: 'id', description: 'id of the resource to delete', required: false })
21
+ };
9
22
  async run() {
10
23
  const { args, flags } = await this.parse(ProvisioningDelete);
11
24
  const invalidFlags = ['fields', 'include'];
@@ -36,17 +49,4 @@ class ProvisioningDelete extends base_1.default {
36
49
  }
37
50
  }
38
51
  }
39
- ProvisioningDelete.description = 'delete an existing resource';
40
- ProvisioningDelete.aliases = ['prov:delete', 'pd', 'pdelete', 'pdel'];
41
- ProvisioningDelete.examples = [
42
- '$ commercelayer provisioning:delete api_credentials/<id>',
43
- '$ cl prov:delete api_credentials <id>',
44
- ];
45
- ProvisioningDelete.flags = {
46
- ...(cli_core_1.clCommand.commandFlags(base_1.default.flags, ['save-params', 'load-params']))
47
- };
48
- ProvisioningDelete.args = {
49
- ...base_1.default.args,
50
- id: base_1.Args.string({ name: 'id', description: 'id of the resource to delete', required: false })
51
- };
52
52
  exports.default = ProvisioningDelete;
@@ -4,12 +4,12 @@ export default class ProvisioningExec extends BaseCommand {
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>;
7
+ attribute: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
8
  };
9
9
  static args: {
10
- id: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
11
- action: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
12
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
10
+ id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
11
+ action: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
12
+ resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
13
  };
14
14
  run(): Promise<void>;
15
15
  }
@@ -4,6 +4,24 @@ const tslib_1 = require("tslib");
4
4
  const base_1 = tslib_1.__importStar(require("../../base"));
5
5
  const cli_core_1 = require("@commercelayer/cli-core");
6
6
  class ProvisioningExec extends base_1.BaseCommand {
7
+ static description = 'execute an action on a resource';
8
+ static aliases = ['prov:exec', 'pe', 'pexec'];
9
+ static examples = [
10
+ '$ commercelayer provisioning:exec organizations <organizationId> transfer_ownership',
11
+ '$ cl prov:exec memberships <membershipId> resend'
12
+ ];
13
+ static flags = {
14
+ attribute: base_1.Flags.string({
15
+ char: 'a',
16
+ description: 'define a resource attribute',
17
+ multiple: true,
18
+ })
19
+ };
20
+ static args = {
21
+ ...base_1.default.args,
22
+ id: base_1.Args.string({ name: 'id', description: 'id of the resource on which to execute the action', required: false }),
23
+ action: base_1.Args.string({ name: 'action', description: 'action to execute on resource', required: false })
24
+ };
7
25
  async run() {
8
26
  const { args, flags } = await this.parse(ProvisioningExec);
9
27
  const action = args.action;
@@ -34,22 +52,4 @@ class ProvisioningExec extends base_1.BaseCommand {
34
52
  }
35
53
  }
36
54
  }
37
- ProvisioningExec.description = 'execute an action on a resource';
38
- ProvisioningExec.aliases = ['prov:exec', 'pe', 'pexec'];
39
- ProvisioningExec.examples = [
40
- '$ commercelayer provisioning:exec organizations <organizationId> transfer_ownership',
41
- '$ cl prov:exec memberships <membershipId> resend'
42
- ];
43
- ProvisioningExec.flags = {
44
- attribute: base_1.Flags.string({
45
- char: 'a',
46
- description: 'define a resource attribute',
47
- multiple: true,
48
- })
49
- };
50
- ProvisioningExec.args = {
51
- ...base_1.default.args,
52
- id: base_1.Args.string({ name: 'id', description: 'id of the resource on which to execute the action', required: false }),
53
- action: base_1.Args.string({ name: 'action', description: 'action to execute on resource', required: false })
54
- };
55
55
  exports.default = ProvisioningExec;
@@ -5,14 +5,14 @@ export default class ResourcesFetch extends BaseFilterCommand {
5
5
  static examples: string[];
6
6
  static strict: boolean;
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,8 +20,9 @@ export default class ResourcesFetch extends BaseFilterCommand {
20
20
  'headers-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
21
  };
22
22
  static args: {
23
- path: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
24
- id: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
23
+ path: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
24
+ id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
25
+ resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
25
26
  };
26
27
  run(): Promise<any>;
27
28
  private fixPath;
@@ -7,6 +7,25 @@ const list_1 = tslib_1.__importDefault(require("./list"));
7
7
  const relationship_1 = tslib_1.__importDefault(require("./relationship"));
8
8
  const get_1 = tslib_1.__importDefault(require("./get"));
9
9
  class ResourcesFetch extends base_1.BaseFilterCommand {
10
+ static description = 'retrieve a resource or list a set of resources';
11
+ static aliases = ['prov:fetch', 'pf'];
12
+ static examples = [
13
+ '$ commercelayer provisioning:fetch roles',
14
+ '$ commercelayer prov:fetch roles',
15
+ '$ clayer prov:fetch roles/<roleId>',
16
+ '$ cl prov:fetch roles/<roleId>/<roleRelationship>',
17
+ '$ cl pf roles/{roleId}/permissions aBcdEkYWx',
18
+ ];
19
+ static strict = false;
20
+ static flags = {
21
+ ...retrieve_1.default.flags,
22
+ ...list_1.default.flags,
23
+ };
24
+ static args = {
25
+ ...list_1.default.args,
26
+ path: base_1.Args.string({ name: 'path', description: 'path (or URL) of the resource(s) to fetch', required: true }),
27
+ id: base_1.Args.string({ name: 'id', description: 'resource id', required: false }),
28
+ };
10
29
  async run() {
11
30
  const { args } = await this.parse(ResourcesFetch);
12
31
  const path = this.fixPath(args.path, args);
@@ -36,22 +55,4 @@ class ResourcesFetch extends base_1.BaseFilterCommand {
36
55
  return path;
37
56
  }
38
57
  }
39
- ResourcesFetch.description = 'retrieve a resource or list a set of resources';
40
- ResourcesFetch.aliases = ['prov:fetch', 'pf'];
41
- ResourcesFetch.examples = [
42
- '$ commercelayer provisioning:fetch roles',
43
- '$ commercelayer prov:fetch roles',
44
- '$ clayer prov:fetch roles/<roleId>',
45
- '$ cl prov:fetch roles/<roleId>/<roleRelationship>',
46
- '$ cl pf roles/{roleId}/permissions aBcdEkYWx',
47
- ];
48
- ResourcesFetch.strict = false;
49
- ResourcesFetch.flags = {
50
- ...retrieve_1.default.flags,
51
- ...list_1.default.flags,
52
- };
53
- ResourcesFetch.args = {
54
- path: base_1.Args.string({ name: 'path', description: 'path (or URL) of the resource(s) to fetch', required: true }),
55
- id: base_1.Args.string({ name: 'id', description: 'resource id', required: false }),
56
- };
57
58
  exports.default = ResourcesFetch;
@@ -5,14 +5,14 @@ export default class ProvisioningGet extends Command {
5
5
  static examples: string[];
6
6
  static strict: boolean;
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,8 +20,8 @@ export default class ProvisioningGet 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 | undefined, Record<string, unknown>>;
24
- resource: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
23
+ id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
24
+ resource: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
25
25
  };
26
26
  run(): Promise<any>;
27
27
  }