@cloudcommerce/cli 2.15.8 → 2.16.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.
@@ -125,8 +125,8 @@ printf "\n\n> Configured pull zone \"$pull_zone_id\"\n"
125
125
 
126
126
  configure_edge_rule() {
127
127
  printf "\n"
128
- local description=$1
129
- local rule_data=$2
128
+ local rule_data=$1
129
+ local description=$(echo $rule_data | jq -r '.Description')
130
130
  local found_rule=$(echo $edge_rules | jq --arg description "$description" '.[] | select(.Description == $description)')
131
131
  local guid=$(echo $found_rule | jq -r '.Guid // empty')
132
132
 
@@ -143,7 +143,7 @@ configure_edge_rule() {
143
143
  printf "\n\n> Configured edge rule \"$description\"\n"
144
144
  }
145
145
 
146
- configure_edge_rule "Bypass CDN cache" '
146
+ configure_edge_rule '
147
147
  {
148
148
  "ActionType": 3,
149
149
  "TriggerMatchingType": 0,
@@ -154,19 +154,18 @@ configure_edge_rule "Bypass CDN cache" '
154
154
  "PatternMatchingType": 0,
155
155
  "PatternMatches": [
156
156
  "*/_api/*",
157
- "*/admin/*",
158
- "*/~*"
157
+ "*/admin/*"
159
158
  ]
160
159
  },
161
160
  {
162
161
  "Type": 8,
163
162
  "PatternMatchingType": 0,
164
163
  "PatternMatches": [
165
- "400",
164
+ "500",
165
+ "502",
166
+ "504",
166
167
  "401",
167
- "403",
168
- "404",
169
- "500"
168
+ "403"
170
169
  ]
171
170
  }
172
171
  ],
@@ -175,7 +174,27 @@ configure_edge_rule "Bypass CDN cache" '
175
174
  }
176
175
  '
177
176
 
178
- configure_edge_rule "Reset feeds/app CDN cache" '
177
+ configure_edge_rule '
178
+ {
179
+ "ActionType": 3,
180
+ "TriggerMatchingType": 1,
181
+ "ActionParameter1": "600",
182
+ "Triggers": [
183
+ {
184
+ "Type": 8,
185
+ "PatternMatchingType": 0,
186
+ "PatternMatches": [
187
+ "404",
188
+ "410"
189
+ ]
190
+ }
191
+ ],
192
+ "Description": "Fast cache not founds",
193
+ "Enabled": true
194
+ }
195
+ '
196
+
197
+ configure_edge_rule '
179
198
  {
180
199
  "ActionType": 3,
181
200
  "TriggerMatchingType": 1,
@@ -187,14 +206,16 @@ configure_edge_rule "Reset feeds/app CDN cache" '
187
206
  "PatternMatches": [
188
207
  "*.xml",
189
208
  "*.txt",
190
- "*/app/*"
209
+ "*/app/*",
210
+ "*/~*"
191
211
  ]
192
212
  },
193
213
  {
194
214
  "Type": 8,
195
215
  "PatternMatchingType": 0,
196
216
  "PatternMatches": [
197
- "200"
217
+ "200",
218
+ "404"
198
219
  ]
199
220
  }
200
221
  ],
@@ -203,7 +224,7 @@ configure_edge_rule "Reset feeds/app CDN cache" '
203
224
  }
204
225
  '
205
226
 
206
- configure_edge_rule "Bypass perma-cache" '
227
+ configure_edge_rule '
207
228
  {
208
229
  "ActionType": 15,
209
230
  "TriggerMatchingType": 0,
@@ -232,7 +253,7 @@ configure_edge_rule "Bypass perma-cache" '
232
253
  }
233
254
  '
234
255
 
235
- configure_edge_rule "SSR browser cache" '
256
+ configure_edge_rule '
236
257
  {
237
258
  "ActionType": 16,
238
259
  "ActionParameter1": "120",
@@ -265,7 +286,7 @@ configure_edge_rule "SSR browser cache" '
265
286
  }
266
287
  '
267
288
 
268
- configure_edge_rule "Force mime text/html" '
289
+ configure_edge_rule '
269
290
  {
270
291
  "ActionType": 5,
271
292
  "ActionParameter1": "Content-Type",
@@ -64,9 +64,9 @@ edge_rules=$(echo $response | jq --arg id "$pull_zone_id" '.[] | select(.Id == (
64
64
 
65
65
  configure_edge_rule() {
66
66
  printf "\n"
67
- local description=$1
68
- local rule_data=$2
69
- local is_additional_patterns=${3:-true}
67
+ local rule_data=$1
68
+ local description=$(echo $rule_data | jq -r '.Description')
69
+ local is_additional_patterns=${2:-true}
70
70
  local found_rule=$(echo $edge_rules | jq --arg description "$description" '.[] | select(.Description == $description)')
71
71
  local guid=$(echo $found_rule | jq -r '.Guid // empty')
72
72
 
@@ -155,9 +155,9 @@ ab_testing_perma_bypass_data="
155
155
  \"Enabled\": true
156
156
  }"
157
157
 
158
- configure_edge_rule "A/B testing [$GIT_BRANCH]" "$ab_testing_data"
159
- configure_edge_rule "A/B CDN short cache [$GIT_BRANCH]" "$ab_testing_ttl_data"
160
- configure_edge_rule "A/B perma-cache bypass [$GIT_BRANCH]" "$ab_testing_perma_bypass_data"
158
+ configure_edge_rule "$ab_testing_data"
159
+ configure_edge_rule "$ab_testing_ttl_data"
160
+ configure_edge_rule "$ab_testing_perma_bypass_data"
161
161
 
162
162
  curl --silent --request POST \
163
163
  --url "https://api.bunny.net/purge?url=https://$domain/" \
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "2.15.8",
4
+ "version": "2.16.0",
5
5
  "description": "e-com.plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -36,7 +36,7 @@
36
36
  "md5": "^2.3.0",
37
37
  "typescript": "~5.4.5",
38
38
  "zx": "^7.2.3",
39
- "@cloudcommerce/api": "2.15.8"
39
+ "@cloudcommerce/api": "2.16.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "bash ../../scripts/build-lib.sh"