@shopify/cli-kit 3.42.0 → 3.44.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/assets/cli-ruby/Gemfile +6 -3
- package/assets/cli-ruby/lib/project_types/extension/commands/serve.rb +10 -0
- package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +1 -1
- package/assets/cli-ruby/lib/project_types/theme/cli.rb +1 -0
- package/assets/cli-ruby/lib/project_types/theme/commands/common/root_helper.rb +3 -2
- package/assets/cli-ruby/lib/project_types/theme/commands/console.rb +15 -0
- package/assets/cli-ruby/lib/project_types/theme/commands/push.rb +1 -0
- package/assets/cli-ruby/lib/project_types/theme/messages/messages.rb +4 -2
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/script_injector.rb +1 -1
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload.rb +9 -2
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy.rb +13 -12
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server.rb +2 -2
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server.rb +7 -4
- package/assets/cli-ruby/lib/shopify_cli/theme/extension/host_theme.rb +19 -14
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/api.rb +107 -0
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/auth_dev_server.rb +80 -0
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/auth_middleware.rb +73 -0
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/resources/success.html +79 -0
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/resources/template.liquid +15 -0
- package/assets/cli-ruby/lib/shopify_cli/theme/repl.rb +145 -0
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/standard_reporter.rb +2 -2
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer.rb +1 -1
- package/assets/cli-ruby/lib/shopify_cli/theme/theme.rb +6 -6
- package/dist/private/node/analytics.d.ts +2 -2
- package/dist/private/node/analytics.js.map +1 -1
- package/dist/private/node/api/graphql.js +9 -16
- package/dist/private/node/api/graphql.js.map +1 -1
- package/dist/private/node/api/headers.js +8 -5
- package/dist/private/node/api/headers.js.map +1 -1
- package/dist/private/node/api.d.ts +9 -0
- package/dist/private/node/api.js +19 -0
- package/dist/private/node/api.js.map +1 -1
- package/dist/private/node/colors.js.map +1 -0
- package/dist/private/node/conf-store.d.ts +24 -5
- package/dist/private/node/conf-store.js +21 -3
- package/dist/private/node/conf-store.js.map +1 -1
- package/dist/private/node/constants.d.ts +3 -1
- package/dist/private/node/constants.js +3 -1
- package/dist/private/node/constants.js.map +1 -1
- package/dist/private/node/content-tokens.js +1 -1
- package/dist/private/node/content-tokens.js.map +1 -1
- package/dist/private/node/semver.js.map +1 -0
- package/dist/private/node/session/identity-token-validation.d.ts +1 -1
- package/dist/private/node/session/identity-token-validation.js +45 -20
- package/dist/private/node/session/identity-token-validation.js.map +1 -1
- package/dist/private/node/session/store.js +3 -46
- package/dist/private/node/session/store.js.map +1 -1
- package/dist/private/node/session.js +13 -10
- package/dist/private/node/session.js.map +1 -1
- package/dist/private/node/themes/generate-theme-name.js.map +1 -0
- package/dist/private/node/themes/replace-invalid-characters.js.map +1 -0
- package/dist/private/node/themes/themes-api/headers.js.map +1 -0
- package/dist/private/node/themes/themes-api/retry.js.map +1 -0
- package/dist/private/node/themes/themes-api/throttler.js.map +1 -0
- package/dist/private/node/ui/components/ConcurrentOutput.d.ts +0 -1
- package/dist/private/node/ui/components/ConcurrentOutput.js +0 -1
- package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
- package/dist/public/common/string.d.ts +16 -4
- package/dist/public/common/string.js +25 -4
- package/dist/public/common/string.js.map +1 -1
- package/dist/public/common/ts/deep-required.d.ts +0 -1
- package/dist/public/common/ts/deep-required.js.map +1 -1
- package/dist/public/common/ts/pick-by-prefix.d.ts +0 -1
- package/dist/public/common/ts/pick-by-prefix.js.map +1 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/public/node/base-command.d.ts +8 -5
- package/dist/public/node/base-command.js +1 -1
- package/dist/public/node/base-command.js.map +1 -1
- package/dist/public/node/cli.d.ts +1 -1
- package/dist/public/node/cli.js +0 -1
- package/dist/public/node/cli.js.map +1 -1
- package/dist/public/node/context/local.d.ts +2 -2
- package/dist/public/node/context/local.js +3 -3
- package/dist/public/node/context/local.js.map +1 -1
- package/dist/public/node/context/spin.d.ts +14 -0
- package/dist/public/node/context/spin.js +19 -0
- package/dist/public/node/context/spin.js.map +1 -1
- package/dist/public/node/environment.d.ts +12 -0
- package/dist/public/node/environment.js +14 -0
- package/dist/public/node/environment.js.map +1 -0
- package/dist/public/node/fs.d.ts +8 -12
- package/dist/public/node/fs.js +11 -35
- package/dist/public/node/fs.js.map +1 -1
- package/dist/public/node/http.js +5 -10
- package/dist/public/node/http.js.map +1 -1
- package/dist/public/node/local-storage.d.ts +37 -0
- package/dist/public/node/local-storage.js +44 -0
- package/dist/public/node/local-storage.js.map +1 -0
- package/dist/public/node/node-package-manager.js +1 -1
- package/dist/public/node/node-package-manager.js.map +1 -1
- package/dist/public/node/output.d.ts +0 -1
- package/dist/public/node/output.js +1 -2
- package/dist/public/node/output.js.map +1 -1
- package/dist/public/node/path.d.ts +58 -2
- package/dist/public/node/path.js +75 -3
- package/dist/public/node/path.js.map +1 -1
- package/dist/public/node/ruby.d.ts +2 -1
- package/dist/public/node/ruby.js +52 -16
- package/dist/public/node/ruby.js.map +1 -1
- package/dist/public/node/themes/conf.d.ts +12 -0
- package/dist/public/node/themes/conf.js +24 -0
- package/dist/public/node/themes/conf.js.map +1 -0
- package/dist/public/node/themes/theme-manager.js +1 -1
- package/dist/public/node/themes/theme-manager.js.map +1 -1
- package/dist/public/node/themes/themes-api.js +3 -3
- package/dist/public/node/themes/themes-api.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/assets/cli-ruby/Gemfile.lock +0 -190
- package/dist/private/node/secure-store.d.ts +0 -19
- package/dist/private/node/secure-store.js +0 -63
- package/dist/private/node/secure-store.js.map +0 -1
- package/dist/public/node/colors.js.map +0 -1
- package/dist/public/node/conf.d.ts +0 -2
- package/dist/public/node/conf.js +0 -3
- package/dist/public/node/conf.js.map +0 -1
- package/dist/public/node/semver.js.map +0 -1
- package/dist/public/node/themes/generate-theme-name.js.map +0 -1
- package/dist/public/node/themes/replace-invalid-characters.js.map +0 -1
- package/dist/public/node/themes/themes-api/headers.js.map +0 -1
- package/dist/public/node/themes/themes-api/retry.js.map +0 -1
- package/dist/public/node/themes/themes-api/throttler.js.map +0 -1
- package/dist/store/schema.d.ts +0 -3
- package/dist/store/schema.js +0 -27
- package/dist/store/schema.js.map +0 -1
- /package/dist/{public → private}/node/colors.d.ts +0 -0
- /package/dist/{public → private}/node/colors.js +0 -0
- /package/dist/{public → private}/node/semver.d.ts +0 -0
- /package/dist/{public → private}/node/semver.js +0 -0
- /package/dist/{public → private}/node/themes/generate-theme-name.d.ts +0 -0
- /package/dist/{public → private}/node/themes/generate-theme-name.js +0 -0
- /package/dist/{public → private}/node/themes/replace-invalid-characters.d.ts +0 -0
- /package/dist/{public → private}/node/themes/replace-invalid-characters.js +0 -0
- /package/dist/{public → private}/node/themes/themes-api/headers.d.ts +0 -0
- /package/dist/{public → private}/node/themes/themes-api/headers.js +0 -0
- /package/dist/{public → private}/node/themes/themes-api/retry.d.ts +0 -0
- /package/dist/{public → private}/node/themes/themes-api/retry.js +0 -0
- /package/dist/{public → private}/node/themes/themes-api/throttler.d.ts +0 -0
- /package/dist/{public → private}/node/themes/themes-api/throttler.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A set of utilities, interfaces, and models that are common across all the platform features",
|
|
6
6
|
"keywords": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@bugsnag/js": "7.16.7",
|
|
79
79
|
"@iarna/toml": "2.2.5",
|
|
80
|
-
"@oclif/core": "1.
|
|
80
|
+
"@oclif/core": "2.1.4",
|
|
81
81
|
"@types/archiver": "5.3.1",
|
|
82
82
|
"abort-controller": "3.0.0",
|
|
83
83
|
"ansi-escapes": "6.0.0",
|
|
@@ -109,18 +109,15 @@
|
|
|
109
109
|
"ink": "3.2.0",
|
|
110
110
|
"is-interactive": "2.0.0",
|
|
111
111
|
"js-yaml": "4.1.0",
|
|
112
|
-
"keytar": "7.9.0",
|
|
113
112
|
"kill-port-process": "3.1.0",
|
|
114
113
|
"latest-version": "7.0.0",
|
|
115
|
-
"liquidjs": "
|
|
114
|
+
"liquidjs": "10.5.0",
|
|
116
115
|
"lodash": "4.17.21",
|
|
117
|
-
"log-update": "4.0.0",
|
|
118
116
|
"macaddress": "0.5.3",
|
|
119
117
|
"node-abort-controller": "3.0.1",
|
|
120
118
|
"node-fetch": "3.2.4",
|
|
121
119
|
"open": "8.4.0",
|
|
122
120
|
"pathe": "1.0.0",
|
|
123
|
-
"prettier": "2.7.1",
|
|
124
121
|
"react": "17.0.2",
|
|
125
122
|
"semver": "7.3.6",
|
|
126
123
|
"simple-git": "3.16.0",
|
|
@@ -148,6 +145,8 @@
|
|
|
148
145
|
"@vitest/coverage-istanbul": "^0.26.3",
|
|
149
146
|
"ink-testing-library": "^2.1.0",
|
|
150
147
|
"node-stream-zip": "^1.15.0",
|
|
148
|
+
"typedoc": "^0.23.25",
|
|
149
|
+
"typescript": "4.9.4",
|
|
151
150
|
"vite": "^2.9.13",
|
|
152
151
|
"vitest": "^0.26.3"
|
|
153
152
|
},
|
|
@@ -167,6 +166,8 @@
|
|
|
167
166
|
"scripts": {
|
|
168
167
|
"build": "nx build",
|
|
169
168
|
"clean": "nx clean",
|
|
169
|
+
"docs:generate": "nx docs:generate",
|
|
170
|
+
"docs:open": "nx docs:open",
|
|
170
171
|
"lint": "nx lint",
|
|
171
172
|
"lint:ruby": "nx lint:ruby",
|
|
172
173
|
"lint:js": "nx lint:js",
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
shopify-cli (2.34.0)
|
|
5
|
-
bugsnag (~> 6.22)
|
|
6
|
-
listen (~> 3.7.0)
|
|
7
|
-
theme-check (~> 1.14.0)
|
|
8
|
-
|
|
9
|
-
GEM
|
|
10
|
-
remote: https://rubygems.org/
|
|
11
|
-
specs:
|
|
12
|
-
addressable (2.8.0)
|
|
13
|
-
public_suffix (>= 2.0.2, < 5.0)
|
|
14
|
-
ansi (1.5.0)
|
|
15
|
-
ast (2.4.2)
|
|
16
|
-
bugsnag (6.24.2)
|
|
17
|
-
concurrent-ruby (~> 1.0)
|
|
18
|
-
builder (3.2.4)
|
|
19
|
-
byebug (11.1.3)
|
|
20
|
-
coderay (1.1.3)
|
|
21
|
-
colorize (0.8.1)
|
|
22
|
-
concurrent-ruby (1.1.10)
|
|
23
|
-
crack (0.4.5)
|
|
24
|
-
rexml
|
|
25
|
-
cucumber (7.0.0)
|
|
26
|
-
builder (~> 3.2, >= 3.2.4)
|
|
27
|
-
cucumber-core (~> 10.0, >= 10.0.1)
|
|
28
|
-
cucumber-create-meta (~> 6.0, >= 6.0.1)
|
|
29
|
-
cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
|
|
30
|
-
cucumber-gherkin (~> 20.0, >= 20.0.1)
|
|
31
|
-
cucumber-html-formatter (~> 16.0, >= 16.0.1)
|
|
32
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
|
33
|
-
cucumber-wire (~> 6.0, >= 6.0.1)
|
|
34
|
-
diff-lcs (~> 1.4, >= 1.4.4)
|
|
35
|
-
mime-types (~> 3.3, >= 3.3.1)
|
|
36
|
-
multi_test (~> 0.1, >= 0.1.2)
|
|
37
|
-
sys-uname (~> 1.2, >= 1.2.2)
|
|
38
|
-
cucumber-core (10.0.1)
|
|
39
|
-
cucumber-gherkin (~> 20.0, >= 20.0.1)
|
|
40
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
|
41
|
-
cucumber-tag-expressions (~> 3.0, >= 3.0.1)
|
|
42
|
-
cucumber-create-meta (6.0.1)
|
|
43
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
|
44
|
-
sys-uname (~> 1.2, >= 1.2.2)
|
|
45
|
-
cucumber-cucumber-expressions (12.1.3)
|
|
46
|
-
cucumber-gherkin (20.0.1)
|
|
47
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
|
48
|
-
cucumber-html-formatter (16.0.1)
|
|
49
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
|
50
|
-
cucumber-messages (17.1.1)
|
|
51
|
-
cucumber-tag-expressions (3.0.1)
|
|
52
|
-
cucumber-wire (6.1.1)
|
|
53
|
-
cucumber-core (~> 10.0, >= 10.0.1)
|
|
54
|
-
cucumber-cucumber-expressions (~> 12.1, >= 12.1.2)
|
|
55
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
|
56
|
-
diff-lcs (1.4.4)
|
|
57
|
-
fakefs (1.3.2)
|
|
58
|
-
faraday (1.10.0)
|
|
59
|
-
faraday-em_http (~> 1.0)
|
|
60
|
-
faraday-em_synchrony (~> 1.0)
|
|
61
|
-
faraday-excon (~> 1.1)
|
|
62
|
-
faraday-httpclient (~> 1.0)
|
|
63
|
-
faraday-multipart (~> 1.0)
|
|
64
|
-
faraday-net_http (~> 1.0)
|
|
65
|
-
faraday-net_http_persistent (~> 1.0)
|
|
66
|
-
faraday-patron (~> 1.0)
|
|
67
|
-
faraday-rack (~> 1.0)
|
|
68
|
-
faraday-retry (~> 1.0)
|
|
69
|
-
ruby2_keywords (>= 0.0.4)
|
|
70
|
-
faraday-em_http (1.0.0)
|
|
71
|
-
faraday-em_synchrony (1.0.0)
|
|
72
|
-
faraday-excon (1.1.0)
|
|
73
|
-
faraday-httpclient (1.0.1)
|
|
74
|
-
faraday-multipart (1.0.3)
|
|
75
|
-
multipart-post (>= 1.2, < 3)
|
|
76
|
-
faraday-net_http (1.0.1)
|
|
77
|
-
faraday-net_http_persistent (1.2.0)
|
|
78
|
-
faraday-patron (1.0.0)
|
|
79
|
-
faraday-rack (1.0.0)
|
|
80
|
-
faraday-retry (1.0.3)
|
|
81
|
-
ffi (1.15.4)
|
|
82
|
-
hashdiff (1.0.1)
|
|
83
|
-
iniparse (1.5.0)
|
|
84
|
-
liquid (5.4.0)
|
|
85
|
-
listen (3.7.1)
|
|
86
|
-
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
87
|
-
rb-inotify (~> 0.9, >= 0.9.10)
|
|
88
|
-
method_source (1.0.0)
|
|
89
|
-
mime-types (3.3.1)
|
|
90
|
-
mime-types-data (~> 3.2015)
|
|
91
|
-
mime-types-data (3.2021.0901)
|
|
92
|
-
mini_portile2 (2.8.1)
|
|
93
|
-
minitest (5.14.4)
|
|
94
|
-
minitest-fail-fast (0.1.0)
|
|
95
|
-
minitest (~> 5)
|
|
96
|
-
minitest-reporters (1.4.3)
|
|
97
|
-
ansi
|
|
98
|
-
builder
|
|
99
|
-
minitest (>= 5.0)
|
|
100
|
-
ruby-progressbar
|
|
101
|
-
mocha (1.13.0)
|
|
102
|
-
multi_test (0.1.2)
|
|
103
|
-
multipart-post (2.1.1)
|
|
104
|
-
nokogiri (1.13.10)
|
|
105
|
-
mini_portile2 (~> 2.8.0)
|
|
106
|
-
racc (~> 1.4)
|
|
107
|
-
octokit (4.22.0)
|
|
108
|
-
faraday (>= 0.9)
|
|
109
|
-
sawyer (~> 0.8.0, >= 0.5.3)
|
|
110
|
-
parallel (1.21.0)
|
|
111
|
-
parser (3.2.0.0)
|
|
112
|
-
ast (~> 2.4.1)
|
|
113
|
-
pry (0.13.1)
|
|
114
|
-
coderay (~> 1.1)
|
|
115
|
-
method_source (~> 1.0)
|
|
116
|
-
pry-byebug (3.9.0)
|
|
117
|
-
byebug (~> 11.0)
|
|
118
|
-
pry (~> 0.13.0)
|
|
119
|
-
public_suffix (4.0.6)
|
|
120
|
-
racc (1.6.2)
|
|
121
|
-
rack (2.2.3.1)
|
|
122
|
-
rainbow (3.1.1)
|
|
123
|
-
rake (13.0.6)
|
|
124
|
-
rb-fsevent (0.11.1)
|
|
125
|
-
rb-inotify (0.10.1)
|
|
126
|
-
ffi (~> 1.0)
|
|
127
|
-
regexp_parser (2.2.0)
|
|
128
|
-
rexml (3.2.5)
|
|
129
|
-
rubocop (1.25.1)
|
|
130
|
-
parallel (~> 1.10)
|
|
131
|
-
parser (>= 3.1.0.0)
|
|
132
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
133
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
134
|
-
rexml
|
|
135
|
-
rubocop-ast (>= 1.15.1, < 2.0)
|
|
136
|
-
ruby-progressbar (~> 1.7)
|
|
137
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
|
138
|
-
rubocop-ast (1.15.1)
|
|
139
|
-
parser (>= 3.0.1.1)
|
|
140
|
-
rubocop-minitest (0.10.1)
|
|
141
|
-
rubocop (>= 0.87)
|
|
142
|
-
rubocop-rake (0.5.1)
|
|
143
|
-
rubocop
|
|
144
|
-
rubocop-shopify (2.0.1)
|
|
145
|
-
rubocop (~> 1.11)
|
|
146
|
-
ruby-progressbar (1.11.0)
|
|
147
|
-
ruby2_keywords (0.0.5)
|
|
148
|
-
sawyer (0.8.2)
|
|
149
|
-
addressable (>= 2.3.5)
|
|
150
|
-
faraday (> 0.8, < 2.0)
|
|
151
|
-
sys-uname (1.2.2)
|
|
152
|
-
ffi (~> 1.1)
|
|
153
|
-
theme-check (1.14.0)
|
|
154
|
-
liquid (>= 5.4.0)
|
|
155
|
-
nokogiri (>= 1.12)
|
|
156
|
-
parser (~> 3)
|
|
157
|
-
timecop (0.9.4)
|
|
158
|
-
unicode-display_width (2.1.0)
|
|
159
|
-
webmock (3.9.3)
|
|
160
|
-
addressable (>= 2.3.6)
|
|
161
|
-
crack (>= 0.3.2)
|
|
162
|
-
hashdiff (>= 0.4.0, < 2.0.0)
|
|
163
|
-
|
|
164
|
-
PLATFORMS
|
|
165
|
-
ruby
|
|
166
|
-
|
|
167
|
-
DEPENDENCIES
|
|
168
|
-
bundler (~> 2.3.11)
|
|
169
|
-
byebug
|
|
170
|
-
colorize (~> 0.8.1)
|
|
171
|
-
cucumber (~> 7.0)
|
|
172
|
-
fakefs (>= 1.0)
|
|
173
|
-
iniparse (~> 1.5)
|
|
174
|
-
minitest (>= 5.0.0)
|
|
175
|
-
minitest-fail-fast
|
|
176
|
-
minitest-reporters
|
|
177
|
-
mocha
|
|
178
|
-
octokit (~> 4.0)
|
|
179
|
-
pry-byebug
|
|
180
|
-
rack
|
|
181
|
-
rake
|
|
182
|
-
rubocop-minitest
|
|
183
|
-
rubocop-rake
|
|
184
|
-
rubocop-shopify
|
|
185
|
-
shopify-cli!
|
|
186
|
-
timecop
|
|
187
|
-
webmock
|
|
188
|
-
|
|
189
|
-
BUNDLED WITH
|
|
190
|
-
2.3.20
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetches secured content from the system's keychain.
|
|
3
|
-
* @param identifier - Identifier to identify the content.
|
|
4
|
-
* @returns A promise that resolves with the content or null if it doesn't exist.
|
|
5
|
-
*/
|
|
6
|
-
export declare function secureStoreFetch(identifier: string): Promise<string | null>;
|
|
7
|
-
/**
|
|
8
|
-
* Securely stores the content under the given key.
|
|
9
|
-
* @param identifier - Identifier to identify the content.
|
|
10
|
-
* @param content - The content to be stored.
|
|
11
|
-
* @returns A promise that resolves when the storing completes.
|
|
12
|
-
*/
|
|
13
|
-
export declare function secureStoreSave(identifier: string, content: string): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Removes the content with the given identifier.
|
|
16
|
-
* @param identifier - Identifier to identify the content.
|
|
17
|
-
* @returns A promise that resolves with true if the content was deleted.
|
|
18
|
-
*/
|
|
19
|
-
export declare function secureStoreRemove(identifier: string): Promise<boolean>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { keychainConstants } from './constants.js';
|
|
2
|
-
import { outputContent, outputDebug } from '../../public/node/output.js';
|
|
3
|
-
import { AbortError } from '../../public/node/error.js';
|
|
4
|
-
/**
|
|
5
|
-
* Fetches secured content from the system's keychain.
|
|
6
|
-
* @param identifier - Identifier to identify the content.
|
|
7
|
-
* @returns A promise that resolves with the content or null if it doesn't exist.
|
|
8
|
-
*/
|
|
9
|
-
export async function secureStoreFetch(identifier) {
|
|
10
|
-
outputDebug(outputContent `Reading ${identifier} from the secure store...`);
|
|
11
|
-
try {
|
|
12
|
-
const keytar = await import('keytar');
|
|
13
|
-
const content = await keytar.getPassword(keychainConstants.service, identifier);
|
|
14
|
-
return content;
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
throw createAbort(error, 'Unable to read from the secure store');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Securely stores the content under the given key.
|
|
22
|
-
* @param identifier - Identifier to identify the content.
|
|
23
|
-
* @param content - The content to be stored.
|
|
24
|
-
* @returns A promise that resolves when the storing completes.
|
|
25
|
-
*/
|
|
26
|
-
export async function secureStoreSave(identifier, content) {
|
|
27
|
-
outputDebug(outputContent `Updating ${identifier} in the secure store with new content...`);
|
|
28
|
-
try {
|
|
29
|
-
const keytar = await import('keytar');
|
|
30
|
-
await keytar.default.setPassword(keychainConstants.service, identifier, content);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
throw createAbort(error, 'Unable to update the secure store');
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Removes the content with the given identifier.
|
|
38
|
-
* @param identifier - Identifier to identify the content.
|
|
39
|
-
* @returns A promise that resolves with true if the content was deleted.
|
|
40
|
-
*/
|
|
41
|
-
export async function secureStoreRemove(identifier) {
|
|
42
|
-
outputDebug(outputContent `Removing ${identifier} from the secure store...`);
|
|
43
|
-
try {
|
|
44
|
-
const keytar = await import('keytar');
|
|
45
|
-
const result = await keytar.default.deletePassword(keychainConstants.service, identifier);
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
throw createAbort(error, 'Unable to remove from the secure store');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function createAbort(error, message) {
|
|
53
|
-
let newMessage = message;
|
|
54
|
-
let stack = '';
|
|
55
|
-
if (error instanceof Error) {
|
|
56
|
-
newMessage = message.concat(`: ${error.message}`);
|
|
57
|
-
stack = error.stack;
|
|
58
|
-
}
|
|
59
|
-
const abort = new AbortError(newMessage);
|
|
60
|
-
abort.stack = stack;
|
|
61
|
-
return abort;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=secure-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secure-store.js","sourceRoot":"","sources":["../../../src/private/node/secure-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AAErD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAkB;IACvD,WAAW,CAAC,aAAa,CAAA,WAAW,UAAU,2BAA2B,CAAC,CAAA;IAC1E,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QAC/E,OAAO,OAAO,CAAA;KACf;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,WAAW,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAA;KACjE;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,UAAkB,EAAE,OAAe;IACvE,WAAW,CAAC,aAAa,CAAA,YAAY,UAAU,0CAA0C,CAAC,CAAA;IAC1F,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAA;QACrC,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;KACjF;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,WAAW,CAAC,KAAK,EAAE,mCAAmC,CAAC,CAAA;KAC9D;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAAkB;IACxD,WAAW,CAAC,aAAa,CAAA,YAAY,UAAU,2BAA2B,CAAC,CAAA;IAC3E,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAA;QACrC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACzF,OAAO,MAAM,CAAA;KACd;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,WAAW,CAAC,KAAK,EAAE,wCAAwC,CAAC,CAAA;KACnE;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,OAAe;IAClD,IAAI,UAAU,GAAG,OAAO,CAAA;IACxB,IAAI,KAAK,GAAuB,EAAE,CAAA;IAClC,IAAI,KAAK,YAAY,KAAK,EAAE;QAC1B,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QACjD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;KACpB;IACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAA;IACxC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;IACnB,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["import {keychainConstants} from './constants.js'\nimport {outputContent, outputDebug} from '../../public/node/output.js'\nimport {AbortError} from '../../public/node/error.js'\n\n/**\n * Fetches secured content from the system's keychain.\n * @param identifier - Identifier to identify the content.\n * @returns A promise that resolves with the content or null if it doesn't exist.\n */\nexport async function secureStoreFetch(identifier: string): Promise<string | null> {\n outputDebug(outputContent`Reading ${identifier} from the secure store...`)\n try {\n const keytar = await import('keytar')\n const content = await keytar.getPassword(keychainConstants.service, identifier)\n return content\n } catch (error) {\n throw createAbort(error, 'Unable to read from the secure store')\n }\n}\n\n/**\n * Securely stores the content under the given key.\n * @param identifier - Identifier to identify the content.\n * @param content - The content to be stored.\n * @returns A promise that resolves when the storing completes.\n */\nexport async function secureStoreSave(identifier: string, content: string): Promise<void> {\n outputDebug(outputContent`Updating ${identifier} in the secure store with new content...`)\n try {\n const keytar = await import('keytar')\n await keytar.default.setPassword(keychainConstants.service, identifier, content)\n } catch (error) {\n throw createAbort(error, 'Unable to update the secure store')\n }\n}\n\n/**\n * Removes the content with the given identifier.\n * @param identifier - Identifier to identify the content.\n * @returns A promise that resolves with true if the content was deleted.\n */\nexport async function secureStoreRemove(identifier: string): Promise<boolean> {\n outputDebug(outputContent`Removing ${identifier} from the secure store...`)\n try {\n const keytar = await import('keytar')\n const result = await keytar.default.deletePassword(keychainConstants.service, identifier)\n return result\n } catch (error) {\n throw createAbort(error, 'Unable to remove from the secure store')\n }\n}\n\nfunction createAbort(error: unknown, message: string) {\n let newMessage = message\n let stack: string | undefined = ''\n if (error instanceof Error) {\n newMessage = message.concat(`: ${error.message}`)\n stack = error.stack\n }\n const abort = new AbortError(newMessage)\n abort.stack = stack\n return abort\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../src/public/node/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,KAAK,IAAI,OAAO,EAAC,CAAA","sourcesContent":["import chalk from 'chalk'\n\nexport {chalk as default}\n"]}
|
package/dist/public/node/conf.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conf.js","sourceRoot":"","sources":["../../../src/public/node/conf.ts"],"names":[],"mappings":"AAAA,OAAO,IAAc,MAAM,MAAM,CAAA;AAEjC,OAAO,EAAC,IAAI,EAAS,CAAA","sourcesContent":["import Conf, {Schema} from 'conf'\n\nexport {Conf, Schema}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/public/node/semver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,QAAQ,CAAA;AAEpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAE1C,OAAO,EAAC,MAAM,IAAI,OAAO,EAAC,CAAA;AAC1B,OAAO,EAAC,MAAM,IAAI,mBAAmB,EAAC,CAAA","sourcesContent":["import {createRequire} from 'module'\n\nconst require = createRequire(import.meta.url)\nconst {coerce, SemVer} = require('semver')\n\nexport {SemVer as Version}\nexport {coerce as coerceSemverVersion}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-theme-name.js","sourceRoot":"","sources":["../../../../src/public/node/themes/generate-theme-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAC,WAAW,EAAC,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAA;AAE3B,MAAM,cAAc,GAAG,EAAE,CAAA;AAEzB,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,qBAAqB,GAAG,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAA;IACvD,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE3C,MAAM,IAAI,GAAG,GAAG,OAAO,KAAK,CAAA;IAC5B,MAAM,sBAAsB,GAAG,cAAc,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IACzE,MAAM,UAAU,GAAG,wBAAwB,CAAC,GAAG,IAAI,IAAI,qBAAqB,CAAC,SAAS,CAAC,CAAC,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAA;IACpH,OAAO,GAAG,OAAO,KAAK,UAAU,GAAG,CAAA;AACrC,CAAC","sourcesContent":["import {replaceInvalidCharacters} from './replace-invalid-characters.js'\nimport {randomBytes} from 'crypto'\nimport {hostname} from 'os'\n\nconst API_NAME_LIMIT = 50\n\nexport function generateThemeName(context: string): string {\n const hostNameWithoutDomain = hostname().split('.')[0]!\n const hash = randomBytes(3).toString('hex')\n\n const name = `${context} ()`\n const hostNameCharacterLimit = API_NAME_LIMIT - name.length - hash.length\n const identifier = replaceInvalidCharacters(`${hash}-${hostNameWithoutDomain.substring(0, hostNameCharacterLimit)}`)\n return `${context} (${identifier})`\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replace-invalid-characters.js","sourceRoot":"","sources":["../../../../src/public/node/themes/replace-invalid-characters.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,wBAAwB,CAAC,UAAkB;IACzD,MAAM,cAAc,GAAG,GAAG,CAAA;IAC1B,MAAM,qBAAqB,GAAG,GAAG,CAAA;IACjC,OAAO,UAAU,CAAC,OAAO,CACvB,IAAI,MAAM,CAAC,kCAAkC,EAAE,GAAG,cAAc,GAAG,qBAAqB,EAAE,CAAC,EAC3F,GAAG,CACJ,CAAA;AACH,CAAC","sourcesContent":["export function replaceInvalidCharacters(identifier: string) {\n const findAllMatches = 'g'\n const enablesUnicodeSupport = 'u'\n return identifier.replace(\n new RegExp(/[^\\p{Letter}\\p{Number}\\p{Mark}-]/, `${findAllMatches}${enablesUnicodeSupport}`),\n '-',\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../../../../src/public/node/themes/themes-api/headers.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAA;AAE1D,MAAM,UAAU,UAAU,CAAC,QAAsB;IAC/C,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;IACrD,MAAM,UAAU,GAAG,WAAW,CAAC,aAAa,CAAC,CAAA;IAE7C,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CAAC,CAAA;KACT;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAsB;IACjD,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAA;IAEtE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY;SAC/B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;SAC9B,MAAM,CAAC,OAAO,CAAC,CAAA;IAElB,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;QACnB,OAAM;KACP;IAED,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACtB,CAAC;AAED,SAAS,MAAM,CAAC,QAAsB,EAAE,IAAY;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;IAChC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B,IAAI,MAAM,EAAE,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;KACvB;IAED,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import {RestResponse} from '@shopify/cli-kit/node/api/admin'\nimport {tryParseInt} from '@shopify/cli-kit/common/string'\n\nexport function retryAfter(response: RestResponse): number {\n const retryAfterStr = header(response, 'retry-after')\n const retryAfter = tryParseInt(retryAfterStr)\n\n if (!retryAfter) {\n return 0\n }\n\n return retryAfter\n}\n\nexport function apiCallLimit(response: RestResponse): [number, number] | undefined {\n const apiCallLimit = header(response, 'x-shopify-shop-api-call-limit')\n\n const [used, limit] = apiCallLimit\n .split('/')\n .map((num) => tryParseInt(num))\n .filter(Boolean)\n\n if (!used || !limit) {\n return\n }\n\n return [used, limit]\n}\n\nfunction header(response: RestResponse, name: string): string {\n const headers = response.headers\n const header = headers[name]\n\n if (header?.length === 1) {\n return header[0] ?? ''\n }\n\n return ''\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../../../src/public/node/themes/themes-api/retry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,KAAK,CAAI,SAAkB,EAAE,UAAkB;IACnE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QACzC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,UAAU,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["export async function retry<T>(operation: () => T, retryDelay: number) {\n return new Promise<T>((resolve, _reject) => {\n setTimeout(() => resolve(operation()), retryDelay)\n })\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"throttler.js","sourceRoot":"","sources":["../../../../../src/public/node/themes/themes-api/throttler.ts"],"names":[],"mappings":"AAAA,MAAM,+BAA+B,GAAG,CAAC,CAAA;AACzC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAE9B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAI,OAAgB;IAChD,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QACzC,MAAM,cAAc,GAAG,GAAG,EAAE;YAC1B,eAAe,EAAE,CAAC,cAAc,IAAI,CAAC,CAAA;YACrC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;QACpB,CAAC,CAAA;QAED;;;;;;;WAOG;QACH,MAAM,gBAAgB,GAAG,GAAG,EAAE;YAC5B,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBACzB,iBAAiB,CAAC,cAAc,CAAC,CAAA;gBACjC,OAAM;aACP;YAED,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,CAAA;QAC3D,CAAC,CAAA;QAED;;;;;;WAMG;QACH,MAAM,iBAAiB,GAAG,CAAC,OAAmB,EAAE,EAAE;YAChD,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBACzB,OAAO,EAAE,CAAA;gBACT,OAAM;aACP;YAED,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAA;QAC7D,CAAC,CAAA;QAED;;WAEG;QACH,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;IACrC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;QACd,eAAe,EAAE,CAAC,cAAc,IAAI,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,SAAuC;IACxE,IAAI,CAAC,SAAS,EAAE;QACd,OAAM;KACP;IAED,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,SAAS,CAAA;IAE/B,iBAAiB,EAAE,CAAC,YAAY,GAAG,EAAC,IAAI,EAAE,KAAK,EAAC,CAAA;AAClD,CAAC;AAED,SAAS,kBAAkB;IACzB,OAAO,eAAe,EAAE,CAAC,cAAc,GAAG,+BAA+B,CAAA;AAC3E,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,iBAAiB,EAAE,CAAC,YAAY,CAAA;IACtD,OAAO,IAAI,IAAI,KAAK,GAAG,oBAAoB,CAAA;AAC7C,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,eAAe,EAAE,CAAC,iBAAiB,CAAA;AAC5C,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,eAAe;IACtB,OAAO,CACL,gBAAgB;QAChB,CAAC,gBAAgB,GAAG;YAClB,cAAc,EAAE,CAAC;YACjB,iBAAiB,EAAE;gBACjB,YAAY,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;aACnC;SACF,CAAC,CACH,CAAA;AACH,CAAC;AAED,IAAI,gBAUH,CAAA","sourcesContent":["const MAX_NUMBER_OF_PARALLEL_REQUESTS = 5\nconst MARGIN_TO_RATE_LIMIT = 5\n\nexport async function throttle<T>(request: () => T) {\n return new Promise<T>((resolve, _reject) => {\n const performRequest = () => {\n throttlingState().requestCounter += 1\n resolve(request())\n }\n\n /**\n * Performs the {@link performRequest} taking into account the\n * limit of parallel requests only when the API limit has not\n * been reached.\n *\n * Otherwise, performs the request to get the updated API limit\n * headers, so throttler parameters get updates.\n */\n const throttleByHeader = () => {\n if (!isReachingApiLimit()) {\n throttleByCounter(performRequest)\n return\n }\n\n setTimeout(() => throttleByCounter(performRequest), 4000)\n }\n\n /**\n * Performs the {@link command} only when the the limit\n * of parallel request has not been reached.\n *\n * Otherwise, defers the execution to the {@link throttleByHeader},\n * still respecting the limit of parallel requests.\n */\n const throttleByCounter = (command: () => void) => {\n if (!hasTooManyRequests()) {\n command()\n return\n }\n\n setTimeout(() => throttleByCounter(throttleByHeader), 1000)\n }\n\n /**\n * Start throttling by counter to get the API limit headers.\n */\n throttleByCounter(throttleByHeader)\n }).finally(() => {\n throttlingState().requestCounter -= 1\n })\n}\n\nexport function updateApiCallLimit(callLimit: [number, number] | undefined) {\n if (!callLimit) {\n return\n }\n\n const [used, limit] = callLimit\n\n latestRequestInfo().apiCallLimit = {used, limit}\n}\n\nfunction hasTooManyRequests() {\n return throttlingState().requestCounter > MAX_NUMBER_OF_PARALLEL_REQUESTS\n}\n\nfunction isReachingApiLimit() {\n const {used, limit} = latestRequestInfo().apiCallLimit\n return used >= limit - MARGIN_TO_RATE_LIMIT\n}\n\nfunction latestRequestInfo() {\n return throttlingState().latestRequestInfo\n}\n\n/**\n * Even considering the Stateless modules convention,\n * tracking information about the latest request is\n * critical to optimize the request throttler efficiently.\n *\n * Thus, in this case, this module deliberately avoids\n * IO cost and uses the `_throttlingState` instance for\n * that purpose.\n */\nfunction throttlingState() {\n return (\n _throttlingState ??\n (_throttlingState = {\n requestCounter: 0,\n latestRequestInfo: {\n apiCallLimit: {used: 0, limit: 40},\n },\n })\n )\n}\n\nlet _throttlingState: {\n /**\n * Number of parallel requests */\n requestCounter: number\n\n /**\n * Latest request information */\n latestRequestInfo: {\n apiCallLimit: {used: number; limit: number}\n }\n}\n"]}
|
package/dist/store/schema.d.ts
DELETED
package/dist/store/schema.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const schema = {
|
|
2
|
-
appInfo: {
|
|
3
|
-
type: 'array',
|
|
4
|
-
items: {
|
|
5
|
-
type: 'object',
|
|
6
|
-
properties: {
|
|
7
|
-
appId: {
|
|
8
|
-
type: 'string',
|
|
9
|
-
},
|
|
10
|
-
title: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
},
|
|
13
|
-
orgId: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
},
|
|
16
|
-
storeFqdn: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
},
|
|
19
|
-
directory: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export default schema;
|
|
27
|
-
//# sourceMappingURL=schema.js.map
|
package/dist/store/schema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/store/schema.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE;QACP,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CACF,CAAA;AAED,eAAe,MAAM,CAAA","sourcesContent":["import type {Schema} from 'conf'\n\nconst schema: Schema<unknown> = {\n appInfo: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n appId: {\n type: 'string',\n },\n title: {\n type: 'string',\n },\n orgId: {\n type: 'string',\n },\n storeFqdn: {\n type: 'string',\n },\n directory: {\n type: 'string',\n },\n },\n },\n },\n}\n\nexport default schema\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|