@prismatic-io/prism 5.2.11 → 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,35 +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 DeleteCommand extends core_1.Command {
6
- async run() {
7
- const { args: { user }, } = await this.parse(DeleteCommand);
8
- await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation deleteUser($id: ID!) {
11
- deleteUser(input: { id: $id }) {
12
- user {
13
- id
14
- }
15
- errors {
16
- field
17
- messages
18
- }
19
- }
20
- }
21
- `,
22
- variables: {
23
- id: user,
24
- },
25
- });
26
- }
27
- }
28
- exports.default = DeleteCommand;
29
- DeleteCommand.description = "Delete a Customer User";
30
- DeleteCommand.args = {
31
- user: core_1.Args.string({
32
- required: true,
33
- description: "ID of the user to delete",
34
- }),
35
- };
@@ -1,65 +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 { args: { customer }, flags, } = await this.parse(ListCommand);
8
- let customerUsers = [];
9
- let hasNextPage = true;
10
- let cursor = "";
11
- while (hasNextPage) {
12
- const { customer: { users: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
13
- document: (0, graphql_1.gql) `
14
- query listCustomerUsers($id: ID!, $after: String) {
15
- customer(id: $id) {
16
- users(after: $after) {
17
- nodes {
18
- id
19
- name
20
- email
21
- externalId
22
- role {
23
- name
24
- }
25
- }
26
- pageInfo {
27
- hasNextPage
28
- endCursor
29
- }
30
- }
31
- }
32
- }
33
- `,
34
- variables: { id: customer, after: cursor },
35
- });
36
- customerUsers = [...customerUsers, ...nodes];
37
- cursor = pageInfo.endCursor;
38
- hasNextPage = pageInfo.hasNextPage;
39
- }
40
- core_1.ux.table(customerUsers, {
41
- id: {
42
- minWidth: 8,
43
- extended: true,
44
- },
45
- name: {},
46
- email: {},
47
- role: { get: ({ role: { name } }) => name },
48
- externalId: {
49
- extended: true,
50
- get: ({ externalId }) => externalId || "",
51
- },
52
- }, { ...flags });
53
- }
54
- }
55
- exports.default = ListCommand;
56
- ListCommand.description = "List Customer Users";
57
- ListCommand.args = {
58
- customer: core_1.Args.string({
59
- description: "ID of the customer",
60
- required: true,
61
- }),
62
- };
63
- ListCommand.flags = {
64
- ...core_1.ux.table.flags(),
65
- };
@@ -1,33 +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 listCustomerRoles {
11
- customerRoles {
12
- id
13
- name
14
- description
15
- }
16
- }
17
- `,
18
- });
19
- core_1.ux.table(result.customerRoles, {
20
- id: {
21
- minWidth: 8,
22
- extended: true,
23
- },
24
- name: {},
25
- description: {},
26
- }, { ...flags });
27
- }
28
- }
29
- exports.default = ListCommand;
30
- ListCommand.description = "List Roles you can grant to Customer Users";
31
- ListCommand.flags = {
32
- ...core_1.ux.table.flags(),
33
- };
@@ -1,76 +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 UpdateCommand extends core_1.Command {
6
- async run() {
7
- const { args: { user }, flags: { name, phone, "dark-mode": darkMode, "dark-mode-os-sync": darkModeOsSync, }, } = await this.parse(UpdateCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation updateUser(
11
- $user: ID!
12
- $name: String
13
- $phone: String
14
- $darkMode: Boolean
15
- $darkModeOsSync: Boolean
16
- ) {
17
- updateUser(
18
- input: {
19
- id: $user
20
- name: $name
21
- phone: $phone
22
- darkMode: $darkMode
23
- darkModeSyncWithOs: $darkModeOsSync
24
- }
25
- ) {
26
- user {
27
- id
28
- }
29
- errors {
30
- field
31
- messages
32
- }
33
- }
34
- }
35
- `,
36
- variables: {
37
- user,
38
- name,
39
- phone,
40
- darkMode,
41
- darkModeOsSync,
42
- },
43
- });
44
- this.log(result.updateUser.user.id);
45
- }
46
- }
47
- exports.default = UpdateCommand;
48
- UpdateCommand.description = "Update a User";
49
- UpdateCommand.args = {
50
- user: core_1.Args.string({
51
- required: true,
52
- description: "ID of a user",
53
- }),
54
- };
55
- UpdateCommand.flags = {
56
- name: core_1.Flags.string({
57
- char: "n",
58
- description: "name of the user",
59
- required: false,
60
- }),
61
- phone: core_1.Flags.string({
62
- char: "p",
63
- description: "phone number of the user",
64
- required: false,
65
- }),
66
- "dark-mode": core_1.Flags.string({
67
- char: "d",
68
- description: "whether the user should have dark mode enabled",
69
- required: false,
70
- }),
71
- "dark-mode-os-sync": core_1.Flags.string({
72
- char: "o",
73
- description: "whether dark mode should sync with OS settings",
74
- required: false,
75
- }),
76
- };
@@ -1,73 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const fs_1 = require("../../../fs");
7
- const core_1 = require("@oclif/core");
8
- const graphql_1 = require("../../../graphql");
9
- const axios_1 = __importDefault(require("axios"));
10
- const stepResults_1 = require("../../../utils/execution/stepResults");
11
- class GetCommand extends core_1.Command {
12
- async run() {
13
- var _a, _b;
14
- const { flags } = await this.parse(GetCommand);
15
- const { executionId, stepName, outputPath } = flags;
16
- const result = await (0, graphql_1.gqlRequest)({
17
- document: (0, graphql_1.gql) `
18
- query getStepOutputDetails($executionId: ID!, $stepName: String!) {
19
- executionResult(id: $executionId) {
20
- id
21
- stepResults(displayStepName: $stepName) {
22
- nodes {
23
- displayStepName
24
- resultsUrl
25
- }
26
- }
27
- }
28
- }
29
- `,
30
- variables: {
31
- executionId: executionId,
32
- stepName: stepName,
33
- },
34
- });
35
- const stepResult = (_b = (_a = result === null || result === void 0 ? void 0 : result.executionResult) === null || _a === void 0 ? void 0 : _a.stepResults.nodes) === null || _b === void 0 ? void 0 : _b[0];
36
- if (stepResult === null || stepResult === void 0 ? void 0 : stepResult.resultsUrl) {
37
- const response = await axios_1.default.get(stepResult.resultsUrl, {
38
- responseType: "arraybuffer",
39
- });
40
- const resultsBuffer = Buffer.from(await response.data);
41
- const { data: deserializedResult, contentType } = (0, stepResults_1.deserialize)(resultsBuffer);
42
- const output = (0, stepResults_1.parseData)(deserializedResult, contentType);
43
- if (outputPath) {
44
- await fs_1.fs.writeFile(outputPath, output);
45
- }
46
- else {
47
- console.log(output);
48
- }
49
- }
50
- else {
51
- console.error("No step results found. Did you enter the correct step name?");
52
- }
53
- }
54
- }
55
- exports.default = GetCommand;
56
- GetCommand.description = "Gets the Result of a specified Step in an Instance Execution";
57
- GetCommand.flags = {
58
- executionId: core_1.Flags.string({
59
- char: "e",
60
- required: true,
61
- description: "ID of an Execution",
62
- }),
63
- stepName: core_1.Flags.string({
64
- char: "s",
65
- required: true,
66
- description: "Name of an Integration Step",
67
- }),
68
- outputPath: core_1.Flags.string({
69
- char: "p",
70
- required: false,
71
- description: "Output result to a file. Output will be printed to stdout if this is omitted",
72
- }),
73
- };
@@ -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 { args: { instance }, flags, } = await this.parse(ListCommand);
8
- let configVariables = [];
9
- let hasNextPage = true;
10
- let cursor = "";
11
- while (hasNextPage) {
12
- const { instance: { configVariables: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
13
- document: (0, graphql_1.gql) `
14
- query listInstanceConfigVariables($id: ID!) {
15
- instance(id: $id) {
16
- configVariables {
17
- nodes {
18
- id
19
- value
20
- status
21
- inputs {
22
- nodes {
23
- name
24
- value
25
- }
26
- }
27
- requiredConfigVariable {
28
- id
29
- key
30
- defaultValue
31
- dataType
32
- }
33
- }
34
- pageInfo {
35
- hasNextPage
36
- endCursor
37
- }
38
- }
39
- }
40
- }
41
- `,
42
- variables: {
43
- id: instance,
44
- after: cursor,
45
- },
46
- });
47
- configVariables = [...configVariables, ...nodes];
48
- cursor = pageInfo.endCursor;
49
- hasNextPage = pageInfo.hasNextPage;
50
- }
51
- core_1.ux.table(configVariables, {
52
- id: {
53
- minWidth: 8,
54
- extended: true,
55
- },
56
- requiredVariableId: {
57
- get: (row) => row.requiredConfigVariable.id,
58
- extended: true,
59
- },
60
- key: {
61
- get: (row) => row.requiredConfigVariable.key,
62
- },
63
- value: {
64
- get: (row) => row.requiredConfigVariable.dataType === "CONNECTION"
65
- ? row.inputs
66
- : row.value,
67
- },
68
- defaultValue: {
69
- get: (row) => row.requiredConfigVariable.dataType === "CONNECTION"
70
- ? ""
71
- : row.requiredConfigVariable.defaultValue,
72
- },
73
- }, { ...flags });
74
- }
75
- }
76
- exports.default = ListCommand;
77
- ListCommand.description = "List Config Variables used on an Instance";
78
- ListCommand.args = {
79
- instance: core_1.Args.string({ description: "ID of an instance", required: true }),
80
- };
81
- ListCommand.flags = {
82
- ...core_1.ux.table.flags(),
83
- };
@@ -1,84 +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 CreateCommand extends core_1.Command {
7
- async run() {
8
- const { flags: { name, description, integration, customer, "config-vars": configVars, label, }, } = await this.parse(CreateCommand);
9
- const result = await (0, graphql_1.gqlRequest)({
10
- document: (0, graphql_1.gql) `
11
- mutation createInstance(
12
- $name: String!
13
- $description: String
14
- $integration: ID!
15
- $customer: ID!
16
- $configVariables: [InputInstanceConfigVariable]
17
- $labels: [String]
18
- ) {
19
- createInstance(
20
- input: {
21
- name: $name
22
- description: $description
23
- integration: $integration
24
- customer: $customer
25
- configVariables: $configVariables
26
- labels: $labels
27
- }
28
- ) {
29
- instance {
30
- id
31
- }
32
- errors {
33
- field
34
- messages
35
- }
36
- }
37
- }
38
- `,
39
- variables: {
40
- name,
41
- description,
42
- integration,
43
- customer,
44
- configVariables: (0, fields_1.parseJsonOrUndefined)(configVars),
45
- labels: label,
46
- },
47
- });
48
- this.log(result.createInstance.instance.id);
49
- }
50
- }
51
- exports.default = CreateCommand;
52
- CreateCommand.description = "Create an Instance";
53
- CreateCommand.flags = {
54
- name: core_1.Flags.string({
55
- char: "n",
56
- required: true,
57
- description: "name of your new instance.",
58
- }),
59
- integration: core_1.Flags.string({
60
- char: "i",
61
- required: true,
62
- description: "ID of the integration or a specific integration version ID this is an instance of",
63
- }),
64
- customer: core_1.Flags.string({
65
- char: "c",
66
- required: true,
67
- description: "ID of customer to deploy to",
68
- }),
69
- description: core_1.Flags.string({
70
- required: false,
71
- char: "d",
72
- description: "longer description of the instance",
73
- }),
74
- "config-vars": core_1.Flags.string({
75
- required: false,
76
- char: "v",
77
- description: "config variables to bind to steps of your instance",
78
- }),
79
- label: core_1.Flags.string({
80
- char: "l",
81
- description: "a label or set of labels to apply to the instance",
82
- multiple: true,
83
- }),
84
- };
@@ -1,35 +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 DeleteCommand extends core_1.Command {
6
- async run() {
7
- const { args: { instance }, } = await this.parse(DeleteCommand);
8
- await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation deleteInstance($id: ID!) {
11
- deleteInstance(input: { id: $id }) {
12
- instance {
13
- id
14
- }
15
- errors {
16
- field
17
- messages
18
- }
19
- }
20
- }
21
- `,
22
- variables: {
23
- id: instance,
24
- },
25
- });
26
- }
27
- }
28
- exports.default = DeleteCommand;
29
- DeleteCommand.description = "Delete an Instance";
30
- DeleteCommand.args = {
31
- instance: core_1.Args.string({
32
- required: true,
33
- description: "ID of the instance to delete",
34
- }),
35
- };
@@ -1,43 +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 DeployCommand extends core_1.Command {
6
- async run() {
7
- const { args: { instance }, flags: { force }, } = await this.parse(DeployCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation deployInstance($id: ID!, $force: Boolean) {
11
- deployInstance(input: { id: $id, force: $force }) {
12
- instance {
13
- id
14
- }
15
- errors {
16
- field
17
- messages
18
- }
19
- }
20
- }
21
- `,
22
- variables: {
23
- id: instance,
24
- force,
25
- },
26
- });
27
- this.log(result.deployInstance.instance.id);
28
- }
29
- }
30
- exports.default = DeployCommand;
31
- DeployCommand.description = "Deploy an Instance";
32
- DeployCommand.args = {
33
- instance: core_1.Args.string({
34
- required: true,
35
- description: "ID of an instance",
36
- }),
37
- };
38
- DeployCommand.flags = {
39
- force: core_1.Flags.boolean({
40
- char: "f",
41
- description: "Force deployment even when there are certain conditions that would normally prevent it",
42
- }),
43
- };
@@ -1,36 +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 DisableCommand extends core_1.Command {
6
- async run() {
7
- const { args: { instance }, } = await this.parse(DisableCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation disableInstance($id: ID!) {
11
- updateInstance(input: { id: $id, enabled: false }) {
12
- instance {
13
- id
14
- }
15
- errors {
16
- field
17
- messages
18
- }
19
- }
20
- }
21
- `,
22
- variables: {
23
- id: instance,
24
- },
25
- });
26
- this.log(result.updateInstance.instance.id);
27
- }
28
- }
29
- exports.default = DisableCommand;
30
- DisableCommand.description = "Disable an Instance";
31
- DisableCommand.args = {
32
- instance: core_1.Args.string({
33
- required: true,
34
- description: "ID of an instance",
35
- }),
36
- };
@@ -1,36 +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 EnableCommand extends core_1.Command {
6
- async run() {
7
- const { args: { instance }, } = await this.parse(EnableCommand);
8
- const result = await (0, graphql_1.gqlRequest)({
9
- document: (0, graphql_1.gql) `
10
- mutation enableInstance($id: ID!) {
11
- updateInstance(input: { id: $id, enabled: true }) {
12
- instance {
13
- id
14
- }
15
- errors {
16
- field
17
- messages
18
- }
19
- }
20
- }
21
- `,
22
- variables: {
23
- id: instance,
24
- },
25
- });
26
- this.log(result.updateInstance.instance.id);
27
- }
28
- }
29
- exports.default = EnableCommand;
30
- EnableCommand.description = "Enable an Instance";
31
- EnableCommand.args = {
32
- instance: core_1.Args.string({
33
- required: true,
34
- description: "ID of an instance",
35
- }),
36
- };
@@ -1,62 +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 { args: { instance }, flags, } = await this.parse(ListCommand);
8
- let flowConfigs = [];
9
- let hasNextPage = true;
10
- let cursor = "";
11
- while (hasNextPage) {
12
- const { instance: { flowConfigs: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
13
- document: (0, graphql_1.gql) `
14
- query listInstanceFlowConfigs($id: ID!, $after: String) {
15
- instance(id: $id) {
16
- flowConfigs(after: $after) {
17
- nodes {
18
- id
19
- flow {
20
- name
21
- }
22
- webhookUrl
23
- }
24
- pageInfo {
25
- hasNextPage
26
- endCursor
27
- }
28
- }
29
- }
30
- }
31
- `,
32
- variables: {
33
- id: instance,
34
- after: cursor,
35
- },
36
- });
37
- flowConfigs = [...flowConfigs, ...nodes];
38
- cursor = pageInfo.endCursor;
39
- hasNextPage = pageInfo.hasNextPage;
40
- }
41
- core_1.ux.table(flowConfigs, {
42
- id: {
43
- minWidth: 8,
44
- extended: true,
45
- },
46
- name: {
47
- get: (row) => row.flow.name,
48
- },
49
- webhookUrl: {
50
- extended: true,
51
- },
52
- }, { ...flags });
53
- }
54
- }
55
- exports.default = ListCommand;
56
- ListCommand.description = "List Instance Flow Configs";
57
- ListCommand.args = {
58
- instance: core_1.Args.string({ description: "ID of an Instance", required: true }),
59
- };
60
- ListCommand.flags = {
61
- ...core_1.ux.table.flags(),
62
- };