great 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -43
- package/dist/accounts/create.d.ts +1 -1
- package/dist/accounts/create.js +2 -4
- package/dist/accounts/create.js.map +1 -1
- package/dist/accounts/index.d.ts +1 -1
- package/dist/accounts/index.js +2 -4
- package/dist/accounts/index.js.map +1 -1
- package/dist/clone/index.d.ts +4 -2
- package/dist/clone/index.js +19 -43
- package/dist/clone/index.js.map +1 -1
- package/dist/config/index.js +4 -30
- package/dist/config/index.js.map +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.js +54 -14
- package/dist/deploy/index.js.map +1 -1
- package/dist/env/index.d.ts +12 -0
- package/dist/env/index.js +131 -0
- package/dist/env/index.js.map +1 -0
- package/dist/explode/transform.d.ts +1 -1
- package/dist/explode/transform.js +3 -1
- package/dist/explode/transform.js.map +1 -1
- package/dist/generated/operations.d.ts +617 -0
- package/dist/generated/operations.js +2 -0
- package/dist/generated/operations.js.map +1 -0
- package/dist/generated/schema.d.ts +965 -0
- package/dist/generated/{graphql.js → schema.js} +13 -1
- package/dist/generated/schema.js.map +1 -0
- package/dist/implode/index.js +22 -43
- package/dist/implode/index.js.map +1 -1
- package/dist/implode/transform.d.ts +3 -5
- package/dist/implode/transform.js +10 -10
- package/dist/implode/transform.js.map +1 -1
- package/dist/{integrations/describe.d.ts → import/index.d.ts} +4 -1
- package/dist/import/index.js +43 -0
- package/dist/import/index.js.map +1 -0
- package/dist/include/index.d.ts +10 -0
- package/dist/include/index.js +41 -0
- package/dist/include/index.js.map +1 -0
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/init/index.js +8 -16
- package/dist/init/index.js.map +1 -1
- package/dist/integrations/create.d.ts +1 -1
- package/dist/integrations/create.js +2 -4
- package/dist/integrations/create.js.map +1 -1
- package/dist/integrations/list.d.ts +1 -1
- package/dist/integrations/list.js +2 -4
- package/dist/integrations/list.js.map +1 -1
- package/dist/migrate/index.d.ts +5 -0
- package/dist/migrate/index.js +101 -0
- package/dist/migrate/index.js.map +1 -0
- package/dist/pull/index.d.ts +4 -2
- package/dist/pull/index.js +25 -44
- package/dist/pull/index.js.map +1 -1
- package/dist/push/index.d.ts +1 -1
- package/dist/push/index.js +333 -96
- package/dist/push/index.js.map +1 -1
- package/dist/rename/index.d.ts +8 -0
- package/dist/rename/index.js +109 -0
- package/dist/rename/index.js.map +1 -0
- package/dist/repl/dispatch.d.ts +8 -2
- package/dist/repl/dispatch.js +43 -29
- package/dist/repl/dispatch.js.map +1 -1
- package/dist/repl/dispatchAndLoad.d.ts +7 -0
- package/dist/repl/dispatchAndLoad.js +35 -0
- package/dist/repl/dispatchAndLoad.js.map +1 -0
- package/dist/repl/help.js +8 -1
- package/dist/repl/help.js.map +1 -1
- package/dist/repl/index.d.ts +1 -1
- package/dist/repl/index.js +29 -9
- package/dist/repl/index.js.map +1 -1
- package/dist/repl/load.d.ts +8 -0
- package/dist/repl/load.js +53 -0
- package/dist/repl/load.js.map +1 -0
- package/dist/run/index.d.ts +4 -5
- package/dist/run/index.js +4 -6
- package/dist/run/index.js.map +1 -1
- package/dist/status/index.d.ts +1 -1
- package/dist/status/index.js +5 -7
- package/dist/status/index.js.map +1 -1
- package/dist/utils/config.d.ts +9 -2
- package/dist/utils/config.js +39 -6
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/createIntegrationFromFile.d.ts +2 -0
- package/dist/utils/createIntegrationFromFile.js +14 -33
- package/dist/utils/createIntegrationFromFile.js.map +1 -1
- package/dist/utils/detectPullConflicts.d.ts +8 -0
- package/dist/utils/detectPullConflicts.js +65 -0
- package/dist/utils/detectPullConflicts.js.map +1 -0
- package/dist/utils/dispatch.d.ts +1 -1
- package/dist/utils/dispatch.js +3 -2
- package/dist/utils/dispatch.js.map +1 -1
- package/dist/utils/elementFiles.d.ts +13 -0
- package/dist/utils/elementFiles.js +76 -0
- package/dist/utils/elementFiles.js.map +1 -0
- package/dist/utils/fetchIntegrationDefinition.d.ts +8 -0
- package/dist/utils/fetchIntegrationDefinition.js +58 -0
- package/dist/utils/fetchIntegrationDefinition.js.map +1 -0
- package/dist/utils/fetchLocal.d.ts +3 -1
- package/dist/utils/fetchLocal.js +11 -9
- package/dist/utils/fetchLocal.js.map +1 -1
- package/dist/utils/fetchSession.d.ts +1 -1
- package/dist/utils/fetchSession.js +2 -1
- package/dist/utils/fetchSession.js.map +1 -1
- package/dist/utils/graphqlClient.d.ts +3 -0
- package/dist/utils/graphqlClient.js +3 -0
- package/dist/utils/graphqlClient.js.map +1 -1
- package/dist/utils/graphqlError.d.ts +1 -0
- package/dist/utils/graphqlError.js +13 -1
- package/dist/utils/graphqlError.js.map +1 -1
- package/dist/utils/greatFile.d.ts +40 -0
- package/dist/utils/greatFile.js +66 -0
- package/dist/utils/greatFile.js.map +1 -0
- package/dist/utils/hashContent.js +1 -1
- package/dist/utils/hashContent.js.map +1 -1
- package/dist/utils/integrationType.d.ts +3 -0
- package/dist/utils/integrationType.js +15 -0
- package/dist/utils/integrationType.js.map +1 -0
- package/dist/utils/resolveAccount.d.ts +3 -2
- package/dist/utils/resolveAccount.js +11 -1
- package/dist/utils/resolveAccount.js.map +1 -1
- package/dist/utils/resolveElement.d.ts +1 -1
- package/dist/utils/resolveElementInclude.d.ts +3 -0
- package/dist/utils/resolveElementInclude.js +28 -0
- package/dist/utils/resolveElementInclude.js.map +1 -0
- package/dist/utils/resolveIntegration.d.ts +4 -2
- package/dist/utils/resolveIntegration.js +7 -3
- package/dist/utils/resolveIntegration.js.map +1 -1
- package/dist/utils/resolveTemplateImport.d.ts +3 -0
- package/dist/utils/resolveTemplateImport.js +31 -0
- package/dist/utils/resolveTemplateImport.js.map +1 -0
- package/dist/utils/response.d.ts +3 -0
- package/dist/utils/response.js +24 -0
- package/dist/utils/response.js.map +1 -0
- package/dist/utils/saveIntegration.d.ts +8 -4
- package/dist/utils/saveIntegration.js +76 -34
- package/dist/utils/saveIntegration.js.map +1 -1
- package/dist/utils/token.js +1 -1
- package/dist/utils/token.js.map +1 -1
- package/dist/utils/url.d.ts +1 -0
- package/dist/utils/url.js +10 -0
- package/dist/utils/url.js.map +1 -0
- package/dist/utils/writeShadowElement.d.ts +26 -0
- package/dist/utils/writeShadowElement.js +119 -0
- package/dist/utils/writeShadowElement.js.map +1 -0
- package/dist/{value → values}/get.d.ts +1 -1
- package/dist/{value → values}/get.js +7 -8
- package/dist/values/get.js.map +1 -0
- package/dist/{value → values}/index.js +13 -1
- package/dist/values/index.js.map +1 -0
- package/dist/{value → values}/list.js +10 -9
- package/dist/values/list.js.map +1 -0
- package/dist/{value → values}/set.d.ts +1 -1
- package/dist/{value → values}/set.js +9 -9
- package/dist/values/set.js.map +1 -0
- package/dist/values/unset.d.ts +8 -0
- package/dist/values/unset.js +61 -0
- package/dist/values/unset.js.map +1 -0
- package/dist/whoami/fetchSession.d.ts +3 -3
- package/dist/whoami/fetchSession.js +2 -4
- package/dist/whoami/fetchSession.js.map +1 -1
- package/dist/whoami/index.d.ts +1 -1
- package/package.json +14 -14
- package/dist/create/account.d.ts +0 -2
- package/dist/create/account.js +0 -40
- package/dist/create/account.js.map +0 -1
- package/dist/create/integration.d.ts +0 -4
- package/dist/create/integration.js +0 -73
- package/dist/create/integration.js.map +0 -1
- package/dist/create/utils.d.ts +0 -4
- package/dist/create/utils.js +0 -8
- package/dist/create/utils.js.map +0 -1
- package/dist/generated/graphql.d.ts +0 -1867
- package/dist/generated/graphql.js.map +0 -1
- package/dist/integrations/describe.js +0 -51
- package/dist/integrations/describe.js.map +0 -1
- package/dist/projects/describe.d.ts +0 -5
- package/dist/projects/describe.js +0 -51
- package/dist/projects/describe.js.map +0 -1
- package/dist/projects/index.d.ts +0 -5
- package/dist/projects/index.js +0 -83
- package/dist/projects/index.js.map +0 -1
- package/dist/repl/fetchUserAndIntegration.d.ts +0 -10
- package/dist/repl/fetchUserAndIntegration.js +0 -73
- package/dist/repl/fetchUserAndIntegration.js.map +0 -1
- package/dist/utils/apiUrl.d.ts +0 -1
- package/dist/utils/apiUrl.js +0 -7
- package/dist/utils/apiUrl.js.map +0 -1
- package/dist/utils/callApi.d.ts +0 -5
- package/dist/utils/callApi.js +0 -17
- package/dist/utils/callApi.js.map +0 -1
- package/dist/utils/fetchAccount.d.ts +0 -10
- package/dist/utils/fetchAccount.js +0 -60
- package/dist/utils/fetchAccount.js.map +0 -1
- package/dist/utils/fetchLocalProject.d.ts +0 -1
- package/dist/utils/fetchLocalProject.js +0 -12
- package/dist/utils/fetchLocalProject.js.map +0 -1
- package/dist/utils/fetchUserAndIntegration.d.ts +0 -9
- package/dist/utils/fetchUserAndIntegration.js +0 -48
- package/dist/utils/fetchUserAndIntegration.js.map +0 -1
- package/dist/utils/graphqlRequestClient.d.ts +0 -10
- package/dist/utils/graphqlRequestClient.js +0 -20
- package/dist/utils/graphqlRequestClient.js.map +0 -1
- package/dist/utils/saveProject.d.ts +0 -8
- package/dist/utils/saveProject.js +0 -93
- package/dist/utils/saveProject.js.map +0 -1
- package/dist/utils/session.d.ts +0 -9
- package/dist/utils/session.js +0 -17
- package/dist/utils/session.js.map +0 -1
- package/dist/value/get.js.map +0 -1
- package/dist/value/index.js.map +0 -1
- package/dist/value/list.js.map +0 -1
- package/dist/value/set.js.map +0 -1
- /package/dist/{value → values}/index.d.ts +0 -0
- /package/dist/{value → values}/list.d.ts +0 -0
package/README.md
CHANGED
|
@@ -27,106 +27,200 @@ great logout
|
|
|
27
27
|
|
|
28
28
|
## Commands
|
|
29
29
|
|
|
30
|
+
### Targeting an integration and account
|
|
31
|
+
|
|
32
|
+
Many commands act on a specific integration, and some on a specific account.
|
|
33
|
+
They share the same rules for working out which one to use. The commands below
|
|
34
|
+
note which of these they support.
|
|
35
|
+
|
|
36
|
+
- **Integration** — by default the current folder's integration (its
|
|
37
|
+
`integration.json` and `.great.json`). To target another one, value commands
|
|
38
|
+
take the `-i <integration-id-or-key>` flag, while others take it as a
|
|
39
|
+
positional `<integration>` argument. An explicit integration overrides the
|
|
40
|
+
folder.
|
|
41
|
+
- **Account** — needed only when an integration is addressed by key rather than
|
|
42
|
+
id (a key is resolved within an account), or by commands that act on an account
|
|
43
|
+
directly. Provide it with the `-a <account-id-or-key>` flag. When omitted, it
|
|
44
|
+
falls back to the current folder's account (from `.great.json`), then the
|
|
45
|
+
default account from config (`great config set account <id>`).
|
|
46
|
+
|
|
47
|
+
An integration or account passed explicitly that does not exist is an error —
|
|
48
|
+
commands never silently fall back to the current folder in that case.
|
|
49
|
+
|
|
30
50
|
### Authentication
|
|
51
|
+
|
|
31
52
|
- `great login`: Log in to Integreat via browser authentication.
|
|
32
53
|
- `great logout`: Log out and remove stored authentication token.
|
|
33
54
|
- `great whoami`: Displays your Integreat user.
|
|
34
55
|
|
|
35
56
|
### Account Management
|
|
57
|
+
|
|
36
58
|
- `great accounts` or `great accounts list`: Display list of accounts (default
|
|
37
59
|
action).
|
|
38
60
|
- `great accounts create <name>`: Create a new account.
|
|
39
61
|
|
|
40
62
|
### Integration Management
|
|
63
|
+
|
|
41
64
|
- `great integrations` or `great integrations list`: Display list of
|
|
42
|
-
integrations.
|
|
43
|
-
|
|
65
|
+
integrations. Supports `-a` to filter by account, or `--all` to list all
|
|
66
|
+
integrations ignoring the default account.
|
|
44
67
|
- `great integrations create <name>`: Create a new integration on the Integreat
|
|
45
|
-
server. Requires `-a
|
|
46
|
-
|
|
68
|
+
server. Requires `-a`. Returns integration ID to add to local
|
|
69
|
+
`integration.json` for linking with workspace.
|
|
47
70
|
|
|
48
71
|
### Local Workspace
|
|
72
|
+
|
|
49
73
|
- `great init [name]`: Initialize a new integration workspace locally. Creates
|
|
50
74
|
`integration.json` and folder structure without creating anything on the
|
|
51
75
|
server. If name is omitted, uses the current directory name.
|
|
52
|
-
- `great clone <integration>`: Clone an integration to a new folder.
|
|
53
|
-
|
|
76
|
+
- `great clone <integration>`: Clone an integration to a new folder.
|
|
77
|
+
`<integration>` can be an integration id or key; supports `-a`. Creates a new
|
|
78
|
+
directory with the integration key (or id) and downloads all integration
|
|
54
79
|
files.
|
|
55
80
|
- `great pull`: Pull remote changes to the current integration folder. Must be
|
|
56
|
-
run from a folder with an `integration.json` file.
|
|
81
|
+
run from a folder with an `integration.json` file. Writes the integration
|
|
82
|
+
config to `integration.json` and each element to its file under the matching
|
|
83
|
+
folder, and updates `.great.json` with the remote links. Element files that no
|
|
84
|
+
longer exist on the server are deleted, while local-only files are left alone.
|
|
85
|
+
Will check for conflicts and abort.
|
|
57
86
|
- `great push`: Push local changes to Integreat. Must be run from a folder with
|
|
58
|
-
an `integration.json` file
|
|
87
|
+
an `integration.json` file; supports `-a` when creating a new integration, to
|
|
88
|
+
create it in the right account. Will check for conflicts and abort.
|
|
89
|
+
- `great import <template>`: Import a template, creating a local **shadow file**
|
|
90
|
+
for each of its elements. A shadow file is an ordinary element file carrying a
|
|
91
|
+
`$shadow: true` marker; it does not own its content (that lives in the source
|
|
92
|
+
element) — the link to the source and the template import are recorded in
|
|
93
|
+
`.great.json`. Several templates may import the same element; re-importing
|
|
94
|
+
updates the existing shadow. Aborts without writing anything if any imported
|
|
95
|
+
element clashes with a local element or a shadow of a different source. Must
|
|
96
|
+
be run from a folder with an `integration.json` file (no push required first).
|
|
97
|
+
- `great include <element>`: Include a single element from another integration
|
|
98
|
+
as a shadow file, like `great import` but for one element and with no template
|
|
99
|
+
bookkeeping. Use `-p, --pinned-at <timestamp>` to pin the shadow to the source
|
|
100
|
+
as it stood at that ISO timestamp; omit it to follow the source's latest
|
|
101
|
+
content. Must be run from a folder with an `integration.json` file.
|
|
102
|
+
- `great rename <target> <new-key>`: Rename an element or the account key,
|
|
103
|
+
keeping the link to the remote element intact. `<target>` is
|
|
104
|
+
`"<folder>/<key>"` for an element (e.g. `schemas/entry`), or the literal
|
|
105
|
+
`account`. Use this instead of renaming an element file by hand — a plain
|
|
106
|
+
rename is treated as deleting the old element and creating a new one.
|
|
107
|
+
Already-pushed targets are renamed on the server too (requires login).
|
|
108
|
+
(To rename the integration itself, rename its folder — the folder name is the
|
|
109
|
+
integration key.)
|
|
110
|
+
|
|
59
111
|
### Deployment & Runtime
|
|
112
|
+
|
|
60
113
|
- `great deploy [integration]`: Create a version and start the integration.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`integration
|
|
114
|
+
Targets the `[integration]` argument or the current folder; supports `-a`. Use
|
|
115
|
+
`-n <name>` to specify a custom version name. Only real integrations are
|
|
116
|
+
started; `library` and `template` integrations get a new version but are not
|
|
117
|
+
started.
|
|
118
|
+
- `great run [integration]`: Run a job or flow interactively. Targets the
|
|
119
|
+
`[integration]` argument or the current folder; supports `-a`.
|
|
67
120
|
- `great status [integration]`: Show integration status and active version.
|
|
68
|
-
|
|
69
|
-
first argument, or run from a folder with `integration.json`.
|
|
121
|
+
Targets the `[integration]` argument or the current folder; supports `-a`.
|
|
70
122
|
- `great repl [integration]`: Start a Node.js REPL session with access to
|
|
71
|
-
integration dispatch functions.
|
|
72
|
-
|
|
123
|
+
integration dispatch functions. Targets the `[integration]` argument or the
|
|
124
|
+
current folder; supports `-a`. Use `help()` in the REPL to see available
|
|
73
125
|
functions.
|
|
74
126
|
|
|
75
127
|
### Value Management
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- `great
|
|
83
|
-
`<element>` can be either an element ID or key
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
128
|
+
|
|
129
|
+
- `great values` or `great values list`: List all value elements in an
|
|
130
|
+
integration. Supports `-i` and `-a`.
|
|
131
|
+
- `great values get <element>`: Get the value of a value element. The
|
|
132
|
+
`<element>` can be either an element ID or key (a key needs integration
|
|
133
|
+
context). Supports `-i` and `-a`.
|
|
134
|
+
- `great values set <element> <value>`: Set the value of a value element. The
|
|
135
|
+
`<element>` can be either an element ID or key (a key needs integration
|
|
136
|
+
context). Supports `-i` and `-a`. The value will be automatically cast to the
|
|
137
|
+
appropriate type (string, number, boolean, date, or secret) based on the
|
|
138
|
+
element's type definition.
|
|
139
|
+
- `great values unset <element>`: Clear the value of a value element, so it may
|
|
140
|
+
fall back to an inherited value from a source element when present. The
|
|
141
|
+
`<element>` can be either an element ID or key (a key needs integration
|
|
142
|
+
context). Supports `-i` and `-a`.
|
|
143
|
+
|
|
144
|
+
### Environments
|
|
145
|
+
|
|
146
|
+
- `great env list`: List configured environments. The built-in `prod`
|
|
147
|
+
environment is always present, and the active one is marked.
|
|
148
|
+
- `great env set <name> --api-url <url> --app-url <url>`: Add or update a
|
|
149
|
+
named environment. The name `prod` is reserved.
|
|
150
|
+
- `great env use <name>`: Switch the active environment. Use `prod` to reset
|
|
151
|
+
to the default. When a non-prod environment is active, commands that
|
|
152
|
+
contact the API print a warning.
|
|
153
|
+
- `great env remove <name>`: Remove a named environment.
|
|
89
154
|
|
|
90
155
|
### Utilities
|
|
156
|
+
|
|
91
157
|
- `great explode <file>`: Convert legacy integration JSON to new file structure.
|
|
92
158
|
Specify the path to a legacy JSON file as the first argument.
|
|
93
159
|
- `great implode [folder]`: Combine integration file structure into a single
|
|
94
160
|
legacy JSON file. Specify the path to an integration folder as the first
|
|
95
161
|
argument (defaults to current directory). Note: value elements will have empty
|
|
96
162
|
values in the output.
|
|
163
|
+
- `great migrate`: One-time migration of an existing workspace from the old
|
|
164
|
+
layout — where sync bookkeeping was stored inline as `__id`/`__key`/
|
|
165
|
+
`__timestamp` props — to a `.great.json` file (see Workspace files below). Run
|
|
166
|
+
it once from the integration folder; it is safe to re-run.
|
|
97
167
|
- `great now`: Prints the current Unix timestamp.
|
|
98
168
|
|
|
169
|
+
## Workspace files
|
|
170
|
+
|
|
171
|
+
An integration folder contains:
|
|
172
|
+
|
|
173
|
+
- `integration.json` at the folder root. This holds the integration's own
|
|
174
|
+
configuration: its `name`, `description`, `status`, `type`, and `flags`. The
|
|
175
|
+
`type` is one of `integration` (the default), `template`, or `library`. The
|
|
176
|
+
integration's key is the folder name, so renaming its folder to change the
|
|
177
|
+
key (not yet implemented).
|
|
178
|
+
- Per-type folders (`schemas/`, `services/`, `auths/`, `mutations/`,
|
|
179
|
+
`dictionaries/`, `jobs/`, `values/`, `flows/`, `retryRules/`) with one JSON
|
|
180
|
+
file per element. These hold only configuration. Keys come from names, not
|
|
181
|
+
stored fields: an element's key is its file name without the extension (e.g.
|
|
182
|
+
`schemas/entry.json` has key `entry`). Rename an element with `great rename`
|
|
183
|
+
(a plain file rename is treated as delete + recreate).
|
|
184
|
+
- `.great.json` at the folder root. This holds the sync bookkeeping that links
|
|
185
|
+
local files to their remote counterparts — the integration and element ids,
|
|
186
|
+
the owning account, the last-synced timestamps and content hashes. It is
|
|
187
|
+
managed by `great pull` and `great push` — **commit it to git, and do not edit
|
|
188
|
+
it by hand**. Deleting it "forgets" all remote links, so the next `great push`
|
|
189
|
+
recreates the remote elements; this is the clean way to regenerate a folder
|
|
190
|
+
against a new environment.
|
|
191
|
+
|
|
99
192
|
## Typical Workflow
|
|
100
193
|
|
|
101
194
|
For new integrations:
|
|
195
|
+
|
|
102
196
|
1. **Initialize local workspace**: `great init "My Integration"`
|
|
103
|
-
2. **Create element files** (schemas, services, etc.) in their respective
|
|
197
|
+
2. **Create element files** (schemas, services, etc.) in their respective
|
|
198
|
+
folders
|
|
104
199
|
3. **Push local files to server**: `great push`
|
|
105
200
|
4. **Deploy**: `great deploy`
|
|
106
201
|
|
|
107
202
|
For existing integrations:
|
|
108
|
-
|
|
203
|
+
|
|
204
|
+
- **Clone to local**: `great clone <integration-id-or-key>`
|
|
109
205
|
- **Make local changes** to element files
|
|
110
206
|
- **Push changes**: `great push`
|
|
111
207
|
- **Deploy**: `great deploy`
|
|
112
208
|
|
|
113
209
|
Setting values:
|
|
210
|
+
|
|
114
211
|
- **From integration directory**: `great value set apiKey "my-secret-value"`
|
|
115
212
|
- **With integration flag**: `great value set apiKey "my-secret" -i my-integration`
|
|
116
213
|
- **By element ID**: `great value set val-123 "my-value"`
|
|
117
214
|
|
|
118
215
|
## Development and testing
|
|
119
216
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- `INTEGREAT_APP_URL`: Override the web app URL (default:
|
|
123
|
-
`https://app.integreat.io`).
|
|
124
|
-
- `INTEGREAT_API_URL`: Override the API URL (default:
|
|
125
|
-
`https://api.integreat.io`).
|
|
126
|
-
- `GREAT_TOKEN`: Manually provide a JWT token (bypasses stored token).
|
|
127
|
-
|
|
217
|
+
To run against a non-prod setup (QA, local, etc.), configure a named
|
|
218
|
+
environment once and switch to it:
|
|
128
219
|
|
|
129
220
|
```bash
|
|
130
|
-
|
|
131
|
-
|
|
221
|
+
great env set local --api-url http://localhost:3001 --app-url http://localhost:3000
|
|
222
|
+
great env use local
|
|
223
|
+
great login
|
|
132
224
|
```
|
|
225
|
+
|
|
226
|
+
Switch back to prod with `great env use prod`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import Conf from 'conf';
|
|
2
2
|
import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { ConfigSchema } from '../utils/config.js';
|
|
4
4
|
export default function createAccount(log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, config?: Conf<ConfigSchema>): (accountName?: string) => Promise<void>;
|
package/dist/accounts/create.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import {
|
|
2
|
+
import { getClient } from '../utils/graphqlClient.js';
|
|
3
3
|
import { handleGraphQLError } from '../utils/graphqlError.js';
|
|
4
|
-
import { getApiBaseUrl } from '../utils/config.js';
|
|
5
4
|
import { gql } from 'graphql-tag';
|
|
6
5
|
import determineNameAndKey from '../utils/determineNameAndKey.js';
|
|
7
6
|
const CreateAccountMutationDocument = gql `
|
|
@@ -21,8 +20,7 @@ export default function createAccount(log, apiToken, client, config) {
|
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
22
|
const { name, key } = determineNameAndKey(accountName);
|
|
24
|
-
const
|
|
25
|
-
const graphqlClient = client ?? createGraphQLClient(apiToken, apiBaseUrl);
|
|
23
|
+
const graphqlClient = getClient(apiToken, client, config);
|
|
26
24
|
const result = await graphqlClient.request(CreateAccountMutationDocument, {
|
|
27
25
|
name,
|
|
28
26
|
key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/accounts/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/accounts/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAA6B,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,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,aAAa,GAAG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QACzD,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"}
|
package/dist/accounts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Conf from 'conf';
|
|
2
2
|
import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { ConfigSchema } from '../utils/config.js';
|
|
4
4
|
import type { Command } from 'commander';
|
|
5
5
|
export declare const action: (log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, config?: Conf<ConfigSchema>) => () => Promise<void>;
|
|
6
6
|
declare const _default: (program: Command, apiToken?: string) => Command;
|
package/dist/accounts/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import columnify from 'columnify';
|
|
3
|
-
import {
|
|
3
|
+
import { getClient } from '../utils/graphqlClient.js';
|
|
4
4
|
import { handleGraphQLError } from '../utils/graphqlError.js';
|
|
5
|
-
import { getApiBaseUrl } from '../utils/config.js';
|
|
6
5
|
import { gql } from 'graphql-tag';
|
|
7
6
|
import createAccountAction from './create.js';
|
|
8
7
|
const AccountsQueryDocument = gql `
|
|
@@ -18,8 +17,7 @@ const AccountsQueryDocument = gql `
|
|
|
18
17
|
}
|
|
19
18
|
`;
|
|
20
19
|
export const action = (log, apiToken, client, config) => async function accountsList() {
|
|
21
|
-
const
|
|
22
|
-
const graphqlClient = client ?? createGraphQLClient(apiToken, apiBaseUrl);
|
|
20
|
+
const graphqlClient = getClient(apiToken, client, config);
|
|
23
21
|
const result = await graphqlClient.request(AccountsQueryDocument, {});
|
|
24
22
|
if (result.error) {
|
|
25
23
|
handleGraphQLError(result.error, log);
|
|
@@ -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;AAEjC,OAAO,
|
|
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;AAEjC,OAAO,EAAE,SAAS,EAA6B,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAI7D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,mBAAmB,MAAM,aAAa,CAAA;AAE7C,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;CAWhC,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,GAA8B,EAC9B,QAAiB,EACjB,MAA6B,EAC7B,MAA2B,EAC3B,EAAE,CACF,KAAK,UAAU,YAAY;IACzB,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACzD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CACxC,qBAAqB,EACrB,EAAE,CACH,CAAA;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,kBAAkB,CAA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I;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"}
|
package/dist/clone/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import Conf from 'conf';
|
|
3
3
|
import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { ConfigSchema } from '../utils/config.js';
|
|
5
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>) => (
|
|
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
|
+
}) => Promise<void>;
|
|
7
9
|
declare const _default: (program: Command, apiToken?: string) => Command;
|
|
8
10
|
export default _default;
|
package/dist/clone/index.js
CHANGED
|
@@ -1,54 +1,29 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import saveIntegration from '../utils/saveIntegration.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getClient } from '../utils/graphqlClient.js';
|
|
4
4
|
import { handleGraphQLError } from '../utils/graphqlError.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
}
|
|
5
|
+
import { fetchIntegrationDefinition } from '../utils/fetchIntegrationDefinition.js';
|
|
6
|
+
import { resolveAccountId } from '../utils/resolveAccount.js';
|
|
7
|
+
import { resolveIntegration } from '../utils/resolveIntegration.js';
|
|
8
|
+
export const action = (log, apiToken, client, fsImpl, config) => async function cloneIntegration(integrationIdOrKey, options) {
|
|
9
|
+
if (!integrationIdOrKey) {
|
|
10
|
+
log(chalk.red('Integration id or key is required'));
|
|
11
|
+
log(`Usage: ${chalk.bold('great clone <integration-id-or-key>')}`);
|
|
12
|
+
return;
|
|
33
13
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
log(chalk.red('Integration ID is required'));
|
|
39
|
-
log(`Usage: ${chalk.bold('great clone <integration-id>')}`);
|
|
14
|
+
const graphqlClient = getClient(apiToken, client, config);
|
|
15
|
+
const { accountId, error: accountError } = await resolveAccountId(options ?? {}, apiToken ?? '', graphqlClient, config);
|
|
16
|
+
if (accountError) {
|
|
17
|
+
handleGraphQLError(accountError, log);
|
|
40
18
|
return;
|
|
41
19
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (result.error) {
|
|
46
|
-
handleGraphQLError(result.error, log);
|
|
20
|
+
const resolved = await resolveIntegration(integrationIdOrKey, accountId, apiToken, graphqlClient);
|
|
21
|
+
if (resolved.error) {
|
|
22
|
+
handleGraphQLError(new Error(resolved.error), log);
|
|
47
23
|
return;
|
|
48
24
|
}
|
|
49
|
-
const integration =
|
|
50
|
-
if (!integration
|
|
51
|
-
log(chalk.red('Integration has no latest version'));
|
|
25
|
+
const integration = await fetchIntegrationDefinition(graphqlClient, resolved.id, log);
|
|
26
|
+
if (!integration) {
|
|
52
27
|
return;
|
|
53
28
|
}
|
|
54
29
|
const root = integration.key ?? integration.id;
|
|
@@ -57,5 +32,6 @@ export const action = (log, apiToken, client, fsImpl, config) => async function
|
|
|
57
32
|
export default (program, apiToken) => program
|
|
58
33
|
.command('clone <integration>')
|
|
59
34
|
.description('clone an integration to a new folder')
|
|
35
|
+
.option('-a, --account <id>', 'account id or key (uses default from config if not provided)')
|
|
60
36
|
.action(action(console.log, apiToken));
|
|
61
37
|
//# sourceMappingURL=index.js.map
|
package/dist/clone/index.js.map
CHANGED
|
@@ -1 +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,
|
|
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,EAAE,SAAS,EAA6B,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAA;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAGnE,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,GAA8B,EAC9B,QAAiB,EACjB,MAA6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EH,eAAe,CAAC,OAAgB,EAAE,QAAiB,EAAE,EAAE,CACrD,OAAO;KACJ,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CACL,oBAAoB,EACpB,8DAA8D,CAC/D;KACA,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import columnify from 'columnify';
|
|
3
|
-
import { getAllConfig,
|
|
3
|
+
import { getAllConfig, getCurrentEnvName, setConfigValue, deleteConfigValue, } from '../utils/config.js';
|
|
4
4
|
const keyMap = {
|
|
5
|
-
'api-url': 'apiUrl',
|
|
6
|
-
'app-url': 'appUrl',
|
|
7
5
|
account: 'account',
|
|
8
6
|
};
|
|
9
7
|
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
8
|
export const setAction = (log, config) => (key, value) => {
|
|
20
9
|
if (!validKeys.includes(key)) {
|
|
21
10
|
log(chalk.red(`Invalid config key: ${key}. Valid keys are: ${validKeys.join(', ')}`));
|
|
22
11
|
return;
|
|
23
12
|
}
|
|
24
|
-
if ((key === 'api-url' || key === 'app-url') && !isValidUrl(value)) {
|
|
25
|
-
log(chalk.red(`Invalid URL format: ${value}`));
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
13
|
const configKey = keyMap[key];
|
|
29
14
|
setConfigValue(configKey, value, config);
|
|
30
15
|
if (key === 'account') {
|
|
@@ -50,20 +35,9 @@ export const unsetAction = (log, config) => (key) => {
|
|
|
50
35
|
};
|
|
51
36
|
export const listAction = (log, config) => () => {
|
|
52
37
|
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
38
|
const isLoggedIn = !!configData.token;
|
|
64
39
|
const configItems = [
|
|
65
|
-
{ key: '
|
|
66
|
-
{ key: 'app-url', value: getAppBaseUrl(config), source: appSource },
|
|
40
|
+
{ key: 'env', value: getCurrentEnvName(config), source: '' },
|
|
67
41
|
{ key: 'Logged in', value: isLoggedIn ? 'Yes' : 'No', source: '' },
|
|
68
42
|
];
|
|
69
43
|
if (configData.account) {
|
|
@@ -96,11 +70,11 @@ export default (program) => {
|
|
|
96
70
|
.description('manage configuration');
|
|
97
71
|
configCommand
|
|
98
72
|
.command('set <key> <value>')
|
|
99
|
-
.description('set a configuration value (
|
|
73
|
+
.description('set a configuration value (account)')
|
|
100
74
|
.action(setAction(console.log));
|
|
101
75
|
configCommand
|
|
102
76
|
.command('unset <key>')
|
|
103
|
-
.description('unset a configuration value (
|
|
77
|
+
.description('unset a configuration value (account)')
|
|
104
78
|
.action(unsetAction(console.log));
|
|
105
79
|
configCommand
|
|
106
80
|
.command('list')
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CA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
2
|
import Conf from 'conf';
|
|
3
3
|
import { type GraphQLRequestClient } from '../utils/graphqlClient.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { ConfigSchema } from '../utils/config.js';
|
|
5
5
|
import type { Command } from 'commander';
|
|
6
6
|
export declare const action: (log: (message: string) => void, apiToken?: string, client?: GraphQLRequestClient, fsImpl?: typeof fs, config?: Conf<ConfigSchema>) => (integrationIdOrKey?: string, options?: {
|
|
7
7
|
account?: string;
|