Skip to content

Commit 48310bd

Browse files
committed
username max length 20
1 parent 9ef0256 commit 48310bd

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ List account permissions with user-friendly descriptions. Some permissions (such
295295

296296
Replace account identity. Requires token with scope `account.details.identity.update`.
297297

298-
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
298+
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
299299
- `name` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> Your full name. Set to `null` to remove.
300300
- Returns: <code>[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Cloudnode.ApiResponse](#class-cloudnodeapiresponset)&lt;[Cloudnode.AccountIdentity](#interface-cloudnodeaccountidentity)>></code>
301301
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "RESOURCE_NOT_FOUND"}</code>
@@ -329,7 +329,7 @@ Set your primary e-mail address. Requires token with scope `account.details.emai
329329

330330
Update account identity. Requires token with scope `account.details.identity.update`.
331331

332-
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
332+
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
333333
- `name` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> Your full name. Set to `null` to remove.
334334
- Returns: <code>[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Cloudnode.ApiResponse](#class-cloudnodeapiresponset)&lt;[Cloudnode.AccountIdentity](#interface-cloudnodeaccountidentity) | [void](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)>></code> `void` if nothing was changed.
335335
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "RESOURCE_NOT_FOUND"}</code>
@@ -366,7 +366,7 @@ Create an account and session. After signing up, a welcome e-mail is sent to con
366366

367367
> **Note**: Registering an account can only be performed from residential IP. Proxying this endpoint will likely not work. Creating multiple/alternate accounts is not allowed as per the Terms of Service.
368368
369-
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The username to use for the account. Must be between 3 and 32 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.
369+
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The username to use for the account. Must be between 3 and 20 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.
370370
- `email` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The e-mail address to register. A valid unique non-disposable e-mail that can receive mail is required.
371371
- `password` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The password to use for the account. Must be at least 15 characters, or 8 characters if it contains a mix of letters, numbers and symbols.
372372
- Returns: <code>[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Cloudnode.ApiResponse](#class-cloudnodeapiresponset)&lt;{session: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>></code> Session token. Also returned in `Set-Cookie` header.

browser/Cloudnode.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ class Cloudnode {
410410
411411
> **Note**: Registering an account can only be performed from residential IP. Proxying this endpoint will likely not work. Creating multiple/alternate accounts is not allowed as per the Terms of Service.
412412
* @POST /auth/register
413-
* @param username The username to use for the account. Must be between 3 and 32 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.
413+
* @param username The username to use for the account. Must be between 3 and 20 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.
414414
* @param email The e-mail address to register. A valid unique non-disposable e-mail that can receive mail is required.
415415
* @param password The password to use for the account. Must be at least 15 characters, or 8 characters if it contains a mix of letters, numbers and symbols.
416416
* @throws {Cloudnode.Error & {code: "INVALID_DATA"}}
@@ -421,7 +421,7 @@ class Cloudnode {
421421
* @returns Session token. Also returned in `Set-Cookie` header.
422422
*/
423423
register: async (username, email, password) => {
424-
return await this.#sendRequest({ "type": "operation", "description": "Create an account and session. After signing up, a welcome e-mail is sent to confirm your e-mail address.\n\n> **Note**: Registering an account can only be performed from residential IP. Proxying this endpoint will likely not work. Creating multiple/alternate accounts is not allowed as per the Terms of Service.", "method": "POST", "path": "/auth/register", "token": null, "parameters": { "body": { "username": { "description": "The username to use for the account. Must be between 3 and 32 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.", "type": "string", "required": true }, "email": { "description": "The e-mail address to register. A valid unique non-disposable e-mail that can receive mail is required.", "type": "string", "required": true }, "password": { "description": "The password to use for the account. Must be at least 15 characters, or 8 characters if it contains a mix of letters, numbers and symbols.", "type": "string", "required": true } } }, "returns": [{ "status": 201, "type": "{session: string}", "description": "Session token. Also returned in `Set-Cookie` header." }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 403, "type": "Error & {code: \"IP_REJECTED\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, email, password });
424+
return await this.#sendRequest({ "type": "operation", "description": "Create an account and session. After signing up, a welcome e-mail is sent to confirm your e-mail address.\n\n> **Note**: Registering an account can only be performed from residential IP. Proxying this endpoint will likely not work. Creating multiple/alternate accounts is not allowed as per the Terms of Service.", "method": "POST", "path": "/auth/register", "token": null, "parameters": { "body": { "username": { "description": "The username to use for the account. Must be between 3 and 20 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.", "type": "string", "required": true }, "email": { "description": "The e-mail address to register. A valid unique non-disposable e-mail that can receive mail is required.", "type": "string", "required": true }, "password": { "description": "The password to use for the account. Must be at least 15 characters, or 8 characters if it contains a mix of letters, numbers and symbols.", "type": "string", "required": true } } }, "returns": [{ "status": 201, "type": "{session: string}", "description": "Session token. Also returned in `Set-Cookie` header." }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 403, "type": "Error & {code: \"IP_REJECTED\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, email, password });
425425
},
426426
/**
427427
* Create a session using user ID/username/e-mail and password.
@@ -470,7 +470,7 @@ class Cloudnode {
470470
/**
471471
* Update account identity
472472
* @PATCH /account/identity
473-
* @param username Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
473+
* @param username Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
474474
* @param name Your full name. Set to `null` to remove.
475475
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
476476
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
@@ -483,12 +483,12 @@ class Cloudnode {
483483
* @returns `void` if nothing was changed.
484484
*/
485485
updateIdentity: async (username, name) => {
486-
return await this.#sendRequest({ "type": "operation", "description": "Update account identity", "token": "account.details.identity.update", "method": "PATCH", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": false } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 204, "type": "void", "description": "`void` if nothing was changed." }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
486+
return await this.#sendRequest({ "type": "operation", "description": "Update account identity", "token": "account.details.identity.update", "method": "PATCH", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": false } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 204, "type": "void", "description": "`void` if nothing was changed." }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
487487
},
488488
/**
489489
* Replace account identity
490490
* @PUT /account/identity
491-
* @param username Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
491+
* @param username Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
492492
* @param name Your full name. Set to `null` to remove.
493493
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
494494
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
@@ -500,7 +500,7 @@ class Cloudnode {
500500
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
501501
*/
502502
replaceIdentity: async (username, name) => {
503-
return await this.#sendRequest({ "type": "operation", "description": "Replace account identity", "token": "account.details.identity.update", "method": "PUT", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": true } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
503+
return await this.#sendRequest({ "type": "operation", "description": "Replace account identity", "token": "account.details.identity.update", "method": "PUT", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": true } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
504504
},
505505
/**
506506
* List account e-mail addresses

browser/Cloudnode.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@
923923
"parameters": {
924924
"body": {
925925
"username": {
926-
"description": "The username to use for the account. Must be between 3 and 32 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.",
926+
"description": "The username to use for the account. Must be between 3 and 20 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.",
927927
"type": "string",
928928
"required": true
929929
},
@@ -1037,7 +1037,7 @@
10371037
"parameters": {
10381038
"body": {
10391039
"username": {
1040-
"description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
1040+
"description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
10411041
"type": "string",
10421042
"required": true
10431043
},
@@ -1081,7 +1081,7 @@
10811081
"parameters": {
10821082
"body": {
10831083
"username": {
1084-
"description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
1084+
"description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
10851085
"type": "string",
10861086
"required": true
10871087
},

src/Cloudnode.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ declare class Cloudnode {
211211
212212
> **Note**: Registering an account can only be performed from residential IP. Proxying this endpoint will likely not work. Creating multiple/alternate accounts is not allowed as per the Terms of Service.
213213
* @POST /auth/register
214-
* @param username The username to use for the account. Must be between 3 and 32 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.
214+
* @param username The username to use for the account. Must be between 3 and 20 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.
215215
* @param email The e-mail address to register. A valid unique non-disposable e-mail that can receive mail is required.
216216
* @param password The password to use for the account. Must be at least 15 characters, or 8 characters if it contains a mix of letters, numbers and symbols.
217217
* @throws {Cloudnode.Error & {code: "INVALID_DATA"}}
@@ -267,7 +267,7 @@ declare class Cloudnode {
267267
/**
268268
* Update account identity
269269
* @PATCH /account/identity
270-
* @param username Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
270+
* @param username Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
271271
* @param name Your full name. Set to `null` to remove.
272272
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
273273
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
@@ -283,7 +283,7 @@ declare class Cloudnode {
283283
/**
284284
* Replace account identity
285285
* @PUT /account/identity
286-
* @param username Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
286+
* @param username Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
287287
* @param name Your full name. Set to `null` to remove.
288288
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
289289
* @throws {Cloudnode.Error & {code: "CONFLICT"}}

0 commit comments

Comments
 (0)