Skip to content

Commit 2aa165b

Browse files
Copilotcongminh1254
andcommitted
Remove v3 backward compatibility, update fixtures for js-yaml 4.x
Co-authored-by: congminh1254 <[email protected]>
1 parent 1fc574a commit 2aa165b

16 files changed

+17
-24
lines changed

src/box-command.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,6 @@ function formatObject(obj) {
261261
noRefs: true,
262262
});
263263

264-
// js-yaml 4.x changed its quoting behavior for certain strings.
265-
// For backward compatibility with js-yaml 3.x output:
266-
// 1. Quote URLs (http:// or https://)
267-
yamlString = yamlString.replaceAll(/^(\s*)([^:]+): (https?:\/\/[^\s]+)$/gmu, "$1$2: '$3'");
268-
// 2. Unquote numeric strings starting with 0 (js-yaml 3.x didn't quote these)
269-
yamlString = yamlString.replaceAll(/^(\s*)([^:]+): '(0\d+)'$/gmu, '$1$2: $3');
270-
271264
// The YAML library puts a trailing newline at the end of the string, which is
272265
// redundant with the automatic newline added by oclif when writing to stdout
273266
return yamlString

test/fixtures/output/files_share_yaml.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Type: file
22
ID: '1234567890'
33
Shared Link:
4-
URL: 'https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p'
4+
URL: https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p
55
Download URL: >-
66
https://blosserdemoaccount.box.com/shared/static/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p.png
7-
Vanity URL: 'https://app.box.com/v/my-custom-name-123'
7+
Vanity URL: https://app.box.com/v/my-custom-name-123
88
Effective Access: open
99
Is Password Enabled: true
1010
Unshared At: null

test/fixtures/output/files_upload_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Type: file
22
ID: '1234567890'
33
File Version:
44
Type: file_version
5-
ID: 098765432109
5+
ID: '098765432109'
66
SHA1: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33
77
Sequence ID: '0'
88
ETag: '0'

test/fixtures/output/files_versions_upload_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Type: file
22
ID: '1234567890'
33
File Version:
44
Type: file_version
5-
ID: 098765432109
5+
ID: '098765432109'
66
SHA1: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33
77
Sequence ID: '0'
88
ETag: '0'

test/fixtures/output/folders_share_yaml.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Type: folder
22
ID: '0'
33
Shared Link:
4-
URL: 'https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p'
4+
URL: https://blosserdemoaccount.box.com/s/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p
55
Download URL: >-
66
https://blosserdemoaccount.box.com/shared/static/7mcmdlavtye5o5i0ue8xmtwh2sx5bv8p.png
7-
Vanity URL: 'https://app.box.com/v/my-custom-name-123'
7+
Vanity URL: https://app.box.com/v/my-custom-name-123
88
Effective Access: open
99
Is Password Enabled: true
1010
Unshared At: null

test/fixtures/output/users_create_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Status: active
1313
Job Title: ''
1414
Phone: '1234567890'
1515
Address: ''
16-
Avatar URL: 'https://app.box.com/api/avatar/large/deprecated'
16+
Avatar URL: https://app.box.com/api/avatar/large/deprecated

test/fixtures/output/users_get_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Status: active
1313
Job Title: ''
1414
Phone: 555-555-5555
1515
Address: ''
16-
Avatar URL: 'https://app.box.com/api/avatar/large/deprecated'
16+
Avatar URL: https://app.box.com/api/avatar/large/deprecated

test/fixtures/output/users_invite_user_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Status: active
1313
Job Title: ''
1414
Phone: 555-555-5555
1515
Address: ''
16-
Avatar URL: 'https://app.box.com/api/avatar/large/deprecated'
16+
Avatar URL: https://app.box.com/api/avatar/large/deprecated

test/fixtures/output/users_update_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Status: active
1313
Job Title: CEO
1414
Phone: (555) 555-5555
1515
Address: ''
16-
Avatar URL: 'https://app.box.com/api/avatar/large/deprecated'
16+
Avatar URL: https://app.box.com/api/avatar/large/deprecated

test/fixtures/output/web_links_create_yaml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ID: '6743065'
33
Sequence ID: '0'
44
ETag: '0'
55
Name: Box Website!
6-
URL: 'https://www.box.com'
6+
URL: https://www.box.com
77
Created By:
88
Type: user
99
ID: '10523870'

0 commit comments

Comments
 (0)