node-appwrite 18.0.0 → 19.0.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/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/client.mjs.map +1 -1
- package/dist/enums/credit-card.d.mts +1 -1
- package/dist/enums/credit-card.d.ts +1 -1
- package/dist/enums/credit-card.js +1 -1
- package/dist/enums/credit-card.js.map +1 -1
- package/dist/enums/credit-card.mjs +1 -1
- package/dist/enums/credit-card.mjs.map +1 -1
- package/dist/enums/execution-method.d.mts +2 -1
- package/dist/enums/execution-method.d.ts +2 -1
- package/dist/enums/execution-method.js +1 -0
- package/dist/enums/execution-method.js.map +1 -1
- package/dist/enums/execution-method.mjs +1 -0
- package/dist/enums/execution-method.mjs.map +1 -1
- package/dist/enums/index-type.d.mts +2 -1
- package/dist/enums/index-type.d.ts +2 -1
- package/dist/enums/index-type.js +1 -0
- package/dist/enums/index-type.js.map +1 -1
- package/dist/enums/index-type.mjs +1 -0
- package/dist/enums/index-type.mjs.map +1 -1
- package/dist/models.d.mts +250 -4
- package/dist/models.d.ts +250 -4
- package/dist/query.d.mts +128 -8
- package/dist/query.d.ts +128 -8
- package/dist/query.js +123 -3
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +123 -3
- package/dist/query.mjs.map +1 -1
- package/dist/services/account.d.mts +2 -2
- package/dist/services/account.d.ts +2 -2
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +2 -2
- package/dist/services/avatars.d.ts +2 -2
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +202 -1
- package/dist/services/databases.d.ts +202 -1
- package/dist/services/databases.js +318 -9
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +318 -9
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +2 -2
- package/dist/services/functions.d.ts +2 -2
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +195 -0
- package/dist/services/tables-db.d.ts +195 -0
- package/dist/services/tables-db.js +318 -0
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +318 -0
- package/dist/services/tables-db.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ declare class Avatars {
|
|
|
46
46
|
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
47
47
|
*
|
|
48
48
|
*
|
|
49
|
-
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping,
|
|
49
|
+
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
50
50
|
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
51
51
|
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
52
52
|
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
@@ -65,7 +65,7 @@ declare class Avatars {
|
|
|
65
65
|
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
66
66
|
*
|
|
67
67
|
*
|
|
68
|
-
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping,
|
|
68
|
+
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
69
69
|
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
70
70
|
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
71
71
|
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
@@ -46,7 +46,7 @@ declare class Avatars {
|
|
|
46
46
|
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
47
47
|
*
|
|
48
48
|
*
|
|
49
|
-
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping,
|
|
49
|
+
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
50
50
|
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
51
51
|
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
52
52
|
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
@@ -65,7 +65,7 @@ declare class Avatars {
|
|
|
65
65
|
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
66
66
|
*
|
|
67
67
|
*
|
|
68
|
-
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping,
|
|
68
|
+
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
69
69
|
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
70
70
|
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
71
71
|
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/avatars.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAOjE,MAAM,QAAQ;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EA6BA,WACI,kBACG,MACiB;AACpB,QAAI;AAEJ,QAAK,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,KAAK,UAAU,eAAgB;AAClH,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,MAAM;AAAA,QACN,OAAO,KAAK,CAAC;AAAA,QACb,QAAQ,KAAK,CAAC;AAAA,QACd,SAAS,KAAK,CAAC;AAAA,MACnB;AAAA,IACJ;AAEA,UAAM,OAAO,OAAO;AACpB,UAAM,QAAQ,OAAO;AACrB,UAAM,SAAS,OAAO;AACtB,UAAM,UAAU,OAAO;AAEvB,QAAI,OAAO,SAAS,aAAa;AAC7B,YAAM,IAAI,kBAAkB,oCAAoC;AAAA,IACpE;AAEA,UAAM,UAAU,2BAA2B,QAAQ,UAAU,IAAI;AACjE,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,UAAU,aAAa;AAC9B,cAAQ,OAAO,IAAI;AAAA,IACvB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,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AAa;AAC7B,cAAQ,MAAM,IAAI;AAAA,IACtB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,QAAI,OAAO,aAAa,aAAa;AACjC,cAAQ,UAAU,IAAI;AAAA,IAC1B;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { Browser } from '../enums/browser';\nimport { CreditCard } from '../enums/credit-card';\nimport { Flag } from '../enums/flag';\n\nexport class Avatars {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} params.code - Browser Code.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} code - Browser Code.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getBrowser(\n paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Browser, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Browser,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getCreditCard(\n paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: CreditCard, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as CreditCard,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFavicon(params: { url: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFavicon(url: string): Promise<ArrayBuffer>;\n getFavicon(\n paramsOrFirst: { url: string } | string \n ): Promise<ArrayBuffer> {\n let params: { url: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string };\n } else {\n params = {\n url: paramsOrFirst as string \n };\n }\n \n const url = params.url;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/favicon';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} code - Country Code. ISO Alpha-2 country code format.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getFlag(\n paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Flag, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Flag,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/flags/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Image URL which you want to crop.\n * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getImage(params: { url: string, width?: number, height?: number }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Image URL which you want to crop.\n * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;\n getImage(\n paramsOrFirst: { url: string, width?: number, height?: number } | string,\n ...rest: [(number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { url: string, width?: number, height?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number };\n } else {\n params = {\n url: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number \n };\n }\n \n const url = params.url;\n const width = params.width;\n const height = params.height;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/image';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;\n getInitials(\n paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string,\n ...rest: [(number)?, (number)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { name?: string, width?: number, height?: number, background?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string };\n } else {\n params = {\n name: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number,\n background: rest[2] as string \n };\n }\n \n const name = params.name;\n const width = params.width;\n const height = params.height;\n const background = params.background;\n\n\n const apiPath = '/avatars/initials';\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} params.text - Plain text to be converted to QR code image.\n * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise<ArrayBuffer>;\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} text - Plain text to be converted to QR code image.\n * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;\n getQR(\n paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string,\n ...rest: [(number)?, (number)?, (boolean)?] \n ): Promise<ArrayBuffer> {\n let params: { text: string, size?: number, margin?: number, download?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean };\n } else {\n params = {\n text: paramsOrFirst as string,\n size: rest[0] as number,\n margin: rest[1] as number,\n download: rest[2] as boolean \n };\n }\n \n const text = params.text;\n const size = params.size;\n const margin = params.margin;\n const download = params.download;\n\n if (typeof text === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"text\"');\n }\n\n const apiPath = '/avatars/qr';\n const payload: Payload = {};\n if (typeof text !== 'undefined') {\n payload['text'] = text;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof margin !== 'undefined') {\n payload['margin'] = margin;\n }\n if (typeof download !== 'undefined') {\n payload['download'] = download;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/services/avatars.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAOjE,MAAM,QAAQ;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EA6BA,WACI,kBACG,MACiB;AACpB,QAAI;AAEJ,QAAK,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,KAAK,UAAU,eAAgB;AAClH,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,MAAM;AAAA,QACN,OAAO,K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;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EA2BA,MACI,kBACG,MACiB;AACpB,QAAI;AAEJ,QAAK,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACvF,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,MAAM;AAAA,QACN,MAAM,KAAK,CAAC;AAAA,QACZ,QAAQ,KAAK,CAAC;AAAA,QACd,UAAU,KAAK,CAAC;AAAA,MACpB;AAAA,IACJ;AAEA,UAAM,OAAO,OAAO;AACpB,UAAM,OAAO,OAAO;AACpB,UAAM,SAAS,OAAO;AACtB,UAAM,WAAW,OAAO;AAExB,QAAI,OAAO,SAAS,aAAa;AAC7B,YAAM,IAAI,kBAAkB,oCAAoC;AAAA,IACpE;AAEA,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,SAAS,aAAa;AAC7B,cAAQ,MAAM,IAAI;AAAA,IACtB;AACA,QAAI,OAAO,SAAS,aAAa;AAC7B,cAAQ,MAAM,IAAI;AAAA,IACtB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,QAAI,OAAO,aAAa,aAAa;AACjC,cAAQ,UAAU,IAAI;AAAA,IAC1B;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { Browser } from '../enums/browser';\nimport { CreditCard } from '../enums/credit-card';\nimport { Flag } from '../enums/flag';\n\nexport class Avatars {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} params.code - Browser Code.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} code - Browser Code.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getBrowser(\n paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Browser, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Browser,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getCreditCard(\n paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: CreditCard, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as CreditCard,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFavicon(params: { url: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFavicon(url: string): Promise<ArrayBuffer>;\n getFavicon(\n paramsOrFirst: { url: string } | string \n ): Promise<ArrayBuffer> {\n let params: { url: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string };\n } else {\n params = {\n url: paramsOrFirst as string \n };\n }\n \n const url = params.url;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/favicon';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} code - Country Code. ISO Alpha-2 country code format.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getFlag(\n paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Flag, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Flag,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/flags/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Image URL which you want to crop.\n * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getImage(params: { url: string, width?: number, height?: number }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Image URL which you want to crop.\n * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;\n getImage(\n paramsOrFirst: { url: string, width?: number, height?: number } | string,\n ...rest: [(number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { url: string, width?: number, height?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number };\n } else {\n params = {\n url: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number \n };\n }\n \n const url = params.url;\n const width = params.width;\n const height = params.height;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/image';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;\n getInitials(\n paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string,\n ...rest: [(number)?, (number)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { name?: string, width?: number, height?: number, background?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string };\n } else {\n params = {\n name: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number,\n background: rest[2] as string \n };\n }\n \n const name = params.name;\n const width = params.width;\n const height = params.height;\n const background = params.background;\n\n\n const apiPath = '/avatars/initials';\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} params.text - Plain text to be converted to QR code image.\n * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise<ArrayBuffer>;\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} text - Plain text to be converted to QR code image.\n * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;\n getQR(\n paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string,\n ...rest: [(number)?, (number)?, (boolean)?] \n ): Promise<ArrayBuffer> {\n let params: { text: string, size?: number, margin?: number, download?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean };\n } else {\n params = {\n text: paramsOrFirst as string,\n size: rest[0] as number,\n margin: rest[1] as number,\n download: rest[2] as boolean \n };\n }\n \n const text = params.text;\n const size = params.size;\n const margin = params.margin;\n const download = params.download;\n\n if (typeof text === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"text\"');\n }\n\n const apiPath = '/avatars/qr';\n const payload: Payload = {};\n if (typeof text !== 'undefined') {\n payload['text'] = text;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof margin !== 'undefined') {\n payload['margin'] = margin;\n }\n if (typeof download !== 'undefined') {\n payload['download'] = download;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/avatars.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAOjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EA6BA,WACI,kBACG,MACiB;AACpB,QAAI;AAEJ,QAAK,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,KAAK,UAAU,eAAgB;AAClH,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,MAAM;AAAA,QACN,OAAO,KAAK,CAAC;AAAA,QACb,QAAQ,KAAK,CAAC;AAAA,QACd,SAAS,KAAK,CAAC;AAAA,MACnB;AAAA,IACJ;AAEA,UAAM,OAAO,OAAO;AACpB,UAAM,QAAQ,OAAO;AACrB,UAAM,SAAS,OAAO;AACtB,UAAM,UAAU,OAAO;AAEvB,QAAI,OAAO,SAAS,aAAa;AAC7B,YAAM,IAAI,kBAAkB,oCAAoC;AAAA,IACpE;AAEA,UAAM,UAAU,2BAA2B,QAAQ,UAAU,IAAI;AACjE,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,UAAU,aAAa;AAC9B,cAAQ,OAAO,IAAI;AAAA,IACvB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,QAAI,OAA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OAAO;AAExB,QAAI,OAAO,SAAS,aAAa;AAC7B,YAAM,IAAI,kBAAkB,oCAAoC;AAAA,IACpE;AAEA,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,SAAS,aAAa;AAC7B,cAAQ,MAAM,IAAI;AAAA,IACtB;AACA,QAAI,OAAO,SAAS,aAAa;AAC7B,cAAQ,MAAM,IAAI;AAAA,IACtB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,QAAI,OAAO,aAAa,aAAa;AACjC,cAAQ,UAAU,IAAI;AAAA,IAC1B;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { Browser } from '../enums/browser';\nimport { CreditCard } from '../enums/credit-card';\nimport { Flag } from '../enums/flag';\n\nexport class Avatars {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} params.code - Browser Code.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} code - Browser Code.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getBrowser(\n paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Browser, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Browser,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getCreditCard(\n paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: CreditCard, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as CreditCard,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFavicon(params: { url: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFavicon(url: string): Promise<ArrayBuffer>;\n getFavicon(\n paramsOrFirst: { url: string } | string \n ): Promise<ArrayBuffer> {\n let params: { url: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string };\n } else {\n params = {\n url: paramsOrFirst as string \n };\n }\n \n const url = params.url;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/favicon';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} code - Country Code. ISO Alpha-2 country code format.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getFlag(\n paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Flag, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Flag,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/flags/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Image URL which you want to crop.\n * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getImage(params: { url: string, width?: number, height?: number }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Image URL which you want to crop.\n * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;\n getImage(\n paramsOrFirst: { url: string, width?: number, height?: number } | string,\n ...rest: [(number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { url: string, width?: number, height?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number };\n } else {\n params = {\n url: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number \n };\n }\n \n const url = params.url;\n const width = params.width;\n const height = params.height;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/image';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;\n getInitials(\n paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string,\n ...rest: [(number)?, (number)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { name?: string, width?: number, height?: number, background?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string };\n } else {\n params = {\n name: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number,\n background: rest[2] as string \n };\n }\n \n const name = params.name;\n const width = params.width;\n const height = params.height;\n const background = params.background;\n\n\n const apiPath = '/avatars/initials';\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} params.text - Plain text to be converted to QR code image.\n * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise<ArrayBuffer>;\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} text - Plain text to be converted to QR code image.\n * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;\n getQR(\n paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string,\n ...rest: [(number)?, (number)?, (boolean)?] \n ): Promise<ArrayBuffer> {\n let params: { text: string, size?: number, margin?: number, download?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean };\n } else {\n params = {\n text: paramsOrFirst as string,\n size: rest[0] as number,\n margin: rest[1] as number,\n download: rest[2] as boolean \n };\n }\n \n const text = params.text;\n const size = params.size;\n const margin = params.margin;\n const download = params.download;\n\n if (typeof text === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"text\"');\n }\n\n const apiPath = '/avatars/qr';\n const payload: Payload = {};\n if (typeof text !== 'undefined') {\n payload['text'] = text;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof margin !== 'undefined') {\n payload['margin'] = margin;\n }\n if (typeof download !== 'undefined') {\n payload['download'] = download;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/services/avatars.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAOjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA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AAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { Browser } from '../enums/browser';\nimport { CreditCard } from '../enums/credit-card';\nimport { Flag } from '../enums/flag';\n\nexport class Avatars {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} params.code - Browser Code.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} code - Browser Code.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getBrowser(\n paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Browser, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Browser,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getCreditCard(\n paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: CreditCard, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as CreditCard,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFavicon(params: { url: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Website URL which you want to fetch the favicon from.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFavicon(url: string): Promise<ArrayBuffer>;\n getFavicon(\n paramsOrFirst: { url: string } | string \n ): Promise<ArrayBuffer> {\n let params: { url: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string };\n } else {\n params = {\n url: paramsOrFirst as string \n };\n }\n \n const url = params.url;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/favicon';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;\n /**\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {Flag} code - Country Code. ISO Alpha-2 country code format.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;\n getFlag(\n paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag,\n ...rest: [(number)?, (number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { code: Flag, width?: number, height?: number, quality?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {\n params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number };\n } else {\n params = {\n code: paramsOrFirst as Flag,\n width: rest[0] as number,\n height: rest[1] as number,\n quality: rest[2] as number \n };\n }\n \n const code = params.code;\n const width = params.width;\n const height = params.height;\n const quality = params.quality;\n\n if (typeof code === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"code\"');\n }\n\n const apiPath = '/avatars/flags/{code}'.replace('{code}', code);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} params.url - Image URL which you want to crop.\n * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getImage(params: { url: string, width?: number, height?: number }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n * \n * This endpoint does not follow HTTP redirects.\n *\n * @param {string} url - Image URL which you want to crop.\n * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.\n * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;\n getImage(\n paramsOrFirst: { url: string, width?: number, height?: number } | string,\n ...rest: [(number)?, (number)?] \n ): Promise<ArrayBuffer> {\n let params: { url: string, width?: number, height?: number };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number };\n } else {\n params = {\n url: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number \n };\n }\n \n const url = params.url;\n const width = params.width;\n const height = params.height;\n\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n\n const apiPath = '/avatars/image';\n const payload: Payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;\n /**\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n * \n * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n * \n * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n * \n *\n * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.\n * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.\n * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;\n getInitials(\n paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string,\n ...rest: [(number)?, (number)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { name?: string, width?: number, height?: number, background?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string };\n } else {\n params = {\n name: paramsOrFirst as string,\n width: rest[0] as number,\n height: rest[1] as number,\n background: rest[2] as string \n };\n }\n \n const name = params.name;\n const width = params.width;\n const height = params.height;\n const background = params.background;\n\n\n const apiPath = '/avatars/initials';\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} params.text - Plain text to be converted to QR code image.\n * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise<ArrayBuffer>;\n /**\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n * \n *\n * @param {string} text - Plain text to be converted to QR code image.\n * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.\n * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.\n * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;\n getQR(\n paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string,\n ...rest: [(number)?, (number)?, (boolean)?] \n ): Promise<ArrayBuffer> {\n let params: { text: string, size?: number, margin?: number, download?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean };\n } else {\n params = {\n text: paramsOrFirst as string,\n size: rest[0] as number,\n margin: rest[1] as number,\n download: rest[2] as boolean \n };\n }\n \n const text = params.text;\n const size = params.size;\n const margin = params.margin;\n const download = params.download;\n\n if (typeof text === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"text\"');\n }\n\n const apiPath = '/avatars/qr';\n const payload: Payload = {};\n if (typeof text !== 'undefined') {\n payload['text'] = text;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof margin !== 'undefined') {\n payload['margin'] = margin;\n }\n if (typeof download !== 'undefined') {\n payload['download'] = download;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
|
|
@@ -40,7 +40,7 @@ declare class Databases {
|
|
|
40
40
|
* @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
|
|
41
41
|
* @throws {AppwriteException}
|
|
42
42
|
* @returns {Promise<Models.Database>}
|
|
43
|
-
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.
|
|
43
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.create` instead.
|
|
44
44
|
*/
|
|
45
45
|
create(params: {
|
|
46
46
|
databaseId: string;
|
|
@@ -835,6 +835,207 @@ declare class Databases {
|
|
|
835
835
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
836
836
|
*/
|
|
837
837
|
updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp>;
|
|
838
|
+
/**
|
|
839
|
+
* Create a geometric line attribute.
|
|
840
|
+
*
|
|
841
|
+
* @param {string} params.databaseId - Database ID.
|
|
842
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
843
|
+
* @param {string} params.key - Attribute Key.
|
|
844
|
+
* @param {boolean} params.required - Is attribute required?
|
|
845
|
+
* @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
|
|
846
|
+
* @throws {AppwriteException}
|
|
847
|
+
* @returns {Promise<Models.AttributeLine>}
|
|
848
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.
|
|
849
|
+
*/
|
|
850
|
+
createLineAttribute(params: {
|
|
851
|
+
databaseId: string;
|
|
852
|
+
collectionId: string;
|
|
853
|
+
key: string;
|
|
854
|
+
required: boolean;
|
|
855
|
+
xdefault?: any[];
|
|
856
|
+
}): Promise<Models.AttributeLine>;
|
|
857
|
+
/**
|
|
858
|
+
* Create a geometric line attribute.
|
|
859
|
+
*
|
|
860
|
+
* @param {string} databaseId - Database ID.
|
|
861
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
862
|
+
* @param {string} key - Attribute Key.
|
|
863
|
+
* @param {boolean} required - Is attribute required?
|
|
864
|
+
* @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
|
|
865
|
+
* @throws {AppwriteException}
|
|
866
|
+
* @returns {Promise<Models.AttributeLine>}
|
|
867
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
868
|
+
*/
|
|
869
|
+
createLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributeLine>;
|
|
870
|
+
/**
|
|
871
|
+
* Update a line attribute. Changing the `default` value will not update already existing documents.
|
|
872
|
+
*
|
|
873
|
+
* @param {string} params.databaseId - Database ID.
|
|
874
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
875
|
+
* @param {string} params.key - Attribute Key.
|
|
876
|
+
* @param {boolean} params.required - Is attribute required?
|
|
877
|
+
* @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
|
|
878
|
+
* @param {string} params.newKey - New attribute key.
|
|
879
|
+
* @throws {AppwriteException}
|
|
880
|
+
* @returns {Promise<Models.AttributeLine>}
|
|
881
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.
|
|
882
|
+
*/
|
|
883
|
+
updateLineAttribute(params: {
|
|
884
|
+
databaseId: string;
|
|
885
|
+
collectionId: string;
|
|
886
|
+
key: string;
|
|
887
|
+
required: boolean;
|
|
888
|
+
xdefault?: any[];
|
|
889
|
+
newKey?: string;
|
|
890
|
+
}): Promise<Models.AttributeLine>;
|
|
891
|
+
/**
|
|
892
|
+
* Update a line attribute. Changing the `default` value will not update already existing documents.
|
|
893
|
+
*
|
|
894
|
+
* @param {string} databaseId - Database ID.
|
|
895
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
896
|
+
* @param {string} key - Attribute Key.
|
|
897
|
+
* @param {boolean} required - Is attribute required?
|
|
898
|
+
* @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
|
|
899
|
+
* @param {string} newKey - New attribute key.
|
|
900
|
+
* @throws {AppwriteException}
|
|
901
|
+
* @returns {Promise<Models.AttributeLine>}
|
|
902
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
903
|
+
*/
|
|
904
|
+
updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributeLine>;
|
|
905
|
+
/**
|
|
906
|
+
* Create a geometric point attribute.
|
|
907
|
+
*
|
|
908
|
+
* @param {string} params.databaseId - Database ID.
|
|
909
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
910
|
+
* @param {string} params.key - Attribute Key.
|
|
911
|
+
* @param {boolean} params.required - Is attribute required?
|
|
912
|
+
* @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
|
|
913
|
+
* @throws {AppwriteException}
|
|
914
|
+
* @returns {Promise<Models.AttributePoint>}
|
|
915
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.
|
|
916
|
+
*/
|
|
917
|
+
createPointAttribute(params: {
|
|
918
|
+
databaseId: string;
|
|
919
|
+
collectionId: string;
|
|
920
|
+
key: string;
|
|
921
|
+
required: boolean;
|
|
922
|
+
xdefault?: any[];
|
|
923
|
+
}): Promise<Models.AttributePoint>;
|
|
924
|
+
/**
|
|
925
|
+
* Create a geometric point attribute.
|
|
926
|
+
*
|
|
927
|
+
* @param {string} databaseId - Database ID.
|
|
928
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
929
|
+
* @param {string} key - Attribute Key.
|
|
930
|
+
* @param {boolean} required - Is attribute required?
|
|
931
|
+
* @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
|
|
932
|
+
* @throws {AppwriteException}
|
|
933
|
+
* @returns {Promise<Models.AttributePoint>}
|
|
934
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
935
|
+
*/
|
|
936
|
+
createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePoint>;
|
|
937
|
+
/**
|
|
938
|
+
* Update a point attribute. Changing the `default` value will not update already existing documents.
|
|
939
|
+
*
|
|
940
|
+
* @param {string} params.databaseId - Database ID.
|
|
941
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
942
|
+
* @param {string} params.key - Attribute Key.
|
|
943
|
+
* @param {boolean} params.required - Is attribute required?
|
|
944
|
+
* @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
|
|
945
|
+
* @param {string} params.newKey - New attribute key.
|
|
946
|
+
* @throws {AppwriteException}
|
|
947
|
+
* @returns {Promise<Models.AttributePoint>}
|
|
948
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.
|
|
949
|
+
*/
|
|
950
|
+
updatePointAttribute(params: {
|
|
951
|
+
databaseId: string;
|
|
952
|
+
collectionId: string;
|
|
953
|
+
key: string;
|
|
954
|
+
required: boolean;
|
|
955
|
+
xdefault?: any[];
|
|
956
|
+
newKey?: string;
|
|
957
|
+
}): Promise<Models.AttributePoint>;
|
|
958
|
+
/**
|
|
959
|
+
* Update a point attribute. Changing the `default` value will not update already existing documents.
|
|
960
|
+
*
|
|
961
|
+
* @param {string} databaseId - Database ID.
|
|
962
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
963
|
+
* @param {string} key - Attribute Key.
|
|
964
|
+
* @param {boolean} required - Is attribute required?
|
|
965
|
+
* @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
|
|
966
|
+
* @param {string} newKey - New attribute key.
|
|
967
|
+
* @throws {AppwriteException}
|
|
968
|
+
* @returns {Promise<Models.AttributePoint>}
|
|
969
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
970
|
+
*/
|
|
971
|
+
updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePoint>;
|
|
972
|
+
/**
|
|
973
|
+
* Create a geometric polygon attribute.
|
|
974
|
+
*
|
|
975
|
+
* @param {string} params.databaseId - Database ID.
|
|
976
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
977
|
+
* @param {string} params.key - Attribute Key.
|
|
978
|
+
* @param {boolean} params.required - Is attribute required?
|
|
979
|
+
* @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
|
|
980
|
+
* @throws {AppwriteException}
|
|
981
|
+
* @returns {Promise<Models.AttributePolygon>}
|
|
982
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.
|
|
983
|
+
*/
|
|
984
|
+
createPolygonAttribute(params: {
|
|
985
|
+
databaseId: string;
|
|
986
|
+
collectionId: string;
|
|
987
|
+
key: string;
|
|
988
|
+
required: boolean;
|
|
989
|
+
xdefault?: any[];
|
|
990
|
+
}): Promise<Models.AttributePolygon>;
|
|
991
|
+
/**
|
|
992
|
+
* Create a geometric polygon attribute.
|
|
993
|
+
*
|
|
994
|
+
* @param {string} databaseId - Database ID.
|
|
995
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
996
|
+
* @param {string} key - Attribute Key.
|
|
997
|
+
* @param {boolean} required - Is attribute required?
|
|
998
|
+
* @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
|
|
999
|
+
* @throws {AppwriteException}
|
|
1000
|
+
* @returns {Promise<Models.AttributePolygon>}
|
|
1001
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1002
|
+
*/
|
|
1003
|
+
createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePolygon>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Update a polygon attribute. Changing the `default` value will not update already existing documents.
|
|
1006
|
+
*
|
|
1007
|
+
* @param {string} params.databaseId - Database ID.
|
|
1008
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
1009
|
+
* @param {string} params.key - Attribute Key.
|
|
1010
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1011
|
+
* @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
|
|
1012
|
+
* @param {string} params.newKey - New attribute key.
|
|
1013
|
+
* @throws {AppwriteException}
|
|
1014
|
+
* @returns {Promise<Models.AttributePolygon>}
|
|
1015
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.
|
|
1016
|
+
*/
|
|
1017
|
+
updatePolygonAttribute(params: {
|
|
1018
|
+
databaseId: string;
|
|
1019
|
+
collectionId: string;
|
|
1020
|
+
key: string;
|
|
1021
|
+
required: boolean;
|
|
1022
|
+
xdefault?: any[];
|
|
1023
|
+
newKey?: string;
|
|
1024
|
+
}): Promise<Models.AttributePolygon>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Update a polygon attribute. Changing the `default` value will not update already existing documents.
|
|
1027
|
+
*
|
|
1028
|
+
* @param {string} databaseId - Database ID.
|
|
1029
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
1030
|
+
* @param {string} key - Attribute Key.
|
|
1031
|
+
* @param {boolean} required - Is attribute required?
|
|
1032
|
+
* @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
|
|
1033
|
+
* @param {string} newKey - New attribute key.
|
|
1034
|
+
* @throws {AppwriteException}
|
|
1035
|
+
* @returns {Promise<Models.AttributePolygon>}
|
|
1036
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1037
|
+
*/
|
|
1038
|
+
updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePolygon>;
|
|
838
1039
|
/**
|
|
839
1040
|
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
840
1041
|
*
|