diff --git a/README.md b/README.md index 46e347f..dd73a52 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Deno SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 6603c37..d57f8fd 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -13,6 +13,6 @@ const response = await databases.updateStringAttribute( '', // key false, // required '', // default - null, // size (optional) + 1, // size (optional) '' // newKey (optional) ); diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 005cca1..7b41911 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -9,8 +9,8 @@ const messaging = new Messaging(client); const response = await messaging.createPush( '', // messageId - '', // title - '<BODY>', // body + '<TITLE>', // title (optional) + '<BODY>', // body (optional) [], // topics (optional) [], // users (optional) [], // targets (optional) @@ -21,7 +21,10 @@ const response = await messaging.createPush( '<SOUND>', // sound (optional) '<COLOR>', // color (optional) '<TAG>', // tag (optional) - '<BADGE>', // badge (optional) + null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.Normal // priority (optional) ); diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 9c66ab6..11437fa 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -23,5 +23,8 @@ const response = await messaging.updatePush( '<TAG>', // tag (optional) null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.Normal // priority (optional) ); diff --git a/mod.ts b/mod.ts index 09d23a4..6f75bbc 100644 --- a/mod.ts +++ b/mod.ts @@ -28,6 +28,7 @@ import { IndexType } from "./src/enums/index-type.ts"; import { Runtime } from "./src/enums/runtime.ts"; import { ExecutionMethod } from "./src/enums/execution-method.ts"; import { Name } from "./src/enums/name.ts"; +import { MessagePriority } from "./src/enums/message-priority.ts"; import { SmtpEncryption } from "./src/enums/smtp-encryption.ts"; import { Compression } from "./src/enums/compression.ts"; import { ImageGravity } from "./src/enums/image-gravity.ts"; @@ -66,6 +67,7 @@ export { Runtime, ExecutionMethod, Name, + MessagePriority, SmtpEncryption, Compression, ImageGravity, diff --git a/src/client.ts b/src/client.ts index c739b60..a0618c9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,11 +11,11 @@ export class Client { endpoint: string = 'https://cloud.appwrite.io/v1'; headers: Payload = { 'content-type': '', - 'user-agent' : `AppwriteDenoSDK/12.1.0 (${Deno.build.os}; ${Deno.build.arch})`, + 'user-agent' : `AppwriteDenoSDK/12.2.0 (${Deno.build.os}; ${Deno.build.arch})`, 'x-sdk-name': 'Deno', 'x-sdk-platform': 'server', 'x-sdk-language': 'deno', - 'x-sdk-version': '12.1.0', + 'x-sdk-version': '12.2.0', 'X-Appwrite-Response-Format':'1.6.0', }; diff --git a/src/enums/image-format.ts b/src/enums/image-format.ts index 7e96fd8..8599e30 100644 --- a/src/enums/image-format.ts +++ b/src/enums/image-format.ts @@ -4,4 +4,5 @@ export enum ImageFormat { Gif = 'gif', Png = 'png', Webp = 'webp', + Avif = 'avif', } \ No newline at end of file diff --git a/src/enums/message-priority.ts b/src/enums/message-priority.ts new file mode 100644 index 0000000..f3113a8 --- /dev/null +++ b/src/enums/message-priority.ts @@ -0,0 +1,4 @@ +export enum MessagePriority { + Normal = 'normal', + High = 'high', +} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index 703f2b2..66f3560 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -5,6 +5,7 @@ export enum Runtime { Node190 = 'node-19.0', Node200 = 'node-20.0', Node210 = 'node-21.0', + Node22 = 'node-22', Php80 = 'php-8.0', Php81 = 'php-8.1', Php82 = 'php-8.2', @@ -19,7 +20,12 @@ export enum Runtime { Python311 = 'python-3.11', Python312 = 'python-3.12', PythonMl311 = 'python-ml-3.11', + Deno121 = 'deno-1.21', + Deno124 = 'deno-1.24', + Deno135 = 'deno-1.35', Deno140 = 'deno-1.40', + Deno146 = 'deno-1.46', + Deno20 = 'deno-2.0', Dart215 = 'dart-2.15', Dart216 = 'dart-2.16', Dart217 = 'dart-2.17', @@ -27,22 +33,29 @@ export enum Runtime { Dart30 = 'dart-3.0', Dart31 = 'dart-3.1', Dart33 = 'dart-3.3', - Dotnet31 = 'dotnet-3.1', + Dart35 = 'dart-3.5', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', + Dotnet80 = 'dotnet-8.0', Java80 = 'java-8.0', Java110 = 'java-11.0', Java170 = 'java-17.0', Java180 = 'java-18.0', Java210 = 'java-21.0', + Java22 = 'java-22', Swift55 = 'swift-5.5', Swift58 = 'swift-5.8', Swift59 = 'swift-5.9', + Swift510 = 'swift-5.10', Kotlin16 = 'kotlin-1.6', Kotlin18 = 'kotlin-1.8', Kotlin19 = 'kotlin-1.9', + Kotlin20 = 'kotlin-2.0', Cpp17 = 'cpp-17', Cpp20 = 'cpp-20', Bun10 = 'bun-1.0', + Bun11 = 'bun-1.1', Go123 = 'go-1.23', + Static1 = 'static-1', + Flutter324 = 'flutter-3.24', } \ No newline at end of file diff --git a/src/models.d.ts b/src/models.d.ts index 6fcf6a6..e27ef3d 100644 --- a/src/models.d.ts +++ b/src/models.d.ts @@ -487,6 +487,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * Attribute size. */ @@ -524,6 +532,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * Minimum value to enforce for new documents. */ @@ -565,6 +581,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * Minimum value to enforce for new documents. */ @@ -606,6 +630,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ @@ -639,6 +671,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * String format. */ @@ -676,6 +716,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * Array of elements in enumerated type. */ @@ -717,6 +765,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * String format. */ @@ -754,6 +810,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * String format. */ @@ -791,6 +855,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * ISO 8601 format. */ @@ -828,6 +900,14 @@ export namespace Models { * Is attribute an array? */ array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; /** * The ID of the related collection. */ @@ -881,6 +961,14 @@ export namespace Models { * Index orders. */ orders?: string[]; + /** + * Index creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Index update date in ISO 8601 format. + */ + $updatedAt: string; } /** * Document @@ -1591,11 +1679,11 @@ export namespace Models { */ userId: string; /** - * User name. + * User name. Hide this attribute by toggling membership privacy in the Console. */ userName: string; /** - * User email address. + * User email address. Hide this attribute by toggling membership privacy in the Console. */ userEmail: string; /** @@ -1619,7 +1707,7 @@ export namespace Models { */ confirm: boolean; /** - * Multi factor authentication status, true if the user has MFA enabled or false otherwise. + * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. */ mfa: boolean; /** @@ -1684,7 +1772,7 @@ export namespace Models { */ events: string[]; /** - * Function execution schedult in CRON format. + * Function execution schedule in CRON format. */ schedule: string; /** @@ -2501,5 +2589,9 @@ export namespace Models { * The target identifier. */ identifier: string; + /** + * Is the target expired. + */ + expired: boolean; } } \ No newline at end of file diff --git a/src/services/account.ts b/src/services/account.ts index 52279ad..a86a8b9 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -148,7 +148,7 @@ export class Account extends Service { ); } /** - * List Identities + * List identities * * Get the list of identities for the currently logged in user. * @@ -286,7 +286,7 @@ export class Account extends Service { ); } /** - * Create Authenticator + * Create authenticator * * Add an authenticator app to be used as an MFA factor. Verify the * authenticator using the [verify @@ -316,7 +316,7 @@ export class Account extends Service { ); } /** - * Verify Authenticator + * Verify authenticator * * Verify an authenticator app after adding it using the [add * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) @@ -353,7 +353,7 @@ export class Account extends Service { ); } /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator for a user by ID. * @@ -380,7 +380,7 @@ export class Account extends Service { ); } /** - * Create MFA Challenge + * Create MFA challenge * * Begin the process of MFA verification after sign-in. Finish the flow with * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) @@ -412,7 +412,7 @@ export class Account extends Service { ); } /** - * Create MFA Challenge (confirmation) + * Create MFA challenge (confirmation) * * Complete the MFA challenge by providing the one-time password. Finish the * process of MFA verification by providing the one-time password. To begin @@ -454,7 +454,7 @@ export class Account extends Service { ); } /** - * List Factors + * List factors * * List the factors available on the account to be used as a MFA challange. * @@ -476,7 +476,7 @@ export class Account extends Service { ); } /** - * Get MFA Recovery Codes + * Get MFA recovery codes * * Get recovery codes that can be used as backup for MFA flow. Before getting * codes, they must be generated using @@ -501,7 +501,7 @@ export class Account extends Service { ); } /** - * Create MFA Recovery Codes + * Create MFA recovery codes * * Generate recovery codes as backup for MFA flow. It's recommended to * generate and show then immediately after user successfully adds their @@ -527,7 +527,7 @@ export class Account extends Service { ); } /** - * Regenerate MFA Recovery Codes + * Regenerate MFA recovery codes * * Regenerate recovery codes that can be used as backup for MFA flow. Before * regenerating codes, they must be first generated using @@ -1224,9 +1224,7 @@ export class Account extends Service { * [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. The link sent to the user's email - * address is valid for 1 hour. If you are on a mobile device you can leave - * the URL parameter empty, so that the login completion will be handled by - * your Appwrite instance by default. + * address is valid for 1 hour. * * A user is limited to 10 active sessions at a time by default. [Learn more * about session diff --git a/src/services/locale.ts b/src/services/locale.ts index 432d9d1..c73bd8e 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -49,7 +49,7 @@ export class Locale extends Service { ); } /** - * List Locale Codes + * List locale codes * * List of all locale codes in [ISO * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 84ea422..3472d45 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -5,6 +5,7 @@ import { InputFile } from '../inputFile.ts'; import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; import { Query } from '../query.ts'; +import { MessagePriority } from '../enums/message-priority.ts'; import { SmtpEncryption } from '../enums/smtp-encryption.ts'; export type UploadProgress = { @@ -226,25 +227,20 @@ export class Messaging extends Service { * @param {string} sound * @param {string} color * @param {string} tag - * @param {string} badge + * @param {number} badge * @param {boolean} draft * @param {string} scheduledAt + * @param {boolean} contentAvailable + * @param {boolean} critical + * @param {MessagePriority} priority * @throws {AppwriteException} * @returns {Promise} */ - async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> { + async createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message> { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - if (typeof title === 'undefined') { - throw new AppwriteException('Missing required parameter: "title"'); - } - - if (typeof body === 'undefined') { - throw new AppwriteException('Missing required parameter: "body"'); - } - const apiPath = '/messaging/messages/push'; const payload: Payload = {}; @@ -296,6 +292,15 @@ export class Messaging extends Service { if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } + if (typeof contentAvailable !== 'undefined') { + payload['contentAvailable'] = contentAvailable; + } + if (typeof critical !== 'undefined') { + payload['critical'] = critical; + } + if (typeof priority !== 'undefined') { + payload['priority'] = priority; + } return await this.client.call( 'post', apiPath, @@ -328,10 +333,13 @@ export class Messaging extends Service { * @param {number} badge * @param {boolean} draft * @param {string} scheduledAt + * @param {boolean} contentAvailable + * @param {boolean} critical + * @param {MessagePriority} priority * @throws {AppwriteException} * @returns {Promise} */ - async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise<Models.Message> { + async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message> { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -384,6 +392,15 @@ export class Messaging extends Service { if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } + if (typeof contentAvailable !== 'undefined') { + payload['contentAvailable'] = contentAvailable; + } + if (typeof critical !== 'undefined') { + payload['critical'] = critical; + } + if (typeof priority !== 'undefined') { + payload['priority'] = priority; + } return await this.client.call( 'patch', apiPath, diff --git a/src/services/storage.ts b/src/services/storage.ts index 20c8aae..dad613d 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -517,7 +517,7 @@ export class Storage extends Service { ); } /** - * Delete File + * Delete file * * Delete a file by its unique ID. Only users with write permissions have * access to delete this resource. diff --git a/src/services/teams.ts b/src/services/teams.ts index cdbdc6d..2775360 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -192,7 +192,8 @@ export class Teams extends Service { * List team memberships * * Use this endpoint to list a team's members using the team's ID. All team - * members have read access to this endpoint. + * members have read access to this endpoint. Hide sensitive attributes from + * the response by toggling membership privacy in the Console. * * @param {string} teamId * @param {string[]} queries @@ -305,7 +306,8 @@ export class Teams extends Service { * Get team membership * * Get a team member by the membership unique id. All team members have read - * access for this resource. + * access for this resource. Hide sensitive attributes from the response by + * toggling membership privacy in the Console. * * @param {string} teamId * @param {string} membershipId diff --git a/src/services/users.ts b/src/services/users.ts index cd3cf48..9ccabed 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -210,7 +210,7 @@ export class Users extends Service { ); } /** - * List Identities + * List identities * * Get identities for all users. * @@ -868,7 +868,7 @@ export class Users extends Service { ); } /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator app. * @@ -900,7 +900,7 @@ export class Users extends Service { ); } /** - * List Factors + * List factors * * List the factors available on the account to be used as a MFA challange. * @@ -927,7 +927,7 @@ export class Users extends Service { ); } /** - * Get MFA Recovery Codes + * Get MFA recovery codes * * Get recovery codes that can be used as backup for MFA flow by User ID. * Before getting codes, they must be generated using @@ -957,7 +957,7 @@ export class Users extends Service { ); } /** - * Regenerate MFA Recovery Codes + * Regenerate MFA recovery codes * * Regenerate recovery codes that can be used as backup for MFA flow by User * ID. Before regenerating codes, they must be first generated using @@ -987,7 +987,7 @@ export class Users extends Service { ); } /** - * Create MFA Recovery Codes + * Create MFA recovery codes * * Generate recovery codes used as backup for MFA flow for User ID. Recovery * codes can be used as a MFA verification type in @@ -1340,7 +1340,7 @@ export class Users extends Service { ); } /** - * List User Targets + * List user targets * * List the messaging targets that are associated with a user. * @@ -1372,7 +1372,7 @@ export class Users extends Service { ); } /** - * Create User Target + * Create user target * * Create a messaging target. * @@ -1431,7 +1431,7 @@ export class Users extends Service { ); } /** - * Get User Target + * Get user target * * Get a user's push notification target by ID. * @@ -1463,7 +1463,7 @@ export class Users extends Service { ); } /** - * Update User target + * Update user target * * Update a messaging target. * diff --git a/test/services/databases.test.ts b/test/services/databases.test.ts index f856843..6778081 100644 --- a/test/services/databases.test.ts +++ b/test/services/databases.test.ts @@ -233,7 +233,9 @@ describe('Databases service', () => { 'type': 'boolean', 'status': 'available', 'error': 'string', - 'required': true,}; + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -255,7 +257,9 @@ describe('Databases service', () => { 'type': 'boolean', 'status': 'available', 'error': 'string', - 'required': true,}; + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -279,6 +283,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'datetime',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -302,6 +308,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'datetime',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -326,6 +334,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'email',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -349,6 +359,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'email',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -373,6 +385,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'elements': [], 'format': 'enum',}; @@ -398,6 +412,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'elements': [], 'format': 'enum',}; @@ -423,7 +439,9 @@ describe('Databases service', () => { 'type': 'double', 'status': 'available', 'error': 'string', - 'required': true,}; + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -445,7 +463,9 @@ describe('Databases service', () => { 'type': 'double', 'status': 'available', 'error': 'string', - 'required': true,}; + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -470,7 +490,9 @@ describe('Databases service', () => { 'type': 'integer', 'status': 'available', 'error': 'string', - 'required': true,}; + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -492,7 +514,9 @@ describe('Databases service', () => { 'type': 'integer', 'status': 'available', 'error': 'string', - 'required': true,}; + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -518,6 +542,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'ip',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -541,6 +567,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'ip',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -565,6 +593,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'relatedCollection': 'collection', 'relationType': 'oneToOne|oneToMany|manyToOne|manyToMany', 'twoWay': true, @@ -593,6 +623,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'size': 128,}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -617,6 +649,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'size': 128,}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -641,6 +675,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'url',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -664,6 +700,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'format': 'url',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -722,6 +760,8 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'relatedCollection': 'collection', 'relationType': 'oneToOne|oneToMany|manyToOne|manyToMany', 'twoWay': true, @@ -866,7 +906,9 @@ describe('Databases service', () => { 'type': 'primary', 'status': 'available', 'error': 'string', - 'attributes': [],}; + 'attributes': [], + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -889,7 +931,9 @@ describe('Databases service', () => { 'type': 'primary', 'status': 'available', 'error': 'string', - 'attributes': [],}; + 'attributes': [], + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); diff --git a/test/services/functions.test.ts b/test/services/functions.test.ts index e227b67..71f8139 100644 --- a/test/services/functions.test.ts +++ b/test/services/functions.test.ts @@ -52,7 +52,7 @@ describe('Functions service', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, - 'specification': 's-0.5vcpu-512mb',}; + 'specification': 's-1vcpu-512mb',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -122,7 +122,7 @@ describe('Functions service', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, - 'specification': 's-0.5vcpu-512mb',}; + 'specification': 's-1vcpu-512mb',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -160,7 +160,7 @@ describe('Functions service', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, - 'specification': 's-0.5vcpu-512mb',}; + 'specification': 's-1vcpu-512mb',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -309,7 +309,7 @@ describe('Functions service', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, - 'specification': 's-0.5vcpu-512mb',}; + 'specification': 's-1vcpu-512mb',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -424,7 +424,7 @@ describe('Functions service', () => { 'requestPath': '/articles?id=5', 'requestHeaders': [], 'responseStatusCode': 200, - 'responseBody': 'Developers are awesome.', + 'responseBody': '', 'responseHeaders': [], 'logs': '', 'errors': '', @@ -454,7 +454,7 @@ describe('Functions service', () => { 'requestPath': '/articles?id=5', 'requestHeaders': [], 'responseStatusCode': 200, - 'responseBody': 'Developers are awesome.', + 'responseBody': '', 'responseHeaders': [], 'logs': '', 'errors': '', diff --git a/test/services/messaging.test.ts b/test/services/messaging.test.ts index 6705652..0631ffd 100644 --- a/test/services/messaging.test.ts +++ b/test/services/messaging.test.ts @@ -94,8 +94,6 @@ describe('Messaging service', () => { const response = await messaging.createPush( '<MESSAGE_ID>', - '<TITLE>', - '<BODY>', ); assertEquals(response, data); diff --git a/test/services/users.test.ts b/test/services/users.test.ts index 93ed1e0..af1a605 100644 --- a/test/services/users.test.ts +++ b/test/services/users.test.ts @@ -862,10 +862,11 @@ describe('Users service', () => { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'Aegon apple token', + 'name': 'Apple iPhone 12', 'userId': '259125845563242502', 'providerType': 'email', - 'identifier': 'token',}; + 'identifier': 'token', + 'expired': true,}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -886,10 +887,11 @@ describe('Users service', () => { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'Aegon apple token', + 'name': 'Apple iPhone 12', 'userId': '259125845563242502', 'providerType': 'email', - 'identifier': 'token',}; + 'identifier': 'token', + 'expired': true,}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -908,10 +910,11 @@ describe('Users service', () => { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'Aegon apple token', + 'name': 'Apple iPhone 12', 'userId': '259125845563242502', 'providerType': 'email', - 'identifier': 'token',}; + 'identifier': 'token', + 'expired': true,}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data)));