@prismatic-io/prism 5.2.10 → 6.0.0-preview1

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.
Files changed (160) hide show
  1. package/lib/index.js +32973 -5
  2. package/lib/run.js +365 -0
  3. package/lib/templates/action/action.ts.ejs +33 -0
  4. package/lib/templates/component/assets/icon.png.ejs +0 -0
  5. package/lib/templates/component/jest.config.js.ejs +4 -0
  6. package/lib/templates/component/package.json.ejs +6 -0
  7. package/lib/templates/component/src/client.ts.ejs +10 -0
  8. package/lib/templates/component/src/index.test.ts.ejs +47 -0
  9. package/lib/templates/component/src/index.ts.ejs +19 -0
  10. package/lib/templates/component/tsconfig.json.ejs +12 -0
  11. package/lib/templates/component/webpack.config.js.ejs +36 -0
  12. package/lib/templates/connection/basic.ts.ejs +25 -0
  13. package/lib/templates/connection/oauth.ts.ejs +65 -0
  14. package/lib/templates/dataSource/dataSource.ts.ejs +34 -0
  15. package/lib/templates/flow/flow.ts.ejs +37 -0
  16. package/lib/templates/formats/assets/icon.png.ejs +0 -0
  17. package/lib/templates/formats/jest.config.js.ejs +4 -0
  18. package/lib/templates/formats/tsconfig.json.ejs +12 -0
  19. package/lib/templates/formats/webpack.config.js.ejs +36 -0
  20. package/lib/templates/integration/assets/icon.png.ejs +0 -0
  21. package/lib/templates/integration/basic.ts.ejs +29 -0
  22. package/lib/templates/integration/jest.config.js.ejs +4 -0
  23. package/lib/templates/integration/oauth.ts.ejs +69 -0
  24. package/lib/templates/integration/package.json.ejs +6 -0
  25. package/lib/templates/integration/src/client.ts.ejs +10 -0
  26. package/lib/templates/integration/src/index.test.ts.ejs +18 -0
  27. package/lib/templates/integration/src/index.ts.ejs +11 -0
  28. package/lib/templates/integration/tsconfig.json.ejs +12 -0
  29. package/lib/templates/integration/webpack.config.js.ejs +36 -0
  30. package/lib/templates/trigger/trigger.ts.ejs +19 -0
  31. package/oclif.manifest.json +3153 -2451
  32. package/package.json +56 -60
  33. package/bin/run +0 -12
  34. package/lib/auth.js +0 -323
  35. package/lib/commands/alerts/events/list.js +0 -56
  36. package/lib/commands/alerts/groups/create.js +0 -58
  37. package/lib/commands/alerts/groups/delete.js +0 -35
  38. package/lib/commands/alerts/groups/list.js +0 -44
  39. package/lib/commands/alerts/monitors/clear.js +0 -35
  40. package/lib/commands/alerts/monitors/create.js +0 -102
  41. package/lib/commands/alerts/monitors/delete.js +0 -35
  42. package/lib/commands/alerts/monitors/list.js +0 -63
  43. package/lib/commands/alerts/triggers/list.js +0 -31
  44. package/lib/commands/alerts/webhooks/create.js +0 -67
  45. package/lib/commands/alerts/webhooks/delete.js +0 -35
  46. package/lib/commands/alerts/webhooks/list.js +0 -57
  47. package/lib/commands/components/actions/list.js +0 -96
  48. package/lib/commands/components/data-sources/list.js +0 -114
  49. package/lib/commands/components/delete.js +0 -35
  50. package/lib/commands/components/dev/run.js +0 -83
  51. package/lib/commands/components/dev/test.js +0 -266
  52. package/lib/commands/components/init/action.js +0 -12
  53. package/lib/commands/components/init/component.js +0 -12
  54. package/lib/commands/components/init/connection.js +0 -12
  55. package/lib/commands/components/init/dataSource.js +0 -12
  56. package/lib/commands/components/init/index.js +0 -126
  57. package/lib/commands/components/init/trigger.js +0 -12
  58. package/lib/commands/components/list.js +0 -95
  59. package/lib/commands/components/publish.js +0 -62
  60. package/lib/commands/components/triggers/list.js +0 -96
  61. package/lib/commands/customers/create.js +0 -72
  62. package/lib/commands/customers/credentials/create.js +0 -68
  63. package/lib/commands/customers/credentials/delete.js +0 -35
  64. package/lib/commands/customers/credentials/list.js +0 -56
  65. package/lib/commands/customers/credentials/update.js +0 -58
  66. package/lib/commands/customers/delete.js +0 -35
  67. package/lib/commands/customers/list.js +0 -51
  68. package/lib/commands/customers/update.js +0 -82
  69. package/lib/commands/customers/users/create.js +0 -67
  70. package/lib/commands/customers/users/delete.js +0 -35
  71. package/lib/commands/customers/users/list.js +0 -65
  72. package/lib/commands/customers/users/roles.js +0 -33
  73. package/lib/commands/customers/users/update.js +0 -76
  74. package/lib/commands/executions/step-result/get.js +0 -73
  75. package/lib/commands/instances/config-vars/list.js +0 -83
  76. package/lib/commands/instances/create.js +0 -84
  77. package/lib/commands/instances/delete.js +0 -35
  78. package/lib/commands/instances/deploy.js +0 -43
  79. package/lib/commands/instances/disable.js +0 -36
  80. package/lib/commands/instances/enable.js +0 -36
  81. package/lib/commands/instances/flow-configs/list.js +0 -62
  82. package/lib/commands/instances/flow-configs/test.js +0 -127
  83. package/lib/commands/instances/list.js +0 -86
  84. package/lib/commands/instances/update.js +0 -99
  85. package/lib/commands/integrations/available.js +0 -47
  86. package/lib/commands/integrations/create.js +0 -58
  87. package/lib/commands/integrations/delete.js +0 -35
  88. package/lib/commands/integrations/export.js +0 -29
  89. package/lib/commands/integrations/flows/list.js +0 -61
  90. package/lib/commands/integrations/flows/test.js +0 -124
  91. package/lib/commands/integrations/fork.js +0 -56
  92. package/lib/commands/integrations/import.js +0 -54
  93. package/lib/commands/integrations/init/flow.js +0 -12
  94. package/lib/commands/integrations/init/index.js +0 -45
  95. package/lib/commands/integrations/init/integration.js +0 -12
  96. package/lib/commands/integrations/list.js +0 -96
  97. package/lib/commands/integrations/marketplace.js +0 -80
  98. package/lib/commands/integrations/open.js +0 -18
  99. package/lib/commands/integrations/publish.js +0 -44
  100. package/lib/commands/integrations/update.js +0 -75
  101. package/lib/commands/integrations/versions/index.js +0 -83
  102. package/lib/commands/login.js +0 -33
  103. package/lib/commands/logout.js +0 -23
  104. package/lib/commands/logs/severities/list.js +0 -29
  105. package/lib/commands/me/index.js +0 -22
  106. package/lib/commands/me/token/revoke.js +0 -12
  107. package/lib/commands/me/token.js +0 -25
  108. package/lib/commands/on-prem-resources/delete.js +0 -35
  109. package/lib/commands/on-prem-resources/list.js +0 -69
  110. package/lib/commands/on-prem-resources/registration-jwt.js +0 -81
  111. package/lib/commands/organization/credentials/create.js +0 -60
  112. package/lib/commands/organization/credentials/delete.js +0 -35
  113. package/lib/commands/organization/credentials/list.js +0 -45
  114. package/lib/commands/organization/credentials/update.js +0 -58
  115. package/lib/commands/organization/signingKeys/delete.js +0 -35
  116. package/lib/commands/organization/signingKeys/generate.js +0 -22
  117. package/lib/commands/organization/signingKeys/import.js +0 -40
  118. package/lib/commands/organization/signingKeys/list.js +0 -36
  119. package/lib/commands/organization/update.js +0 -37
  120. package/lib/commands/organization/updateAvatarUrl.js +0 -47
  121. package/lib/commands/organization/users/create.js +0 -51
  122. package/lib/commands/organization/users/delete.js +0 -35
  123. package/lib/commands/organization/users/list.js +0 -60
  124. package/lib/commands/organization/users/roles.js +0 -33
  125. package/lib/commands/organization/users/update.js +0 -66
  126. package/lib/commands/translations/list.js +0 -35
  127. package/lib/config.js +0 -39
  128. package/lib/errors.js +0 -55
  129. package/lib/fields.js +0 -12
  130. package/lib/fs.js +0 -23
  131. package/lib/generate/action.js +0 -208
  132. package/lib/generate/index.js +0 -54
  133. package/lib/generate/input.js +0 -93
  134. package/lib/generate/parse.js +0 -59
  135. package/lib/generate/sourceFile.js +0 -90
  136. package/lib/generate/util.js +0 -17
  137. package/lib/graphql.js +0 -42
  138. package/lib/queries.graphql.js +0 -43
  139. package/lib/types.js +0 -6
  140. package/lib/utils/avatar.js +0 -48
  141. package/lib/utils/component/deleteByKey.js +0 -36
  142. package/lib/utils/component/publish.js +0 -247
  143. package/lib/utils/component/query.js +0 -23
  144. package/lib/utils/date.js +0 -14
  145. package/lib/utils/execution/logs.js +0 -86
  146. package/lib/utils/execution/stepResults.js +0 -87
  147. package/lib/utils/generate.js +0 -50
  148. package/lib/utils/import.js +0 -21
  149. package/lib/utils/integration/definition.js +0 -101
  150. package/lib/utils/integration/export.js +0 -36
  151. package/lib/utils/integration/import.js +0 -179
  152. package/lib/utils/integration/invoke.js +0 -81
  153. package/lib/utils/integration/open.js +0 -37
  154. package/lib/utils/integration/query.js +0 -59
  155. package/lib/utils/process.js +0 -15
  156. package/lib/utils/serialize.js +0 -8
  157. package/lib/utils/translations/processDataForTranslations.js +0 -132
  158. package/lib/utils/user/query.js +0 -26
  159. package/lib/yeoman.js +0 -27
  160. /package/{bin → lib}/run.cmd +0 -0
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../graphql");
5
- class ForkCommand extends core_1.Command {
6
- async run() {
7
- const { flags: { name, description }, args: { parent }, } = await this.parse(ForkCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation forkIntegration(
11
- $parentID: ID!
12
- $name: String!
13
- $description: String!
14
- ) {
15
- forkIntegration(
16
- input: { parent: $parentID, name: $name, description: $description }
17
- ) {
18
- integration {
19
- id
20
- }
21
- errors {
22
- field
23
- messages
24
- }
25
- }
26
- }
27
- `,
28
- variables: {
29
- parentID: parent,
30
- name,
31
- description,
32
- },
33
- });
34
- this.log(result.forkIntegration.integration.id);
35
- }
36
- }
37
- exports.default = ForkCommand;
38
- ForkCommand.description = "Fork an Integration";
39
- ForkCommand.flags = {
40
- name: core_1.Flags.string({
41
- char: "n",
42
- required: true,
43
- description: "name of the forked integration",
44
- }),
45
- description: core_1.Flags.string({
46
- char: "d",
47
- required: true,
48
- description: "longer description of the forked integration",
49
- }),
50
- };
51
- ForkCommand.args = {
52
- parent: core_1.Args.string({
53
- required: true,
54
- description: "ID of the Integration to fork",
55
- }),
56
- };
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const fs_1 = require("../../fs");
5
- const import_1 = require("../../utils/integration/import");
6
- const open_1 = require("../../utils/integration/open");
7
- class ImportCommand extends core_1.Command {
8
- async run() {
9
- const { flags: { path, integrationId, "icon-path": iconPath, open }, } = await this.parse(ImportCommand);
10
- if (path && !(await (0, fs_1.exists)(path))) {
11
- this.error(`Cannot find definition file at specified path "${path}"`, {
12
- exit: 2,
13
- });
14
- }
15
- if (iconPath && !(await (0, fs_1.exists)(iconPath))) {
16
- this.error(`Cannot find icon file at specified path "${iconPath}"`, {
17
- exit: 2,
18
- });
19
- }
20
- const integrationImportId = path
21
- ? // A path was specified, so assume we're importing a YAML Integration.
22
- await (0, import_1.importYamlIntegration)(path, integrationId)
23
- : // No path was specified, so assume the current directory is a Code Native Integration and import it.
24
- await (0, import_1.importCodeNativeIntegration)(integrationId);
25
- this.log(integrationImportId);
26
- if (open) {
27
- await (0, open_1.openIntegration)(integrationImportId);
28
- }
29
- }
30
- }
31
- exports.default = ImportCommand;
32
- ImportCommand.description = "Import an Integration using a YAML definition file or a Code Native Integration";
33
- ImportCommand.flags = {
34
- path: core_1.Flags.string({
35
- char: "p",
36
- required: false,
37
- description: "If supplied, the path to the YAML definition of the integration to import. Not applicable for Code Native Integrations.",
38
- }),
39
- integrationId: core_1.Flags.string({
40
- char: "i",
41
- required: false,
42
- description: "The ID of the integration being imported",
43
- }),
44
- "icon-path": core_1.Flags.string({
45
- required: false,
46
- description: "If supplied, the path to the PNG icon for the integration. Not applicable for Code Native Integrations.",
47
- }),
48
- open: core_1.Flags.boolean({
49
- char: "o",
50
- required: false,
51
- default: false,
52
- description: "If supplied, open the Designer for the imported integration",
53
- }),
54
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const yeoman_1 = require("../../../yeoman");
5
- class GenerateFlowCommand extends core_1.Command {
6
- async run() {
7
- await this.parse(GenerateFlowCommand);
8
- await (0, yeoman_1.runGenerator)("flow");
9
- }
10
- }
11
- exports.default = GenerateFlowCommand;
12
- GenerateFlowCommand.description = "Initialize a new file for a Code Native Integration Flow";
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const fs_1 = require("fs");
5
- const yeoman_1 = require("../../../yeoman");
6
- const generate_1 = require("../../../utils/generate");
7
- class InitializeIntegration extends core_1.Command {
8
- async run() {
9
- const { args: { name }, } = await this.parse(InitializeIntegration);
10
- if (!generate_1.VALID_NAME_REGEX.test(name)) {
11
- this.error(`'${name}' contains invalid characters. Please select an integration name that starts and ends with alphanumeric characters, and contains only alphanumeric characters, hyphens, and underscores. See https://regex101.com/?regex=${encodeURIComponent(generate_1.VALID_NAME_REGEX.source)}`, { exit: 1 });
12
- }
13
- this.log(`Creating directory for "${name}"...`);
14
- await fs_1.promises.mkdir(name);
15
- const cwd = process.cwd();
16
- process.chdir(name);
17
- // Legacy code paths (mostly; keep the component generator call)
18
- await (0, yeoman_1.runGenerator)("integration", process.env.NODE_ENV === "test"
19
- ? {
20
- name,
21
- description: "Prism-generated Integration",
22
- skipInstall: true,
23
- }
24
- : { name, skipInstall: false });
25
- // Pop back out.
26
- process.chdir(cwd);
27
- this.log(`
28
- "${name}" is ready for development.
29
- To install dependencies, run either "npm install" or "yarn install"
30
- To run unit tests for the integration, run "npm run test" or "yarn test"
31
- To build the integration, run "npm run build" or "yarn build"
32
- To import the integration, run "prism integrations:import"
33
-
34
- For documentation on writing Code Native Integrations, visit https://prismatic.io/docs/code-native-integrations/
35
- `);
36
- }
37
- }
38
- exports.default = InitializeIntegration;
39
- InitializeIntegration.description = "Initialize a new Code Native Integration";
40
- InitializeIntegration.args = {
41
- name: core_1.Args.string({
42
- required: true,
43
- description: "Name of the new integration to create (alphanumeric characters, hyphens, and underscores)",
44
- }),
45
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const yeoman_1 = require("../../../yeoman");
5
- class GenerateIntegrationCommand extends core_1.Command {
6
- async run() {
7
- await this.parse(GenerateIntegrationCommand);
8
- await (0, yeoman_1.runGenerator)("integration");
9
- }
10
- }
11
- exports.default = GenerateIntegrationCommand;
12
- GenerateIntegrationCommand.description = "Initialize a new Code Native Integration";
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../graphql");
5
- class ListCommand extends core_1.Command {
6
- async run() {
7
- const { flags } = await this.parse(ListCommand);
8
- const { showAllVersions, customer, "org-only": orgOnly } = flags;
9
- let integrations = [];
10
- let hasNextPage = true;
11
- let cursor = "";
12
- while (hasNextPage) {
13
- const { integrations: { nodes, pageInfo }, } = await (0, graphql_1.gqlRequest)({
14
- document: (0, graphql_1.gql) `
15
- query listIntegrations(
16
- $showAllVersions: Boolean
17
- $after: String
18
- $customer: ID
19
- $customerIsnull: Boolean
20
- ) {
21
- integrations(
22
- allVersions: $showAllVersions
23
- after: $after
24
- customer: $customer
25
- customer_Isnull: $customerIsnull
26
- ) {
27
- nodes {
28
- id
29
- name
30
- description
31
- versionNumber
32
- labels
33
- category
34
- customer {
35
- id
36
- name
37
- externalId
38
- }
39
- }
40
- pageInfo {
41
- hasNextPage
42
- endCursor
43
- }
44
- }
45
- }
46
- `,
47
- variables: {
48
- showAllVersions,
49
- after: cursor,
50
- customer,
51
- customerIsnull: orgOnly,
52
- },
53
- });
54
- integrations = [...integrations, ...nodes];
55
- cursor = pageInfo.endCursor;
56
- hasNextPage = pageInfo.hasNextPage;
57
- }
58
- core_1.ux.table(integrations, {
59
- id: {
60
- minWidth: 8,
61
- extended: true,
62
- },
63
- name: {},
64
- description: {},
65
- versionNumber: { header: "Version" },
66
- labels: { extended: true },
67
- category: { extended: true },
68
- customerId: { extended: true, get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; } },
69
- customerName: {
70
- extended: true,
71
- get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ""; },
72
- },
73
- customerExternalId: {
74
- extended: true,
75
- get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.externalId) !== null && _b !== void 0 ? _b : ""; },
76
- },
77
- }, { ...flags });
78
- }
79
- }
80
- exports.default = ListCommand;
81
- ListCommand.description = "List Integrations";
82
- ListCommand.flags = {
83
- ...core_1.ux.table.flags(),
84
- showAllVersions: core_1.Flags.boolean({
85
- char: "a",
86
- description: "If specified this command returns all versions of all integrations rather than only the latest version",
87
- }),
88
- customer: core_1.Flags.string({
89
- char: "c",
90
- description: "If specified this command returns only integrations that are available to the specified customer ID",
91
- }),
92
- "org-only": core_1.Flags.boolean({
93
- char: "o",
94
- description: "If specified this command returns only org integrations",
95
- }),
96
- };
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../graphql");
5
- class MarketplaceCommand extends core_1.Command {
6
- async run() {
7
- const { args: { integration }, flags: { available, deployable, overview, "allow-multiple-instances": multipleInstances, }, } = await this.parse(MarketplaceCommand);
8
- const marketplaceConfiguration = available
9
- ? deployable
10
- ? "AVAILABLE_AND_DEPLOYABLE"
11
- : "AVAILABLE_NOT_DEPLOYABLE"
12
- : "NOT_AVAILABLE_IN_MARKETPLACE";
13
- const result = await (0, graphql_1.gqlRequest)({
14
- document: (0, graphql_1.gql) `
15
- mutation updateMarketplaceConfiguration(
16
- $id: ID
17
- $marketplaceConfiguration: String!
18
- $overview: String!
19
- $multipleInstances: Boolean
20
- ) {
21
- updateIntegrationMarketplaceConfiguration(
22
- input: {
23
- id: $id
24
- marketplaceConfiguration: $marketplaceConfiguration
25
- overview: $overview
26
- allowMultipleMarketplaceInstances: $multipleInstances
27
- }
28
- ) {
29
- integration {
30
- id
31
- }
32
- errors {
33
- field
34
- messages
35
- }
36
- }
37
- }
38
- `,
39
- variables: {
40
- id: integration,
41
- marketplaceConfiguration,
42
- overview,
43
- multipleInstances,
44
- },
45
- });
46
- this.log(result.updateIntegrationMarketplaceConfiguration.integration.id);
47
- }
48
- }
49
- exports.default = MarketplaceCommand;
50
- MarketplaceCommand.description = "Make a version of an Integration available in the Marketplace";
51
- MarketplaceCommand.args = {
52
- integration: core_1.Args.string({
53
- required: true,
54
- description: "ID of an integration version to make marketplace available",
55
- }),
56
- };
57
- MarketplaceCommand.flags = {
58
- available: core_1.Flags.boolean({
59
- char: "a",
60
- description: "Mark this Integration version available in the marketplace",
61
- allowNo: true,
62
- required: true,
63
- }),
64
- deployable: core_1.Flags.boolean({
65
- char: "d",
66
- description: "Mark this Integration version as deployable in the marketplace; does not apply if not also marked available",
67
- allowNo: true,
68
- default: true,
69
- }),
70
- "allow-multiple-instances": core_1.Flags.boolean({
71
- char: "m",
72
- description: "Allow a customer to deploy multiple instances of this integration",
73
- allowNo: true,
74
- }),
75
- overview: core_1.Flags.string({
76
- char: "o",
77
- required: true,
78
- description: "Overview to describe the purpose of the integration",
79
- }),
80
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const open_1 = require("../../utils/integration/open");
5
- class OpenCommand extends core_1.Command {
6
- async run() {
7
- const { args: { integrationId }, } = await this.parse(OpenCommand);
8
- await (0, open_1.openIntegration)(integrationId);
9
- }
10
- }
11
- exports.default = OpenCommand;
12
- OpenCommand.description = "Open the Designer for the specified Integration";
13
- OpenCommand.args = {
14
- integrationId: core_1.Args.string({
15
- required: true,
16
- description: "ID of the integration to open",
17
- }),
18
- };
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../graphql");
5
- class PublishCommand extends core_1.Command {
6
- async run() {
7
- const { args: { integration }, flags: { comment }, } = await this.parse(PublishCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation publishIntegration($id: ID!, $comment: String) {
11
- publishIntegration(input: { id: $id, comment: $comment }) {
12
- integration {
13
- id
14
- }
15
- errors {
16
- field
17
- messages
18
- }
19
- }
20
- }
21
- `,
22
- variables: {
23
- id: integration,
24
- comment,
25
- },
26
- });
27
- this.log(result.publishIntegration.integration.id);
28
- }
29
- }
30
- exports.default = PublishCommand;
31
- PublishCommand.description = "Publish a version of an Integration for use in Instances";
32
- PublishCommand.args = {
33
- integration: core_1.Args.string({
34
- required: true,
35
- description: "ID of an integration to publish",
36
- }),
37
- };
38
- PublishCommand.flags = {
39
- comment: core_1.Flags.string({
40
- char: "c",
41
- required: false,
42
- description: "comment about changes in this publication",
43
- }),
44
- };
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../graphql");
5
- const fields_1 = require("../../fields");
6
- class UpdateCommand extends core_1.Command {
7
- async run() {
8
- const { args: { integration }, flags: { name, description, customer, "test-config-vars": testConfigVars, }, } = await this.parse(UpdateCommand);
9
- const result = await (0, graphql_1.gqlRequest)({
10
- document: (0, graphql_1.gql) `
11
- mutation updateIntegration(
12
- $id: ID!
13
- $name: String
14
- $description: String
15
- $customer: ID
16
- $testConfigVars: [InputInstanceConfigVariable]
17
- ) {
18
- updateIntegration(
19
- input: {
20
- id: $id
21
- name: $name
22
- description: $description
23
- customer: $customer
24
- testConfigVariables: $testConfigVars
25
- }
26
- ) {
27
- integration {
28
- id
29
- }
30
- errors {
31
- field
32
- messages
33
- }
34
- }
35
- }
36
- `,
37
- variables: {
38
- id: integration,
39
- name,
40
- description,
41
- customer,
42
- testConfigVars: (0, fields_1.parseJsonOrUndefined)(testConfigVars),
43
- },
44
- });
45
- this.log(result.updateIntegration.integration.id);
46
- }
47
- }
48
- exports.default = UpdateCommand;
49
- UpdateCommand.description = "Update an Integration's name or description";
50
- UpdateCommand.args = {
51
- integration: core_1.Args.string({
52
- required: true,
53
- description: "ID of an integration",
54
- }),
55
- };
56
- UpdateCommand.flags = {
57
- name: core_1.Flags.string({
58
- char: "n",
59
- description: "new name to give the integration",
60
- }),
61
- description: core_1.Flags.string({
62
- char: "d",
63
- description: "new description to give the integration",
64
- }),
65
- customer: core_1.Flags.string({
66
- char: "c",
67
- description: "ID of customer with which to associate the integration",
68
- }),
69
- "test-config-vars": core_1.Flags.string({
70
- description: "JSON-formatted config variables to be used for testing",
71
- }),
72
- "default-config-vars": core_1.Flags.string({
73
- description: "JSON-formatted default values for config variables that are replaced with instance or test config variables",
74
- }),
75
- };
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../../graphql");
5
- class ListCommand extends core_1.Command {
6
- async run() {
7
- const { flags, args: { integration }, } = await this.parse(ListCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- query listIntegrationVersions(
11
- $integrationId: ID!
12
- $onlyAvailable: Boolean
13
- $onlyShowOne: Int
14
- ) {
15
- integration(id: $integrationId) {
16
- versionSequence(
17
- versionIsAvailable: $onlyAvailable
18
- sortBy: [{ field: VERSION_NUMBER, direction: DESC }]
19
- first: $onlyShowOne
20
- ) {
21
- nodes {
22
- id
23
- versionNumber
24
- versionCreatedAt
25
- versionCreatedBy {
26
- email
27
- }
28
- versionComment
29
- versionIsAvailable
30
- }
31
- }
32
- }
33
- }
34
- `,
35
- variables: {
36
- integrationId: integration,
37
- onlyAvailable: flags["latest-available"] ? true : null,
38
- onlyShowOne: flags["latest-available"] ? 1 : null,
39
- },
40
- });
41
- core_1.ux.table(result.integration.versionSequence.nodes, {
42
- versionNumber: {
43
- header: "Version",
44
- },
45
- id: {
46
- header: "ID",
47
- get: (row) => row.id,
48
- extended: true,
49
- },
50
- versionCreatedAt: {
51
- header: "Created At",
52
- get: (row) => new Date(row.versionCreatedAt).toISOString(),
53
- },
54
- versionCreatedBy: {
55
- header: "Created By",
56
- get: (row) => { var _a, _b; return (_b = (_a = row.versionCreatedBy) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : ""; },
57
- },
58
- versionComment: {
59
- header: "Comment",
60
- get: (row) => { var _a; return (_a = row.versionComment) !== null && _a !== void 0 ? _a : ""; },
61
- },
62
- available: {
63
- header: "Available",
64
- get: (row) => row.versionIsAvailable,
65
- },
66
- }, { ...flags });
67
- }
68
- }
69
- exports.default = ListCommand;
70
- ListCommand.description = "List Integration versions";
71
- ListCommand.flags = {
72
- ...core_1.ux.table.flags(),
73
- "latest-available": core_1.Flags.boolean({
74
- char: "l",
75
- description: "Show only the latest available version",
76
- }),
77
- };
78
- ListCommand.args = {
79
- integration: core_1.Args.string({
80
- required: true,
81
- description: "ID of an integration",
82
- }),
83
- };
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const auth_1 = require("../auth");
5
- class LoginCommand extends core_1.Command {
6
- async run() {
7
- const { flags: { force, url }, } = await this.parse(LoginCommand);
8
- if (!force && (await (0, auth_1.isLoggedIn)())) {
9
- this.log("You are already logged in and ready to go!");
10
- return;
11
- }
12
- if (!url) {
13
- await core_1.ux.anykey("Press any key to open prismatic.io in your default browser");
14
- }
15
- await (0, auth_1.login)({ url });
16
- this.log("Login complete!");
17
- this.exit();
18
- }
19
- }
20
- exports.default = LoginCommand;
21
- LoginCommand.description = "Log in to your Prismatic account";
22
- LoginCommand.flags = {
23
- force: core_1.Flags.boolean({
24
- char: "f",
25
- default: false,
26
- description: "re-authenticate, even if you are already logged in",
27
- }),
28
- url: core_1.Flags.boolean({
29
- char: "u",
30
- default: false,
31
- description: "returns a challenge url without automatically opening a browser",
32
- }),
33
- };
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const config_1 = require("../config");
5
- const auth_1 = require("../auth");
6
- class LogoutCommand extends core_1.Command {
7
- async run() {
8
- const { flags: { browser }, } = await this.parse(LogoutCommand);
9
- if (browser) {
10
- await (0, auth_1.logout)();
11
- }
12
- await (0, config_1.deleteConfig)();
13
- this.log("Logout complete!");
14
- }
15
- }
16
- exports.default = LogoutCommand;
17
- LogoutCommand.description = "Log out of your Prismatic account";
18
- LogoutCommand.flags = {
19
- browser: core_1.Flags.boolean({
20
- char: "b",
21
- description: "additionally log out of your default browser's session",
22
- }),
23
- };
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const graphql_1 = require("../../../graphql");
5
- class ListCommand extends core_1.Command {
6
- async run() {
7
- const { flags } = await this.parse(ListCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- query listLogSeverityLevels {
11
- logSeverityLevels {
12
- id
13
- name
14
- }
15
- }
16
- `,
17
- });
18
- core_1.ux.table(result.logSeverityLevels, {
19
- id: {
20
- minWidth: 8,
21
- extended: true,
22
- },
23
- name: {},
24
- }, { ...flags });
25
- }
26
- }
27
- exports.default = ListCommand;
28
- ListCommand.description = "List Log Severities for use by Alert Triggers";
29
- ListCommand.flags = { ...core_1.ux.table.flags() };