great 0.3.2 → 1.0.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.
Files changed (185) hide show
  1. package/README.md +119 -13
  2. package/dist/accounts/create.d.ts +4 -0
  3. package/dist/accounts/create.js +42 -0
  4. package/dist/accounts/create.js.map +1 -0
  5. package/dist/accounts/index.d.ts +5 -2
  6. package/dist/accounts/index.js +48 -9
  7. package/dist/accounts/index.js.map +1 -1
  8. package/dist/clone/index.d.ts +8 -0
  9. package/dist/clone/index.js +61 -0
  10. package/dist/clone/index.js.map +1 -0
  11. package/dist/config/index.d.ts +8 -0
  12. package/dist/config/index.js +111 -0
  13. package/dist/config/index.js.map +1 -0
  14. package/dist/create/index.d.ts +3 -0
  15. package/dist/create/index.js +7 -0
  16. package/dist/create/index.js.map +1 -0
  17. package/dist/deploy/index.d.ts +11 -0
  18. package/dist/deploy/index.js +132 -0
  19. package/dist/deploy/index.js.map +1 -0
  20. package/dist/explode/index.d.ts +5 -0
  21. package/dist/explode/index.js +32 -0
  22. package/dist/explode/index.js.map +1 -0
  23. package/dist/explode/transform.d.ts +30 -0
  24. package/dist/explode/transform.js +100 -0
  25. package/dist/explode/transform.js.map +1 -0
  26. package/dist/explode/unescapeMongo.d.ts +1 -0
  27. package/dist/explode/unescapeMongo.js +15 -0
  28. package/dist/explode/unescapeMongo.js.map +1 -0
  29. package/dist/generated/graphql.d.ts +1784 -0
  30. package/dist/generated/graphql.js +73 -0
  31. package/dist/generated/graphql.js.map +1 -0
  32. package/dist/index.js +29 -4
  33. package/dist/index.js.map +1 -1
  34. package/dist/init/index.d.ts +5 -0
  35. package/dist/init/index.js +46 -0
  36. package/dist/init/index.js.map +1 -0
  37. package/dist/integrations/create.d.ts +6 -0
  38. package/dist/integrations/create.js +70 -0
  39. package/dist/integrations/create.js.map +1 -0
  40. package/dist/{projects/describe.d.ts → integrations/index.d.ts} +0 -1
  41. package/dist/integrations/index.js +23 -0
  42. package/dist/integrations/index.js.map +1 -0
  43. package/dist/integrations/list.d.ts +7 -0
  44. package/dist/integrations/list.js +103 -0
  45. package/dist/integrations/list.js.map +1 -0
  46. package/dist/login/index.d.ts +6 -0
  47. package/dist/login/index.js +25 -0
  48. package/dist/login/index.js.map +1 -0
  49. package/dist/logout/index.d.ts +6 -0
  50. package/dist/logout/index.js +11 -0
  51. package/dist/logout/index.js.map +1 -0
  52. package/dist/now/index.d.ts +3 -1
  53. package/dist/now/index.js +11 -2
  54. package/dist/now/index.js.map +1 -1
  55. package/dist/pull/index.d.ts +5 -1
  56. package/dist/pull/index.js +50 -19
  57. package/dist/pull/index.js.map +1 -1
  58. package/dist/push/index.d.ts +11 -0
  59. package/dist/push/index.js +481 -0
  60. package/dist/push/index.js.map +1 -0
  61. package/dist/repl/dispatch.d.ts +8 -0
  62. package/dist/repl/dispatch.js +75 -0
  63. package/dist/repl/dispatch.js.map +1 -0
  64. package/dist/repl/help.d.ts +2 -0
  65. package/dist/repl/help.js +14 -0
  66. package/dist/repl/help.js.map +1 -0
  67. package/dist/repl/index.d.ts +10 -0
  68. package/dist/repl/index.js +92 -0
  69. package/dist/repl/index.js.map +1 -0
  70. package/dist/run/index.d.ts +33 -1
  71. package/dist/run/index.js +109 -40
  72. package/dist/run/index.js.map +1 -1
  73. package/dist/status/index.d.ts +10 -0
  74. package/dist/status/index.js +122 -0
  75. package/dist/status/index.js.map +1 -0
  76. package/dist/types.d.ts +1 -0
  77. package/dist/types.js +2 -0
  78. package/dist/types.js.map +1 -0
  79. package/dist/utils/authServer.d.ts +4 -0
  80. package/dist/utils/authServer.js +49 -0
  81. package/dist/utils/authServer.js.map +1 -0
  82. package/dist/utils/config.d.ts +15 -0
  83. package/dist/utils/config.js +41 -0
  84. package/dist/utils/config.js.map +1 -0
  85. package/dist/utils/createIntegrationFromFile.d.ts +22 -0
  86. package/dist/utils/createIntegrationFromFile.js +116 -0
  87. package/dist/utils/createIntegrationFromFile.js.map +1 -0
  88. package/dist/utils/determineNameAndKey.d.ts +4 -0
  89. package/dist/utils/determineNameAndKey.js +8 -0
  90. package/dist/utils/determineNameAndKey.js.map +1 -0
  91. package/dist/utils/dispatch.d.ts +3 -0
  92. package/dist/utils/dispatch.js +37 -0
  93. package/dist/utils/dispatch.js.map +1 -0
  94. package/dist/utils/fetchLocal.d.ts +3 -0
  95. package/dist/utils/fetchLocal.js +21 -0
  96. package/dist/utils/fetchLocal.js.map +1 -0
  97. package/dist/utils/fetchSession.d.ts +7 -0
  98. package/dist/utils/fetchSession.js +34 -0
  99. package/dist/utils/fetchSession.js.map +1 -0
  100. package/dist/utils/graphqlClient.d.ts +10 -0
  101. package/dist/utils/graphqlClient.js +24 -0
  102. package/dist/utils/graphqlClient.js.map +1 -0
  103. package/dist/utils/graphqlError.d.ts +2 -0
  104. package/dist/utils/graphqlError.js +20 -0
  105. package/dist/utils/graphqlError.js.map +1 -0
  106. package/dist/utils/hashContent.d.ts +1 -0
  107. package/dist/utils/hashContent.js +7 -0
  108. package/dist/utils/hashContent.js.map +1 -0
  109. package/dist/utils/jwt.d.ts +6 -0
  110. package/dist/utils/jwt.js +24 -0
  111. package/dist/utils/jwt.js.map +1 -0
  112. package/dist/utils/promptForValue.d.ts +9 -0
  113. package/dist/utils/promptForValue.js +24 -0
  114. package/dist/utils/promptForValue.js.map +1 -0
  115. package/dist/utils/resolveAccount.d.ts +19 -0
  116. package/dist/utils/resolveAccount.js +75 -0
  117. package/dist/utils/resolveAccount.js.map +1 -0
  118. package/dist/utils/resolveElement.d.ts +20 -0
  119. package/dist/utils/resolveElement.js +67 -0
  120. package/dist/utils/resolveElement.js.map +1 -0
  121. package/dist/utils/resolveIntegration.d.ts +9 -0
  122. package/dist/utils/resolveIntegration.js +71 -0
  123. package/dist/utils/resolveIntegration.js.map +1 -0
  124. package/dist/utils/saveIntegration.d.ts +16 -0
  125. package/dist/utils/saveIntegration.js +117 -0
  126. package/dist/utils/saveIntegration.js.map +1 -0
  127. package/dist/utils/token.d.ts +6 -0
  128. package/dist/utils/token.js +31 -0
  129. package/dist/utils/token.js.map +1 -0
  130. package/dist/utils/valueTypes.d.ts +4 -0
  131. package/dist/utils/valueTypes.js +43 -0
  132. package/dist/utils/valueTypes.js.map +1 -0
  133. package/dist/value/get.d.ts +8 -0
  134. package/dist/value/get.js +50 -0
  135. package/dist/value/get.js.map +1 -0
  136. package/dist/{projects → value}/index.d.ts +1 -2
  137. package/dist/value/index.js +26 -0
  138. package/dist/value/index.js.map +1 -0
  139. package/dist/value/list.d.ts +8 -0
  140. package/dist/value/list.js +122 -0
  141. package/dist/value/list.js.map +1 -0
  142. package/dist/value/set.d.ts +12 -0
  143. package/dist/value/set.js +103 -0
  144. package/dist/value/set.js.map +1 -0
  145. package/dist/whoami/fetchSession.d.ts +9 -0
  146. package/dist/whoami/fetchSession.js +19 -0
  147. package/dist/whoami/fetchSession.js.map +1 -0
  148. package/dist/whoami/index.d.ts +9 -1
  149. package/dist/whoami/index.js +18 -10
  150. package/dist/whoami/index.js.map +1 -1
  151. package/package.json +30 -13
  152. package/.codeclimate.yml +0 -7
  153. package/.editorconfig +0 -11
  154. package/.nvmrc +0 -1
  155. package/.prettierrc.json +0 -6
  156. package/dist/now/index.test.d.ts +0 -1
  157. package/dist/now/index.test.js +0 -18
  158. package/dist/now/index.test.js.map +0 -1
  159. package/dist/projects/describe.js +0 -44
  160. package/dist/projects/describe.js.map +0 -1
  161. package/dist/projects/index.js +0 -39
  162. package/dist/projects/index.js.map +0 -1
  163. package/dist/utils/callApi.d.ts +0 -5
  164. package/dist/utils/callApi.js +0 -20
  165. package/dist/utils/callApi.js.map +0 -1
  166. package/dist/utils/fetchLocalProject.d.ts +0 -1
  167. package/dist/utils/fetchLocalProject.js +0 -12
  168. package/dist/utils/fetchLocalProject.js.map +0 -1
  169. package/dist/utils/saveProject.d.ts +0 -2
  170. package/dist/utils/saveProject.js +0 -68
  171. package/dist/utils/saveProject.js.map +0 -1
  172. package/eslint.config.js +0 -27
  173. package/src/accounts/index.ts +0 -41
  174. package/src/index.ts +0 -22
  175. package/src/now/index.test.ts +0 -31
  176. package/src/now/index.ts +0 -15
  177. package/src/projects/describe.ts +0 -80
  178. package/src/projects/index.ts +0 -61
  179. package/src/pull/index.ts +0 -45
  180. package/src/run/index.ts +0 -81
  181. package/src/utils/callApi.ts +0 -29
  182. package/src/utils/fetchLocalProject.ts +0 -12
  183. package/src/utils/saveProject.ts +0 -106
  184. package/src/whoami/index.ts +0 -32
  185. package/tsconfig.json +0 -28
