-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use project name rather than
sdk
in sdk snippet (#898)
* feat: use project name rather than `sdk` in sdk snippet * refactor: update `sdk` instances * refactor: add `camelCase` to make it prettier * refactor: DRY up a bit * test: update tests * refactor: add `sdk` as fallback
- Loading branch information
1 parent
21230f8
commit 6024ee0
Showing
33 changed files
with
78 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/alternate-server/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/alternate-server'; | ||
import alternateServer from '@api/alternate-server'; | ||
|
||
sdk.server('http://dev.local/v2'); | ||
sdk.postGlobal() | ||
alternateServer.server('http://dev.local/v2'); | ||
alternateServer.postGlobal() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/application-form-encoded/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/application-form-encoded'; | ||
import applicationFormEncoded from '@api/application-form-encoded'; | ||
|
||
sdk.postAnything({foo: 'bar', hello: 'world'}) | ||
applicationFormEncoded.postAnything({foo: 'bar', hello: 'world'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/application-json/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-apikey-cookie/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-apikey-cookie'; | ||
import authApikeyCookie from '@api/auth-apikey-cookie'; | ||
|
||
sdk.auth('buster'); | ||
sdk.postAnythingApikey() | ||
authApikeyCookie.auth('buster'); | ||
authApikeyCookie.postAnythingApikey() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-apikey-header/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-apikey-header'; | ||
import authApikeyHeader from '@api/auth-apikey-header'; | ||
|
||
sdk.auth('a5a220e'); | ||
sdk.putAnythingApikey() | ||
authApikeyHeader.auth('a5a220e'); | ||
authApikeyHeader.putAnythingApikey() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-basic-full/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-basic-full'; | ||
import authBasicFull from '@api/auth-basic-full'; | ||
|
||
sdk.auth('buster', 'pug'); | ||
sdk.getAPISpecification({perPage: '10', page: '1'}) | ||
authBasicFull.auth('buster', 'pug'); | ||
authBasicFull.getAPISpecification({perPage: '10', page: '1'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-basic-password-only/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-basic-password-only'; | ||
import authBasicPasswordOnly from '@api/auth-basic-password-only'; | ||
|
||
sdk.auth('', 'pug'); | ||
sdk.getAPISpecification({perPage: '10', page: '1'}) | ||
authBasicPasswordOnly.auth('', 'pug'); | ||
authBasicPasswordOnly.getAPISpecification({perPage: '10', page: '1'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-basic-username-only/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-basic-username-only'; | ||
import authBasicUsernameOnly from '@api/auth-basic-username-only'; | ||
|
||
sdk.auth('buster'); | ||
sdk.getAPISpecification({perPage: '10', page: '1'}) | ||
authBasicUsernameOnly.auth('buster'); | ||
authBasicUsernameOnly.getAPISpecification({perPage: '10', page: '1'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-bearer/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-bearer'; | ||
import authBearer from '@api/auth-bearer'; | ||
|
||
sdk.auth('myBearerToken'); | ||
sdk.postAnythingBearer() | ||
authBearer.auth('myBearerToken'); | ||
authBearer.postAnythingBearer() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/auth-query/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/auth-query'; | ||
import authQuery from '@api/auth-query'; | ||
|
||
sdk.auth('a5a220e'); | ||
sdk.getAnythingApikey() | ||
authQuery.auth('a5a220e'); | ||
authQuery.getAnythingApikey() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/cookies/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/cookies'; | ||
import cookies from '@api/cookies'; | ||
|
||
sdk.postAnything({bar: 'baz', foo: 'bar'}) | ||
cookies.postAnything({bar: 'baz', foo: 'bar'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/full-many-query-params/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/full/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/headers/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/headers'; | ||
import headers from '@api/headers'; | ||
|
||
sdk.getAnything({'x-foo': 'Bar', 'x-bar': 'foo', reqKey: 'baz'}) | ||
headers.getAnything({'x-foo': 'Bar', 'x-bar': 'foo', reqKey: 'baz'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/http-insecure/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/http-insecure'; | ||
import httpInsecure from '@api/http-insecure'; | ||
|
||
sdk.getAnything() | ||
httpInsecure.getAnything() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/issue-128/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/issue-128'; | ||
import issue128 from '@api/issue-128'; | ||
|
||
sdk.auth('authKey\'With\'Apostrophes'); | ||
sdk.getItem() | ||
issue128.auth('authKey\'With\'Apostrophes'); | ||
issue128.getItem() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/issue-76/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/issue-76'; | ||
import issue76 from '@api/issue-76'; | ||
|
||
sdk.auth('a5a220e'); | ||
sdk.getPetFindbystatus({status: 'available'}) | ||
issue76.auth('a5a220e'); | ||
issue76.getPetFindbystatus({status: 'available'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/issue-78-operationid/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/issue-78-operationid'; | ||
import issue78Operationid from '@api/issue-78-operationid'; | ||
|
||
sdk.getOrder({orderId: '1234'}) | ||
issue78Operationid.getOrder({orderId: '1234'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/issue-78/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/issue-78'; | ||
import issue78 from '@api/issue-78'; | ||
|
||
sdk.getStoreOrderOrderidTrackingTrackingid({orderId: '1234', trackingId: '5678'}) | ||
issue78.getStoreOrderOrderidTrackingTrackingid({orderId: '1234', trackingId: '5678'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/jsonObj-multiline/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/jsonObj-multiline'; | ||
import jsonObjMultiline from '@api/jsonObj-multiline'; | ||
|
||
sdk.postAnything({foo: 'bar'}) | ||
jsonObjMultiline.postAnything({foo: 'bar'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/jsonObj-null-value/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/jsonObj-null-value'; | ||
import jsonObjNullValue from '@api/jsonObj-null-value'; | ||
|
||
sdk.postAnything({foo: null}) | ||
jsonObjNullValue.postAnything({foo: null}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/multipart-data/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/multipart-data'; | ||
import multipartData from '@api/multipart-data'; | ||
|
||
sdk.postAnything({foo: 'test/__fixtures__/files/hello.txt'}) | ||
multipartData.postAnything({foo: 'test/__fixtures__/files/hello.txt'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/multipart-file/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/multipart-file'; | ||
import multipartFile from '@api/multipart-file'; | ||
|
||
sdk.postAnything({foo: 'test/__fixtures__/files/hello.txt'}) | ||
multipartFile.postAnything({foo: 'test/__fixtures__/files/hello.txt'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/multipart-form-data-no-params/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/multipart-form-data-no-params'; | ||
import multipartFormDataNoParams from '@api/multipart-form-data-no-params'; | ||
|
||
sdk.postAnything() | ||
multipartFormDataNoParams.postAnything() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/multipart-form-data/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/multipart-form-data'; | ||
import multipartFormData from '@api/multipart-form-data'; | ||
|
||
sdk.postAnything({foo: 'bar'}) | ||
multipartFormData.postAnything({foo: 'bar'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/operationid-non-alphanumerical/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/operationid-non-alphanumerical'; | ||
import operationidNonAlphanumerical from '@api/operationid-non-alphanumerical'; | ||
|
||
sdk.auth('123'); | ||
sdk.findPetsByStatus({status: 'available'}) | ||
operationidNonAlphanumerical.auth('123'); | ||
operationidNonAlphanumerical.findPetsByStatus({status: 'available'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/operationid-with-underscores/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/operationid-with-underscores'; | ||
import operationidWithUnderscores from '@api/operationid-with-underscores'; | ||
|
||
sdk.anything_Operation() | ||
operationidWithUnderscores.anything_Operation() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/parameter-special-characters/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/parameter-special-characters'; | ||
import parameterSpecialCharacters from '@api/parameter-special-characters'; | ||
|
||
sdk.getAppIdNumInstalls_reportV5({'app-id': '1234', num: '5678'}) | ||
parameterSpecialCharacters.getAppIdNumInstalls_reportV5({'app-id': '1234', num: '5678'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
6 changes: 3 additions & 3 deletions
6
packages/httpsnippet-client-api/test/__datasets__/petstore/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import sdk from '@api/petstore'; | ||
import petstore from '@api/petstore'; | ||
|
||
sdk.auth('123'); | ||
sdk.findPetsByStatus({status: 'available', accept: 'application/xml'}) | ||
petstore.auth('123'); | ||
petstore.findPetsByStatus({status: 'available', accept: 'application/xml'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/query/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/query'; | ||
import query from '@api/query'; | ||
|
||
sdk.getAnything({foo: ['bar', 'baz'], baz: 'abc', key: 'value'}) | ||
query.getAnything({foo: ['bar', 'baz'], baz: 'abc', key: 'value'}) | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/short/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/short'; | ||
import short from '@api/short'; | ||
|
||
sdk.getAnything() | ||
short.getAnything() | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |
4 changes: 2 additions & 2 deletions
4
packages/httpsnippet-client-api/test/__datasets__/text-plain/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import sdk from '@api/text-plain'; | ||
import textPlain from '@api/text-plain'; | ||
|
||
sdk.postAnything('Hello World') | ||
textPlain.postAnything('Hello World') | ||
.then(({ data }) => console.log(data)) | ||
.catch(err => console.error(err)); |