diff --git a/report/schemas.api.md b/report/schemas.api.md index b4d3cf5..70c1158 100644 --- a/report/schemas.api.md +++ b/report/schemas.api.md @@ -134,6 +134,29 @@ export namespace AnyMapping { validate: ValidateFunction; } +// 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 AssetBundleConversionFinishedEvent = BaseEvent & { + type: Events.Type.ASSET_BUNDLE; + subType: Events.SubType.AssetBundle.CONVERTED; + metadata: { + entityId: string; + platform: 'windows' | 'mac' | 'webgl'; + statusCode: number; + isLods: boolean; + }; +}; + +// @public (undocumented) +export namespace AssetBundleConversionFinishedEvent { + const // (undocumented) + schema: JSONSchema; + const // (undocumented) + validate: ValidateFunction; +} + // @public export type AuthChain = AuthLink[]; @@ -285,7 +308,7 @@ export type BaseBid = { // @public (undocumented) export type BaseEvent = { type: Events.Type; - subType: Events.SubType.Blockchain | Events.SubType.CatalystDeployment | Events.SubType.Client | Events.SubType.Marketplace | Events.SubType.Rewards | Events.SubType.Badge; + subType: Events.SubType.Blockchain | Events.SubType.CatalystDeployment | Events.SubType.Client | Events.SubType.Marketplace | Events.SubType.Rewards | Events.SubType.Badge | Events.SubType.AssetBundle; key: string; timestamp: number; }; @@ -1054,6 +1077,11 @@ export type Event = BadgeGrantedEvent | BidAcceptedEvent | BidReceivedEvent | Ca export namespace Events { // (undocumented) export namespace SubType { + // (undocumented) + export enum AssetBundle { + // (undocumented) + CONVERTED = "converted" + } // (undocumented) export enum Badge { // (undocumented) @@ -1124,9 +1152,16 @@ export namespace Events { // (undocumented) REWARD_IN_PROGRESS = "reward-in-progress" } + // (undocumented) + export enum Worlds { + // (undocumented) + DEPLOYMENT = "deployment" + } } // (undocumented) export enum Type { + // (undocumented) + ASSET_BUNDLE = "asset-bundle", // (undocumented) BADGE = "badge", // (undocumented) @@ -1138,7 +1173,9 @@ export namespace Events { // (undocumented) MARKETPLACE = "marketplace", // (undocumented) - REWARDS = "rewards" + REWARDS = "rewards", + // (undocumented) + WORLD = "world" } } @@ -1524,6 +1561,7 @@ export type LinkerAuthorization = { name: string; [key: string]: string; }; + onlyDev?: boolean; addresses: string[]; plots: string[]; }; @@ -2549,6 +2587,8 @@ export enum ProviderType { // (undocumented) MAGIC = "magic", // (undocumented) + MAGIC_TEST = "magic_test", + // (undocumented) METAMASK_MOBILE = "metamask_mobile", // (undocumented) NETWORK = "network", diff --git a/src/dapps/provider-type.ts b/src/dapps/provider-type.ts index dac5266..24690fd 100644 --- a/src/dapps/provider-type.ts +++ b/src/dapps/provider-type.ts @@ -7,6 +7,7 @@ import { generateLazyValidator, JSONSchema, ValidateFunction } from '../validati export enum ProviderType { INJECTED = 'injected', MAGIC = 'magic', + MAGIC_TEST = 'magic_test', FORTMATIC = 'formatic', NETWORK = 'network', WALLET_CONNECT = 'wallet_connect', diff --git a/src/misc/deployments-to-sqs.ts b/src/misc/deployments-to-sqs.ts index 459242a..3ad4478 100644 --- a/src/misc/deployments-to-sqs.ts +++ b/src/misc/deployments-to-sqs.ts @@ -12,6 +12,7 @@ export type DeploymentToSqs = { lods?: string[] contentServerUrls?: string[] force?: boolean + animation?: string } /** @@ -44,6 +45,10 @@ export namespace DeploymentToSqs { force: { type: 'boolean', nullable: true + }, + animation: { + type: 'string', + nullable: true } }, additionalProperties: true diff --git a/src/misc/linker-authorization.ts b/src/misc/linker-authorization.ts index f86005c..1c85dcd 100644 --- a/src/misc/linker-authorization.ts +++ b/src/misc/linker-authorization.ts @@ -14,6 +14,7 @@ export type LinkerAuthorization = { name: string [key: string]: string } + onlyDev?: boolean addresses: string[] plots: string[] } @@ -33,6 +34,7 @@ export namespace LinkerAuthorization { }, required: ['name'] }, + onlyDev: { type: 'boolean', nullable: true }, addresses: { type: 'array', items: { type: 'string' }, diff --git a/src/platform/events/base.ts b/src/platform/events/base.ts index 1624c94..8ac2205 100644 --- a/src/platform/events/base.ts +++ b/src/platform/events/base.ts @@ -30,10 +30,12 @@ export namespace Events { export enum Type { BLOCKCHAIN = 'blockchain', CATALYST_DEPLOYMENT = 'catalyst-deployment', + WORLD = 'world', CLIENT = 'client', MARKETPLACE = 'marketplace', REWARDS = 'rewards', - BADGE = 'badge' + BADGE = 'badge', + ASSET_BUNDLE = 'asset-bundle' } export namespace SubType { @@ -60,6 +62,10 @@ export namespace Events { OUTFITS = 'outfits' } + export enum Worlds { + DEPLOYMENT = 'deployment' + } + export enum Client { MOVE_TO_PARCEL = 'move-to-parcel', USED_EMOTE = 'used-emote', @@ -80,6 +86,10 @@ export namespace Events { export enum Badge { GRANTED = 'badge-granted' } + + export enum AssetBundle { + CONVERTED = 'converted' + } } } @@ -92,6 +102,7 @@ export type BaseEvent = { | Events.SubType.Marketplace | Events.SubType.Rewards | Events.SubType.Badge + | Events.SubType.AssetBundle key: string timestamp: number } diff --git a/src/platform/events/services.ts b/src/platform/events/services.ts index 7a2b2fc..2e8d6d7 100644 --- a/src/platform/events/services.ts +++ b/src/platform/events/services.ts @@ -39,3 +39,40 @@ export namespace BadgeGrantedEvent { export const validate: ValidateFunction = generateLazyValidator(schema) } + +export type AssetBundleConversionFinishedEvent = BaseEvent & { + type: Events.Type.ASSET_BUNDLE + subType: Events.SubType.AssetBundle.CONVERTED + metadata: { + entityId: string + platform: 'windows' | 'mac' | 'webgl' + statusCode: number + isLods: boolean + } +} + +export namespace AssetBundleConversionFinishedEvent { + export const schema: JSONSchema = { + type: 'object', + properties: { + type: { type: 'string', const: Events.Type.ASSET_BUNDLE }, + subType: { type: 'string', const: Events.SubType.AssetBundle.CONVERTED }, + key: { type: 'string' }, + timestamp: { type: 'number', minimum: 0 }, + metadata: { + type: 'object', + properties: { + entityId: { type: 'string' }, + platform: { type: 'string', enum: ['windows', 'mac', 'webgl'] }, + statusCode: { type: 'number' }, + isLods: { type: 'boolean' } + }, + required: ['entityId', 'platform', 'statusCode', 'isLods'] + } + }, + required: ['type', 'subType', 'key', 'timestamp', 'metadata'], + additionalProperties: true + } + + export const validate: ValidateFunction = generateLazyValidator(schema) +} diff --git a/test/misc/linker-authorization.spec.ts b/test/misc/linker-authorization.spec.ts index 19d5e47..074c227 100644 --- a/test/misc/linker-authorization.spec.ts +++ b/test/misc/linker-authorization.spec.ts @@ -136,4 +136,21 @@ describe('when validation authorizations', () => { ).toBe(true) }) }) + + describe('and the authorization has the onlyDev property set as a boolean', () => { + it('should return true', () => { + expect( + LinkerAuthorization.validate({ + name: 'aName', + desc: 'aDesc', + contactInfo: { + name: 'aContactInfoName' + }, + addresses: ['0x4730182099bc4e60075C657cCeCEc8879826bb43'], + plots: ['-73,50'], + onlyDev: true + }) + ).toBe(true) + }) + }) }) diff --git a/test/platform/events/asset-bundle-converted.spec.ts b/test/platform/events/asset-bundle-converted.spec.ts new file mode 100644 index 0000000..719a094 --- /dev/null +++ b/test/platform/events/asset-bundle-converted.spec.ts @@ -0,0 +1,23 @@ +import expect from 'expect' +import { AssetBundleConversionFinishedEvent, Events } from '../../../src' + +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', + timestamp: 1, + metadata: { + entityId: 'baf', + platform: 'mac', + statusCode: 1, + isLods: false + } + } + + expect(AssetBundleConversionFinishedEvent.validate(event)).toEqual(true) + expect(AssetBundleConversionFinishedEvent.validate(null)).toEqual(false) + expect(AssetBundleConversionFinishedEvent.validate({})).toEqual(false) + }) +}) diff --git a/test/platform/events/badges.spec.ts b/test/platform/events/badges.spec.ts new file mode 100644 index 0000000..133ca24 --- /dev/null +++ b/test/platform/events/badges.spec.ts @@ -0,0 +1,43 @@ +import expect from 'expect' +import { BadgeGrantedEvent, Events } from '../../../src' + +describe('Badge Events tests', () => { + it('BadgeGrantedEvent static tests must pass', () => { + const event: BadgeGrantedEvent = { + type: Events.Type.BADGE, + subType: Events.SubType.Badge.GRANTED, + key: 'key', + timestamp: 1, + metadata: { + address: '0x', + badgeId: 'a-badge-id', + badgeImageUrl: 'https://an-url.tld', + badgeName: 'Badge Name' + } + } + + expect(BadgeGrantedEvent.validate(event)).toEqual(true) + expect(BadgeGrantedEvent.validate(null)).toEqual(false) + expect(BadgeGrantedEvent.validate({})).toEqual(false) + }) + + it('BadgeGrantedEvent with tier badge id static tests must pass', () => { + const event: BadgeGrantedEvent = { + type: Events.Type.BADGE, + subType: Events.SubType.Badge.GRANTED, + key: 'key', + timestamp: 1, + metadata: { + address: '0x', + badgeId: 'a-badge-id', + badgeImageUrl: 'https://an-url.tld', + badgeName: 'Badge Name', + badgeTierName: 'tier-name' + } + } + + expect(BadgeGrantedEvent.validate(event)).toEqual(true) + expect(BadgeGrantedEvent.validate(null)).toEqual(false) + expect(BadgeGrantedEvent.validate({})).toEqual(false) + }) +})