@adobe/aio-cli-plugin-app-storage 1.0.1 → 1.0.3
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 +166 -1
- package/oclif.manifest.json +10 -20
- package/package.json +6 -3
- package/src/BaseCommand.js +2 -2
- package/src/commands/app/state/delete.js +0 -4
- package/src/commands/app/state/get.js +0 -4
- package/src/commands/app/state/list.js +0 -4
- package/src/commands/app/state/put.js +0 -4
- package/src/commands/app/state/stats.js +0 -4
package/README.md
CHANGED
|
@@ -23,8 +23,173 @@ $ aio app state --help
|
|
|
23
23
|
|
|
24
24
|
# Commands
|
|
25
25
|
<!-- commands -->
|
|
26
|
+
* [`aio app state delete [KEYS]`](#aio-app-state-delete-keys)
|
|
27
|
+
* [`aio app state get KEY`](#aio-app-state-get-key)
|
|
28
|
+
* [`aio app state list`](#aio-app-state-list)
|
|
29
|
+
* [`aio app state put KEY VALUE`](#aio-app-state-put-key-value)
|
|
30
|
+
* [`aio app state stats`](#aio-app-state-stats)
|
|
26
31
|
* [`aio help [COMMAND]`](#aio-help-command)
|
|
27
32
|
|
|
33
|
+
## `aio app state delete [KEYS]`
|
|
34
|
+
|
|
35
|
+
Delete key-values
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
USAGE
|
|
39
|
+
$ aio app state delete [KEYS...] [--json] [--region amer|emea] [--match <value>] [--force]
|
|
40
|
+
|
|
41
|
+
ARGUMENTS
|
|
42
|
+
KEYS... keys to delete. Above 5 keys, you will be prompted for confirmation
|
|
43
|
+
|
|
44
|
+
FLAGS
|
|
45
|
+
--force [use with caution!] force delete, no safety prompt
|
|
46
|
+
--match=<value> [use with caution!] deletes ALL key-values matching the provided glob-like pattern
|
|
47
|
+
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
|
|
48
|
+
<options: amer|emea>
|
|
49
|
+
|
|
50
|
+
GLOBAL FLAGS
|
|
51
|
+
--json Format output as json.
|
|
52
|
+
|
|
53
|
+
DESCRIPTION
|
|
54
|
+
Delete key-values
|
|
55
|
+
|
|
56
|
+
ALIASES
|
|
57
|
+
$ aio app state del
|
|
58
|
+
$ aio app state remove
|
|
59
|
+
$ aio app state rm
|
|
60
|
+
|
|
61
|
+
EXAMPLES
|
|
62
|
+
$ aio app state delete key
|
|
63
|
+
|
|
64
|
+
$ aio app state delete key1 key2 key3
|
|
65
|
+
|
|
66
|
+
$ aio app state delete --match 'gl*b'
|
|
67
|
+
|
|
68
|
+
$ aio app state delete --match 'gl*b' --json
|
|
69
|
+
|
|
70
|
+
$ aio app state delete --match 'be-carreful*' --force
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## `aio app state get KEY`
|
|
74
|
+
|
|
75
|
+
Get a key-value
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
USAGE
|
|
79
|
+
$ aio app state get KEY [--json] [--region amer|emea]
|
|
80
|
+
|
|
81
|
+
ARGUMENTS
|
|
82
|
+
KEY State key
|
|
83
|
+
|
|
84
|
+
FLAGS
|
|
85
|
+
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
|
|
86
|
+
<options: amer|emea>
|
|
87
|
+
|
|
88
|
+
GLOBAL FLAGS
|
|
89
|
+
--json Format output as json.
|
|
90
|
+
|
|
91
|
+
DESCRIPTION
|
|
92
|
+
Get a key-value
|
|
93
|
+
|
|
94
|
+
EXAMPLES
|
|
95
|
+
$ aio app state get key
|
|
96
|
+
|
|
97
|
+
$ aio app state get key --json
|
|
98
|
+
|
|
99
|
+
$ aio app state get key | wc -c
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## `aio app state list`
|
|
103
|
+
|
|
104
|
+
List key-values
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
USAGE
|
|
108
|
+
$ aio app state list [--json] [--region amer|emea] [-m <value>]
|
|
109
|
+
|
|
110
|
+
FLAGS
|
|
111
|
+
-m, --match=<value> [default: *] Glob-like pattern to filter keys
|
|
112
|
+
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
|
|
113
|
+
<options: amer|emea>
|
|
114
|
+
|
|
115
|
+
GLOBAL FLAGS
|
|
116
|
+
--json Format output as json.
|
|
117
|
+
|
|
118
|
+
DESCRIPTION
|
|
119
|
+
List key-values
|
|
120
|
+
|
|
121
|
+
ALIASES
|
|
122
|
+
$ aio app state ls
|
|
123
|
+
|
|
124
|
+
EXAMPLES
|
|
125
|
+
$ aio app state list
|
|
126
|
+
|
|
127
|
+
$ aio app state list --match 'gl*b'
|
|
128
|
+
|
|
129
|
+
$ aio app state list --json
|
|
130
|
+
|
|
131
|
+
$ aio app state list | less
|
|
132
|
+
|
|
133
|
+
$ aio app state list | wc -l
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## `aio app state put KEY VALUE`
|
|
137
|
+
|
|
138
|
+
Put a key-value
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
USAGE
|
|
142
|
+
$ aio app state put KEY VALUE [--json] [--region amer|emea] [-t <value>]
|
|
143
|
+
|
|
144
|
+
ARGUMENTS
|
|
145
|
+
KEY State key
|
|
146
|
+
VALUE State value
|
|
147
|
+
|
|
148
|
+
FLAGS
|
|
149
|
+
-t, --ttl=<value> Time to live in seconds. Default is 86400 (24 hours), max is 31536000 (1 year).
|
|
150
|
+
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
|
|
151
|
+
<options: amer|emea>
|
|
152
|
+
|
|
153
|
+
GLOBAL FLAGS
|
|
154
|
+
--json Format output as json.
|
|
155
|
+
|
|
156
|
+
DESCRIPTION
|
|
157
|
+
Put a key-value
|
|
158
|
+
|
|
159
|
+
EXAMPLES
|
|
160
|
+
$ aio app state put key value
|
|
161
|
+
|
|
162
|
+
$ aio app state put key value --ttl 3600
|
|
163
|
+
|
|
164
|
+
$ aio app state put key value --json
|
|
165
|
+
|
|
166
|
+
$ cat value/from/file | xargs -0 ./bin/run.js app state put key
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## `aio app state stats`
|
|
170
|
+
|
|
171
|
+
Display stats
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
USAGE
|
|
175
|
+
$ aio app state stats [--json] [--region amer|emea]
|
|
176
|
+
|
|
177
|
+
FLAGS
|
|
178
|
+
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
|
|
179
|
+
<options: amer|emea>
|
|
180
|
+
|
|
181
|
+
GLOBAL FLAGS
|
|
182
|
+
--json Format output as json.
|
|
183
|
+
|
|
184
|
+
DESCRIPTION
|
|
185
|
+
Display stats
|
|
186
|
+
|
|
187
|
+
EXAMPLES
|
|
188
|
+
$ aio app state stats
|
|
189
|
+
|
|
190
|
+
$ aio app state stats --json
|
|
191
|
+
```
|
|
192
|
+
|
|
28
193
|
## `aio help [COMMAND]`
|
|
29
194
|
|
|
30
195
|
Display help for aio.
|
|
@@ -43,7 +208,7 @@ DESCRIPTION
|
|
|
43
208
|
Display help for aio.
|
|
44
209
|
```
|
|
45
210
|
|
|
46
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.
|
|
211
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.11/src/commands/help.ts)_
|
|
47
212
|
<!-- commandsstop -->
|
|
48
213
|
|
|
49
214
|
## Contributing
|
package/oclif.manifest.json
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
"commands": {
|
|
3
3
|
"app:state:delete": {
|
|
4
4
|
"aliases": [
|
|
5
|
-
"app:state:
|
|
5
|
+
"app:state:del",
|
|
6
|
+
"app:state:remove",
|
|
7
|
+
"app:state:rm"
|
|
6
8
|
],
|
|
7
9
|
"args": {
|
|
8
10
|
"keys": {
|
|
@@ -55,11 +57,7 @@
|
|
|
55
57
|
}
|
|
56
58
|
},
|
|
57
59
|
"hasDynamicHelp": false,
|
|
58
|
-
"hiddenAliases": [
|
|
59
|
-
"app:state:del",
|
|
60
|
-
"app:state:remove",
|
|
61
|
-
"app:state:rm"
|
|
62
|
-
],
|
|
60
|
+
"hiddenAliases": [],
|
|
63
61
|
"id": "app:state:delete",
|
|
64
62
|
"pluginAlias": "@adobe/aio-cli-plugin-app-storage",
|
|
65
63
|
"pluginName": "@adobe/aio-cli-plugin-app-storage",
|
|
@@ -76,9 +74,7 @@
|
|
|
76
74
|
]
|
|
77
75
|
},
|
|
78
76
|
"app:state:get": {
|
|
79
|
-
"aliases": [
|
|
80
|
-
"app:state:get"
|
|
81
|
-
],
|
|
77
|
+
"aliases": [],
|
|
82
78
|
"args": {
|
|
83
79
|
"key": {
|
|
84
80
|
"description": "State key",
|
|
@@ -132,7 +128,7 @@
|
|
|
132
128
|
},
|
|
133
129
|
"app:state:list": {
|
|
134
130
|
"aliases": [
|
|
135
|
-
"app:state:
|
|
131
|
+
"app:state:ls"
|
|
136
132
|
],
|
|
137
133
|
"args": {},
|
|
138
134
|
"description": "List key-values",
|
|
@@ -175,9 +171,7 @@
|
|
|
175
171
|
}
|
|
176
172
|
},
|
|
177
173
|
"hasDynamicHelp": false,
|
|
178
|
-
"hiddenAliases": [
|
|
179
|
-
"app:state:ls"
|
|
180
|
-
],
|
|
174
|
+
"hiddenAliases": [],
|
|
181
175
|
"id": "app:state:list",
|
|
182
176
|
"pluginAlias": "@adobe/aio-cli-plugin-app-storage",
|
|
183
177
|
"pluginName": "@adobe/aio-cli-plugin-app-storage",
|
|
@@ -194,9 +188,7 @@
|
|
|
194
188
|
]
|
|
195
189
|
},
|
|
196
190
|
"app:state:put": {
|
|
197
|
-
"aliases": [
|
|
198
|
-
"app:state:put"
|
|
199
|
-
],
|
|
191
|
+
"aliases": [],
|
|
200
192
|
"args": {
|
|
201
193
|
"key": {
|
|
202
194
|
"description": "State key",
|
|
@@ -264,9 +256,7 @@
|
|
|
264
256
|
]
|
|
265
257
|
},
|
|
266
258
|
"app:state:stats": {
|
|
267
|
-
"aliases": [
|
|
268
|
-
"app:state:stats"
|
|
269
|
-
],
|
|
259
|
+
"aliases": [],
|
|
270
260
|
"args": {},
|
|
271
261
|
"description": "Display stats",
|
|
272
262
|
"examples": [
|
|
@@ -312,5 +302,5 @@
|
|
|
312
302
|
]
|
|
313
303
|
}
|
|
314
304
|
},
|
|
315
|
-
"version": "1.0.
|
|
305
|
+
"version": "1.0.3"
|
|
316
306
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-cli-plugin-app-storage",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@adobe/aio-lib-core-config": "^5",
|
|
6
6
|
"@adobe/aio-lib-core-logging": "^3",
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
"repositoryPrefix": "<%- repo %>/blob/<%- version %>/<%- commandPath %>",
|
|
47
47
|
"plugins": [
|
|
48
48
|
"@oclif/plugin-help"
|
|
49
|
-
]
|
|
49
|
+
],
|
|
50
|
+
"helpOptions": {
|
|
51
|
+
"hideAliasesFromRoot": true
|
|
52
|
+
}
|
|
50
53
|
},
|
|
51
54
|
"main": "src/commands/BaseCommand.js",
|
|
52
55
|
"scripts": {
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
"test": "npm run unit-test && npm run lint",
|
|
56
59
|
"prepack": "oclif manifest && oclif readme --no-aliases",
|
|
57
60
|
"postpack": "rm -f oclif.manifest.json",
|
|
58
|
-
"version": "oclif readme && git add README.md",
|
|
61
|
+
"version": "oclif readme --no-aliases && git add README.md",
|
|
59
62
|
"e2e": "node --experimental-vm-modules node_modules/jest/bin/jest.js --collectCoverage=false --testRegex 'e2e/e2e.js'"
|
|
60
63
|
},
|
|
61
64
|
"jest": {
|
package/src/BaseCommand.js
CHANGED
|
@@ -22,7 +22,7 @@ export class BaseCommand extends Command {
|
|
|
22
22
|
async init () {
|
|
23
23
|
await super.init()
|
|
24
24
|
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
|
25
|
-
const { readFile } = await import('fs') // dynamic import to be able to mock fs, ESM and Jest are not friends
|
|
25
|
+
const { readFile } = await import('fs/promises') // dynamic import to be able to mock fs, ESM and Jest are not friends
|
|
26
26
|
|
|
27
27
|
// setup debug logger
|
|
28
28
|
const command = this.constructor.name.toLowerCase() // hacky but convenient
|
|
@@ -52,7 +52,7 @@ export class BaseCommand extends Command {
|
|
|
52
52
|
const aioSdkVersion = packageJson.dependencies?.['@adobe/aio-sdk']
|
|
53
53
|
if ((aioLibStateVersion && semver.lt(semver.coerce(aioLibStateVersion), '4.0.0')) ||
|
|
54
54
|
(aioSdkVersion && semver.lt(semver.coerce(aioSdkVersion), '6.0.0'))) {
|
|
55
|
-
this.error('State commands are not available for legacy State, please migrate to "@adobe/aio-lib-state"
|
|
55
|
+
this.error('State commands are not available for legacy State, please migrate to the latest "@adobe/aio-lib-state" (or "@adobe/aio-sdk" >= 6.0.0).')
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|