From 06c081d07b98abe67585b4959149f120655e67de Mon Sep 17 00:00:00 2001 From: Alejo Thomas Ortega Date: Wed, 11 Dec 2024 17:57:04 -0300 Subject: [PATCH] refactor: rename AB Conversion event to AssetBundleConversionFinishedEvent --- report/schemas.api.md | 12 ++++++------ src/platform/events/services.ts | 8 ++++---- .../platform/events/asset-bundle-converted.spec.ts | 14 +++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/report/schemas.api.md b/report/schemas.api.md index 8a527e2..3b1970b 100644 --- a/report/schemas.api.md +++ b/report/schemas.api.md @@ -134,11 +134,11 @@ export namespace AnyMapping { validate: ValidateFunction; } -// Warning: (ae-missing-release-tag) "AssetBundleConvertedEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "AssetBundleConvertedEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "AssetBundleConversionFinishedEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "AssetBundleConversionFinishedEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type AssetBundleConvertedEvent = BaseEvent & { +export type AssetBundleConversionFinishedEvent = BaseEvent & { type: Events.Type.ASSET_BUNDLE; subType: Events.SubType.AssetBundle.CONVERTED; metadata: { @@ -150,11 +150,11 @@ export type AssetBundleConvertedEvent = BaseEvent & { }; // @public (undocumented) -export namespace AssetBundleConvertedEvent { +export namespace AssetBundleConversionFinishedEvent { const // (undocumented) - schema: JSONSchema; + schema: JSONSchema; const // (undocumented) - validate: ValidateFunction; + validate: ValidateFunction; } // @public diff --git a/src/platform/events/services.ts b/src/platform/events/services.ts index eb548e7..297c5c7 100644 --- a/src/platform/events/services.ts +++ b/src/platform/events/services.ts @@ -40,7 +40,7 @@ export namespace BadgeGrantedEvent { export const validate: ValidateFunction = generateLazyValidator(schema) } -export type AssetBundleConvertedEvent = BaseEvent & { +export type AssetBundleConversionFinishedEvent = BaseEvent & { type: Events.Type.ASSET_BUNDLE subType: Events.SubType.AssetBundle.CONVERTED metadata: { @@ -51,8 +51,8 @@ export type AssetBundleConvertedEvent = BaseEvent & { } } -export namespace AssetBundleConvertedEvent { - export const schema: JSONSchema = { +export namespace AssetBundleConversionFinishedEvent { + export const schema: JSONSchema = { type: 'object', properties: { type: { type: 'string', const: Events.Type.ASSET_BUNDLE }, @@ -74,5 +74,5 @@ export namespace AssetBundleConvertedEvent { additionalProperties: true } - export const validate: ValidateFunction = generateLazyValidator(schema) + export const validate: ValidateFunction = generateLazyValidator(schema) } diff --git a/test/platform/events/asset-bundle-converted.spec.ts b/test/platform/events/asset-bundle-converted.spec.ts index 122f04d..719a094 100644 --- a/test/platform/events/asset-bundle-converted.spec.ts +++ b/test/platform/events/asset-bundle-converted.spec.ts @@ -1,9 +1,9 @@ import expect from 'expect' -import { AssetBundleConvertedEvent, Events } from '../../../src' +import { AssetBundleConversionFinishedEvent, Events } from '../../../src' -describe('AssetBundleConverted Events tests', () => { - it('AssetBundleConvertedEvent static tests must pass', () => { - const event: AssetBundleConvertedEvent = { +describe('AssetBundleConversionFinished Events tests', () => { + it('AssetBundleConversionFinishedEvent static tests must pass', () => { + const event: AssetBundleConversionFinishedEvent = { type: Events.Type.ASSET_BUNDLE, subType: Events.SubType.AssetBundle.CONVERTED, key: 'key', @@ -16,8 +16,8 @@ describe('AssetBundleConverted Events tests', () => { } } - expect(AssetBundleConvertedEvent.validate(event)).toEqual(true) - expect(AssetBundleConvertedEvent.validate(null)).toEqual(false) - expect(AssetBundleConvertedEvent.validate({})).toEqual(false) + expect(AssetBundleConversionFinishedEvent.validate(event)).toEqual(true) + expect(AssetBundleConversionFinishedEvent.validate(null)).toEqual(false) + expect(AssetBundleConversionFinishedEvent.validate({})).toEqual(false) }) })