package/README.md CHANGED
@@ -2,21 +2,127 @@
2
2
 
3
3
  A command line interface for [Integreat](https://github.com/integreat-io/integreat).
4
4
 
5
- ## Usage
5
+ ## Installation
6
+
7
+ Requires Node.js 22 or later.
6
8
 
7
9
  Install with `npm i great --global`
8
10
 
11
+ ## Authentication
12
+
13
+ Before using most commands, you need to authenticate:
14
+
15
+ ```bash
16
+ great login
17
+ ```
18
+
19
+ This will open your browser to authenticate with GitHub or Google. The
20
+ authentication token is stored locally and will be used for subsequent commands.
21
+
22
+ To log out:
23
+
24
+ ```bash
25
+ great logout
26
+ ```
27
+
9
28
  ## Commands
10
29
 
11
- - `great now` - Prints the current Unix timestamp
12
- - `great whoami` - Displays your Integreat user
13
- - `great account list` - Display list of accounts
14
- - `great projects list` - Display list of projects. Specify an account id as the
15
- first argument to only fetch for that account.
16
- - `great projects describe` - Display details for a project. Specify project id
17
- as the first argument.
18
- - `great pull` - Pull a project config to local file structure. Specify a projec
19
- id as the first argument or pull for the project in the current folder
20
- - `great run` - Run a job for a project. The project id should either be given
21
- as the first argument or it will be picked from the current folder. You will
22
- be presented with a list of available jobs to select from.
30
+ ### Authentication
31
+ - `great login`: Log in to Integreat via browser authentication.
32
+ - `great logout`: Log out and remove stored authentication token.
33
+ - `great whoami`: Displays your Integreat user.
34
+
35
+ ### Account Management
36
+ - `great accounts` or `great accounts list`: Display list of accounts (default
37
+ action).
38
+ - `great accounts create <name>`: Create a new account.
39
+
40
+ ### Integration Management
41
+ - `great integrations` or `great integrations list`: Display list of
42
+ integrations. Use `-a <id-or-key>` to filter by account ID or key, or `--all`
43
+ to list all integrations ignoring default account.
44
+ - `great integrations create <name>`: Create a new integration on the Integreat
45
+ server. Requires `-a <account-id-or-key>` flag. Returns integration ID to add
46
+ to local `integration.json` for linking with workspace.
47
+
48
+ ### Local Workspace
49
+ - `great init [name]`: Initialize a new integration workspace locally. Creates
50
+ `integration.json` and folder structure without creating anything on the
51
+ server. If name is omitted, uses the current directory name.
52
+ - `great clone <integration>`: Clone an integration to a new folder. Creates a
53
+ new directory with the integration key (or ID) and downloads all integration
54
+ files.
55
+ - `great pull`: Pull remote changes to the current integration folder. Must be
56
+ run from a folder with an `integration.json` file.
57
+ - `great push`: Push local changes to Integreat. Must be run from a folder with
58
+ an `integration.json` file.
59
+ ### Deployment & Runtime
60
+ - `great deploy [integration]`: Create a version and start the integration.
61
+ Specify an integration ID or key (with `-a <account-id-or-key>` flag) as the
62
+ first argument, or run from a folder with `integration.json`. Use `-n <name>`
63
+ to specify a custom version name.
64
+ - `great run [integration]`: Run a job or flow interactively. Specify an
65
+ integration ID or key as the first argument, or run from a folder with
66
+ `integration.json`. Use `-a <account-id-or-key>` flag when needed.
67
+ - `great status [integration]`: Show integration status and active version.
68
+ Specify an integration ID or key (with `-a <account-id-or-key>` flag) as the
69
+ first argument, or run from a folder with `integration.json`.
70
+ - `great repl [integration]`: Start a Node.js REPL session with access to
71
+ integration dispatch functions. Use integration ID or key with `-a
72
+ <account-id-or-key>` flag. Use `help()` in the REPL to see available
73
+ functions.
74
+
75
+ ### Value Management
76
+ - `great value list`: List all value elements in an integration. Use `-i
77
+ <integration-id-or-key>` flag or run from a folder with `integration.json`.
78
+ - `great value get <element>`: Get the value of a value element. The `<element>`
79
+ can be either an element ID or key. When using an element key, provide
80
+ integration context via `-i <integration-id-or-key>` flag or run from a folder
81
+ with `integration.json`.
82
+ - `great value set <element> <value>`: Set the value of a value element. The
83
+ `<element>` can be either an element ID or key. When using an element key, you
84
+ must provide integration context via `-i <integration-id-or-key>` flag or run
85
+ from a folder with `integration.json`. Use `-a <account-id-or-key>` flag when
86
+ integration is specified by key (or rely on default account from config). The
87
+ value will be automatically cast to the appropriate type (string, number,
88
+ boolean, date, or secret) based on the element's type definition.
89
+
90
+ ### Utilities
91
+ - `great explode <file>`: Convert legacy integration JSON to new file structure.
92
+ Specify the path to a legacy JSON file as the first argument.
93
+ - `great now`: Prints the current Unix timestamp.
94
+
95
+ ## Typical Workflow
96
+
97
+ For new integrations:
98
+ 1. **Initialize local workspace**: `great init "My Integration"`
99
+ 2. **Create element files** (schemas, services, etc.) in their respective folders
100
+ 3. **Push local files to server**: `great push`
101
+ 4. **Deploy**: `great deploy`
102
+
103
+ For existing integrations:
104
+ - **Clone to local**: `great clone <integration-id>`
105
+ - **Make local changes** to element files
106
+ - **Push changes**: `great push`
107
+ - **Deploy**: `great deploy`
108
+
109
+ Setting values:
110
+ - **From integration directory**: `great value set apiKey "my-secret-value"`
111
+ - **With integration flag**: `great value set apiKey "my-secret" -i my-integration`
112
+ - **By element ID**: `great value set val-123 "my-value"`
113
+
114
+ ## Development and testing
115
+
116
+ The following environment variables are useful for development and testing:
117
+
118
+ - `INTEGREAT_APP_URL`: Override the web app URL (default:
119
+ `https://app.integreat.io`).
120
+ - `INTEGREAT_API_URL`: Override the API URL (default:
121
+ `https://api.integreat.io`).
122
+ - `GREAT_TOKEN`: Manually provide a JWT token (bypasses stored token).
123
+
124
+
125
+ ```bash
126
+ # Test with local app and API
127
+ INTEGREAT_APP_URL=http://localhost:3000 INTEGREAT_API_URL=http://localhost:3001 great login
128
+ ```
@@ -0,0 +1,4 @@
1
+ import Conf from 'conf';
2
+ import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
3
+ import { type ConfigSchema } from '../utils/config.js';
4
+ export default function createAccount(log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, config?: Conf<ConfigSchema>): (accountName?: string) => Promise<void>;
@@ -0,0 +1,42 @@
1
+ import chalk from 'chalk';
2
+ import { createGraphQLClient, } from '../utils/graphqlClient.js';
3
+ import { handleGraphQLError } from '../utils/graphqlError.js';
4
+ import { getApiBaseUrl } from '../utils/config.js';
5
+ import { gql } from 'graphql-tag';
6
+ import determineNameAndKey from '../utils/determineNameAndKey.js';
7
+ const CreateAccountMutationDocument = gql `
8
+ mutation CreateAccount($name: String!, $key: ID) {
9
+ createAccount(name: $name, key: $key) {
10
+ id
11
+ key
12
+ name
13
+ createdAt
14
+ }
15
+ }
16
+ `;
17
+ export default function createAccount(log, apiToken, client, config) {
18
+ return async function account(accountName) {
19
+ if (!accountName) {
20
+ log(chalk.red('Account name is required'));
21
+ return;
22
+ }
23
+ const { name, key } = determineNameAndKey(accountName);
24
+ const apiBaseUrl = getApiBaseUrl(config);
25
+ const graphqlClient = client ?? createGraphQLClient(apiToken, apiBaseUrl);
26
+ const result = await graphqlClient.request(CreateAccountMutationDocument, {
27
+ name,
28
+ key,
29
+ });
30
+ if (result.error) {
31
+ handleGraphQLError(result.error, log);
32
+ return;
33
+ }
34
+ const account = result.data?.createAccount;
35
+ if (!account) {
36
+ log(chalk.red('Failed to create account'));
37
+ return;
38
+ }
39
+ log(chalk.cyan(`Account '${account.name}' created with id: ${account.id}`));
40
+ };
41
+ }
42
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/accounts/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EACL,mBAAmB,GAEpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AAGjE,MAAM,6BAA6B,GAAG,GAAG,CAAA;;;;;;;;;CASxC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,GAA8B,EAC9B,QAAiB,EACjB,MAA6B,EAC7B,MAA2B;IAE3B,OAAO,KAAK,UAAU,OAAO,CAAC,WAAoB;QAEhD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAA;YAC1C,OAAM;QACR,CAAC;QAGD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAA;QAGtD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;QACxC,MAAM,aAAa,GAAG,MAAM,IAAI,mBAAmB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;QACzE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CACxC,6BAA6B,EAC7B;YACE,IAAI;YACJ,GAAG;SACJ,CACF,CAAA;QAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;YACrC,OAAM;QACR,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,aAAa,CAAA;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAA;YAC1C,OAAM;QACR,CAAC;QAGD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,IAAI,sBAAsB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IAC7E,CAAC,CAAA;AACH,CAAC"}
@@ -1,4 +1,7 @@
1
+ import Conf from 'conf';
2
+ import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
3
+ import { type ConfigSchema } from '../utils/config.js';
1
4
  import type { Command } from 'commander';
2
- export declare const action: (log: (message: string) => void, apiToken?: string) => () => Promise<void>;
3
- declare const _default: (program: Command, apiToken?: string) => void;
5
+ export declare const action: (log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, config?: Conf<ConfigSchema>) => () => Promise<void>;
6
+ declare const _default: (program: Command, apiToken?: string) => Command;
4
7
  export default _default;
@@ -1,28 +1,67 @@
1
1
  import chalk from 'chalk';
2
2
  import columnify from 'columnify';
3
- import callApi from '../utils/callApi.js';
4
- export const action = (log, apiToken) => async function accountsList() {
5
- const response = await callApi('https://api.integreat.io/accounts', apiToken);
6
- if (response.error) {
7
- log(chalk.red(response.error));
3
+ import { createGraphQLClient, } from '../utils/graphqlClient.js';
4
+ import { handleGraphQLError } from '../utils/graphqlError.js';
5
+ import { getApiBaseUrl } from '../utils/config.js';
6
+ import { gql } from 'graphql-tag';
7
+ import createAccountAction from './create.js';
8
+ const AccountsQueryDocument = gql `
9
+ query Accounts {
10
+ accounts {
11
+ totalCount
12
+ nodes {
13
+ id
14
+ name
15
+ key
16
+ }
17
+ }
18
+ }
19
+ `;
20
+ export const action = (log, apiToken, client, config) => async function accountsList() {
21
+ const apiBaseUrl = getApiBaseUrl(config);
22
+ const graphqlClient = client ?? createGraphQLClient(apiToken, apiBaseUrl);
23
+ const result = await graphqlClient.request(AccountsQueryDocument, {});
24
+ if (result.error) {
25
+ handleGraphQLError(result.error, log);
8
26
  return;
9
27
  }
10
- const accounts = response.accounts;
28
+ const accounts = result.data?.accounts?.nodes;
29
+ const count = result.data?.accounts?.totalCount;
11
30
  if (Array.isArray(accounts) && accounts.length > 0) {
12
- log(columnify(accounts, { columns: ['id', 'name'] }));
31
+ log(columnify(accounts, {
32
+ columns: ['name', 'key', 'id'],
33
+ columnSplitter: ' ',
34
+ config: {
35
+ name: {
36
+ dataTransform: (data) => chalk.cyan(data),
37
+ },
38
+ id: {
39
+ dataTransform: (data) => chalk.grey(data),
40
+ headingTransform: (heading) => chalk.grey(heading.toUpperCase()),
41
+ },
42
+ },
43
+ }));
44
+ if (count) {
45
+ log(`\n${count} ${count === 1 ? 'account' : 'accounts'}`);
46
+ }
13
47
  }
14
48
  else {
15
49
  log(chalk.white('No accounts.'));
16
50
  }
17
51
  };
18
52
  export default (program, apiToken) => {
19
- const projects = program
53
+ const accounts = program
20
54
  .command('accounts')
21
55
  .description('commands for accounts, run `great accounts --help` to see options. `great accounts` is also a shortcut for `great accounts list`')
22
56
  .action(action(console.log, apiToken));
23
- projects
57
+ accounts
24
58
  .command('list')
25
59
  .description('list all accounts you have access to')
26
60
  .action(action(console.log, apiToken));
61
+ accounts
62
+ .command('create <name>')
63
+ .description('create a new account')
64
+ .action(createAccountAction(console.log, apiToken));
65
+ return accounts;
27
66
  };
28
67
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,OAA0B,MAAM,qBAAqB,CAAA;AAO5D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAA8B,EAAE,QAAiB,EAAE,EAAE,CAC1E,KAAK,UAAU,YAAY;IACzB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAC5B,mCAAmC,EACnC,QAAQ,CACT,CAAA;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;QAC9B,OAAM;IACR,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAA;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;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CAAC,OAAgB,EAAE,QAAiB,EAAE,EAAE;IACrD,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CACV,kIAAkI,CACnI;SACA,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA;IAExC,QAAQ;SACL,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA;IAExC,QAAQ;SACL,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,sBAAsB,CAAC;SACnC,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA;IAErD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import fs from 'node:fs';
2
+ import Conf from 'conf';
3
+ import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
4
+ import { type ConfigSchema } from '../utils/config.js';
5
+ import type { Command } from 'commander';
6
+ export declare const action: (log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, fsImpl?: typeof fs, config?: Conf<ConfigSchema>) => (integrationId: string) => Promise<void>;
7
+ declare const _default: (program: Command, apiToken?: string) => Command;
8
+ export default _default;
@@ -0,0 +1,61 @@
1
+ import chalk from 'chalk';
2
+ import saveIntegration from '../utils/saveIntegration.js';
3
+ import { createGraphQLClient, } from '../utils/graphqlClient.js';
4
+ import { handleGraphQLError } from '../utils/graphqlError.js';
5
+ import { getApiBaseUrl } from '../utils/config.js';
6
+ import { gql } from 'graphql-tag';
7
+ const IntegrationDefinitionQueryDocument = gql `
8
+ query IntegrationDefinition($id: ID!) {
9
+ integration(id: $id) {
10
+ id
11
+ key
12
+ name
13
+ description
14
+ status
15
+ account {
16
+ id
17
+ key
18
+ name
19
+ }
20
+ latest {
21
+ timestamp
22
+ elements {
23
+ id
24
+ key
25
+ name
26
+ __typename
27
+ content {
28
+ timestamp
29
+ data
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ `;
36
+ export const action = (log, apiToken, client, fsImpl, config) => async function cloneIntegration(integrationId) {
37
+ if (!integrationId) {
38
+ log(chalk.red('Integration ID is required'));
39
+ log(`Usage: ${chalk.bold('great clone <integration-id>')}`);
40
+ return;
41
+ }
42
+ const apiBaseUrl = getApiBaseUrl(config);
43
+ const graphqlClient = client ?? createGraphQLClient(apiToken, apiBaseUrl);
44
+ const result = await graphqlClient.request(IntegrationDefinitionQueryDocument, { id: integrationId });
45
+ if (result.error) {
46
+ handleGraphQLError(result.error, log);
47
+ return;
48
+ }
49
+ const integration = result.data?.integration;
50
+ if (!integration || !integration.latest) {
51
+ log(chalk.red('Integration has no latest version'));
52
+ return;
53
+ }
54
+ const root = integration.key ?? integration.id;
55
+ saveIntegration(integration, integration.latest, root, fsImpl);
56
+ };
57
+ export default (program, apiToken) => program
58
+ .command('clone <integration>')
59
+ .description('clone an integration to a new folder')
60
+ .action(action(console.log, apiToken));
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clone/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,EACL,mBAAmB,GAEpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAA;AAGrE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,kCAAkC,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B7C,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,GAA8B,EAC9B,QA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OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { Command } from 'commander';
2
+ import Conf from 'conf';
3
+ import { type ConfigSchema } from '../utils/config.js';
4
+ export declare const setAction: (log: (message: string) => void, config?: Conf<ConfigSchema>) => (key: string, value: string) => void;
5
+ export declare const unsetAction: (log: (message: string) => void, config?: Conf<ConfigSchema>) => (key: string) => void;
6
+ export declare const listAction: (log: (message: string) => void, config?: Conf<ConfigSchema>) => () => void;
7
+ declare const _default: (program: Command) => Command;
8
+ export default _default;
@@ -0,0 +1,111 @@
1
+ import chalk from 'chalk';
2
+ import columnify from 'columnify';
3
+ import { getAllConfig, getApiBaseUrl, getAppBaseUrl, setConfigValue, deleteConfigValue, } from '../utils/config.js';
4
+ const keyMap = {
5
+ 'api-url': 'apiUrl',
6
+ 'app-url': 'appUrl',
7
+ account: 'account',
8
+ };
9
+ const validKeys = Object.keys(keyMap);
10
+ function isValidUrl(url) {
11
+ try {
12
+ new URL(url);
13
+ return true;
14
+ }
15
+ catch {
16
+ return false;
17
+ }
18
+ }
19
+ export const setAction = (log, config) => (key, value) => {
20
+ if (!validKeys.includes(key)) {
21
+ log(chalk.red(`Invalid config key: ${key}. Valid keys are: ${validKeys.join(', ')}`));
22
+ return;
23
+ }
24
+ if ((key === 'api-url' || key === 'app-url') && !isValidUrl(value)) {
25
+ log(chalk.red(`Invalid URL format: ${value}`));
26
+ return;
27
+ }
28
+ const configKey = keyMap[key];
29
+ setConfigValue(configKey, value, config);
30
+ if (key === 'account') {
31
+ log(chalk.green(`✓ Default account set to: ${value}`));
32
+ }
33
+ else {
34
+ log(chalk.white(`✓ Set ${key} to ${value}`));
35
+ }
36
+ };
37
+ export const unsetAction = (log, config) => (key) => {
38
+ if (!validKeys.includes(key)) {
39
+ log(chalk.red(`Invalid config key: ${key}. Valid keys are: ${validKeys.join(', ')}`));
40
+ return;
41
+ }
42
+ const configKey = keyMap[key];
43
+ deleteConfigValue(configKey, config);
44
+ if (key === 'account') {
45
+ log(chalk.green(`✓ Default account cleared`));
46
+ }
47
+ else {
48
+ log(chalk.white(`✓ Unset ${key}`));
49
+ }
50
+ };
51
+ export const listAction = (log, config) => () => {
52
+ const configData = getAllConfig(config);
53
+ const apiSource = configData.apiUrl
54
+ ? 'From config'
55
+ : process.env.INTEGREAT_API_URL
56
+ ? 'From INTEGREAT_API_URL env var'
57
+ : 'Default';
58
+ const appSource = configData.appUrl
59
+ ? 'From config'
60
+ : process.env.INTEGREAT_APP_URL
61
+ ? 'From INTEGREAT_APP_URL env var'
62
+ : 'Default';
63
+ const isLoggedIn = !!configData.token;
64
+ const configItems = [
65
+ { key: 'api-url', value: getApiBaseUrl(config), source: apiSource },
66
+ { key: 'app-url', value: getAppBaseUrl(config), source: appSource },
67
+ { key: 'Logged in', value: isLoggedIn ? 'Yes' : 'No', source: '' },
68
+ ];
69
+ if (configData.account) {
70
+ configItems.push({
71
+ key: 'account',
72
+ value: configData.account,
73
+ source: 'From config',
74
+ });
75
+ }
76
+ log(columnify(configItems, {
77
+ columns: ['key', 'value', 'source'],
78
+ columnSplitter: ' ',
79
+ config: {
80
+ key: {
81
+ dataTransform: (data) => chalk.cyan(data),
82
+ },
83
+ value: {
84
+ dataTransform: (data) => data === 'Yes' ? chalk.green(data) : chalk.white(data),
85
+ },
86
+ source: {
87
+ dataTransform: (data) => chalk.grey(data),
88
+ headingTransform: (heading) => chalk.grey(heading.toUpperCase()),
89
+ },
90
+ },
91
+ }));
92
+ };
93
+ export default (program) => {
94
+ const configCommand = program
95
+ .command('config')
96
+ .description('manage configuration');
97
+ configCommand
98
+ .command('set <key> <value>')
99
+ .description('set a configuration value (api-url, app-url, or account)')
100
+ .action(setAction(console.log));
101
+ configCommand
102
+ .command('unset <key>')
103
+ .description('unset a configuration value (api-url, app-url, or account)')
104
+ .action(unsetAction(console.log));
105
+ configCommand
106
+ .command('list')
107
+ .description('list current configuration')
108
+ .action(listAction(console.log));
109
+ return program;
110
+ };
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,WAAW,CAAA;AAGjC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,GAElB,MAAM,oBAAoB,CAAA;AAG3B,MAAM,MAAM,GAAuC;IACjD,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAGrC,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GACpB,CAAC,GAA8B,EAAE,MAA2B,EAAE,EAAE,CAChE,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE;IAC7B,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,GAAG,CACD,KAAK,CAAC,GAAG,CACP,uBAAuB,GAAG,qBAAqB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtE,CACF,CAAA;QACD,OAAM;IACR,CAAC;IAGD,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC,CAAA;QAC9C,OAAM;IACR,CAAC;IAGD,MAAM,SAAS,GAAG,MAAM,CAAC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AC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;aACzD;YACD,MAAM,EAAE;gBACN,aAAa,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;gBACjD,gBAAgB,EAAE,CAAC,OAAe,EAAE,EAAE,CACpC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;aACpC;SACF;KACF,CAAC,CACH,CAAA;AACH,CAAC,CAAA;AAEH,eAAe,CAAC,OAAgB,EAAE,EAAE;IAClC,MAAM,aAAa,GAAG,OAAO;SAC1B,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,sBAAsB,CAAC,CAAA;IAEtC,aAAa;SACV,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,0DAA0D,CAAC;SACvE,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAEjC,aAAa;SACV,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,4DAA4D,CAAC;SACzE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAEnC,aAAa;SACV,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4BAA4B,CAAC;SACzC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAElC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ declare const _default: (program: Command, _apiToken?: string) => Command;
3
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export default (program, _apiToken) => {
2
+ const create = program
3
+ .command('create')
4
+ .description('Create local integration elements');
5
+ return create;
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/create/index.ts"],"names":[],"mappings":"AAEA,eAAe,CAAC,OAAgB,EAAE,SAAkB,EAAE,EAAE;IACtD,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,mCAAmC,CAAC,CAAA;IAQnD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import fs from 'node:fs';
2
+ import Conf from 'conf';
3
+ import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
4
+ import { type ConfigSchema } from '../utils/config.js';
5
+ import type { Command } from 'commander';
6
+ export declare const action: (log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, fsImpl?: typeof fs, config?: Conf<ConfigSchema>) => (integrationIdOrKey?: string, options?: {
7
+ account?: string;
8
+ name?: string;
9
+ }) => Promise<void>;
10
+ declare const _default: (program: Command, apiToken?: string) => Command;
11
+ export default _default;