Skip to content

Commit

Permalink
Merge pull request #84 from ember-nexus/github-issue/83
Browse files Browse the repository at this point in the history
**Breaking**: Changed browser event namespace from `ember-nexus-` to …
  • Loading branch information
Syndesi authored Jul 11, 2024
2 parents 41da198 + a31a207 commit 649f469
Show file tree
Hide file tree
Showing 23 changed files with 80 additions and 78 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Changed
- **Breaking**: Changed browser event namespace from `ember-nexus-` to `ember-nexus-sdk-`, closes #83.

## 0.0.58 - 2024-07-08
### Changed
Expand Down
Empty file modified docs/type/assets/26e93147f10415a0ed4a.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/type/assets/75c9471662e97ee24f29.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/type/assets/db90e4df2373980c497d.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/type/assets/hierarchy.css
100644 → 100755
Empty file.
Empty file modified docs/type/assets/hierarchy.js
100644 → 100755
Empty file.
Empty file modified docs/type/assets/style.css
100644 → 100755
Empty file.

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions src/Type/Enum/EventIdentifier.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
enum EventIdentifier {
// user
PostRegister = 'ember-nexus-post-register',
PostChangePassword = 'ember-nexus-post-change-password',
GetMe = 'ember-nexus-get-me',
PostToken = 'ember-nexus-post-token',
GetToken = 'ember-nexus-get-token',
DeleteToken = 'ember-nexus-delete-token',
PostRegister = 'ember-nexus-sdk-post-register',
PostChangePassword = 'ember-nexus-sdk-post-change-password',
GetMe = 'ember-nexus-sdk-get-me',
PostToken = 'ember-nexus-sdk-post-token',
GetToken = 'ember-nexus-sdk-get-token',
DeleteToken = 'ember-nexus-sdk-delete-token',

// element
GetIndex = 'ember-nexus-get-index',
GetElement = 'ember-nexus-get-element',
GetElementParents = 'ember-nexus-get-element-parents',
GetElementChildren = 'ember-nexus-get-element-children',
GetElementRelated = 'ember-nexus-get-element-related',
PostIndex = 'ember-nexus-post-index',
PostElement = 'ember-nexus-post-element',
PutElement = 'ember-nexus-put-element',
PatchElement = 'ember-nexus-patch-element',
DeleteElement = 'ember-nexus-delete-element',
GetIndex = 'ember-nexus-sdk-get-index',
GetElement = 'ember-nexus-sdk-get-element',
GetElementParents = 'ember-nexus-sdk-get-element-parents',
GetElementChildren = 'ember-nexus-sdk-get-element-children',
GetElementRelated = 'ember-nexus-sdk-get-element-related',
PostIndex = 'ember-nexus-sdk-post-index',
PostElement = 'ember-nexus-sdk-post-element',
PutElement = 'ember-nexus-sdk-put-element',
PatchElement = 'ember-nexus-sdk-patch-element',
DeleteElement = 'ember-nexus-sdk-delete-element',

// file
GetElementFile = 'ember-nexus-get-element-file',
PostElementFile = 'ember-nexus-post-element-file',
PutElementFile = 'ember-nexus-put-element-file',
PatchElementFile = 'ember-nexus-patch-element-file',
DeleteElementFile = 'ember-nexus-delete-element-file',
GetElementFile = 'ember-nexus-sdk-get-element-file',
PostElementFile = 'ember-nexus-sdk-post-element-file',
PutElementFile = 'ember-nexus-sdk-put-element-file',
PatchElementFile = 'ember-nexus-sdk-patch-element-file',
DeleteElementFile = 'ember-nexus-sdk-delete-element-file',

// webDAV
CopyElement = 'ember-nexus-copy-element',
LockElement = 'ember-nexus-lock-element',
UnlockElement = 'ember-nexus-unlock-element',
MkcolElement = 'ember-nexus-mkcol-element',
MoveElement = 'ember-nexus-move-element',
PropfindElement = 'ember-nexus-propfind-element',
ProppatchElement = 'ember-nexus-proppatch-element',
CopyElement = 'ember-nexus-sdk-copy-element',
LockElement = 'ember-nexus-sdk-lock-element',
UnlockElement = 'ember-nexus-sdk-unlock-element',
MkcolElement = 'ember-nexus-sdk-mkcol-element',
MoveElement = 'ember-nexus-sdk-move-element',
PropfindElement = 'ember-nexus-sdk-propfind-element',
ProppatchElement = 'ember-nexus-sdk-proppatch-element',

// search
PostSearch = 'ember-nexus-post-search',
PostSearch = 'ember-nexus-sdk-post-search',

// system
GetInstanceConfiguration = 'ember-nexus-get-instance-configuration',
GetInstanceConfiguration = 'ember-nexus-sdk-get-instance-configuration',
}

export { EventIdentifier };
68 changes: 34 additions & 34 deletions test/Unit/BrowserEvent/BrowserEventHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,30 @@ describe('BrowserEventHandler tests', () => {
expect(eventListenerKeys).to.have.length(16);

// user
expect(eventListenerKeys).to.include('ember-nexus-post-register');
expect(eventListenerKeys).to.include('ember-nexus-post-change-password');
expect(eventListenerKeys).to.include('ember-nexus-get-me');
expect(eventListenerKeys).to.include('ember-nexus-post-token');
expect(eventListenerKeys).to.include('ember-nexus-get-token');
expect(eventListenerKeys).to.include('ember-nexus-delete-token');
expect(eventListenerKeys).to.include('ember-nexus-sdk-post-register');
expect(eventListenerKeys).to.include('ember-nexus-sdk-post-change-password');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-me');
expect(eventListenerKeys).to.include('ember-nexus-sdk-post-token');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-token');
expect(eventListenerKeys).to.include('ember-nexus-sdk-delete-token');

// element
expect(eventListenerKeys).to.include('ember-nexus-get-index');
expect(eventListenerKeys).to.include('ember-nexus-get-element');
expect(eventListenerKeys).to.include('ember-nexus-get-element-parents');
expect(eventListenerKeys).to.include('ember-nexus-get-element-children');
expect(eventListenerKeys).to.include('ember-nexus-get-element-related');
expect(eventListenerKeys).to.include('ember-nexus-post-index');
expect(eventListenerKeys).to.include('ember-nexus-post-element');
expect(eventListenerKeys).to.include('ember-nexus-put-element');
expect(eventListenerKeys).to.include('ember-nexus-patch-element');
expect(eventListenerKeys).to.include('ember-nexus-delete-element');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-index');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-element');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-element-parents');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-element-children');
expect(eventListenerKeys).to.include('ember-nexus-sdk-get-element-related');
expect(eventListenerKeys).to.include('ember-nexus-sdk-post-index');
expect(eventListenerKeys).to.include('ember-nexus-sdk-post-element');
expect(eventListenerKeys).to.include('ember-nexus-sdk-put-element');
expect(eventListenerKeys).to.include('ember-nexus-sdk-patch-element');
expect(eventListenerKeys).to.include('ember-nexus-sdk-delete-element');

// search
// expect(eventListenerKeys).to.include('ember-nexus-post-search');
// expect(eventListenerKeys).to.include('ember-nexus-sdk-post-search');

// system
// expect(eventListenerKeys).to.include('ember-nexus-get-instance-configuration');
// expect(eventListenerKeys).to.include('ember-nexus-sdk-get-instance-configuration');

browserEventHandler.removeBrowserEventListeners();

Expand All @@ -112,7 +112,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetElementEvent(uuid);
elementMock.getEventListeners()['ember-nexus-get-element'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-element'](event);
const returnedElement = await event.getElement();
expect(returnedElement).to.be.equal(elementToBeReturned);

Expand Down Expand Up @@ -145,7 +145,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetElementChildrenEvent(uuid);
elementMock.getEventListeners()['ember-nexus-get-element-children'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-element-children'](event);
const returnedCollection = await event.getChildren();
expect(returnedCollection).to.be.equal(collectionToBeReturned);

Expand Down Expand Up @@ -178,7 +178,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetElementParentsEvent(uuid);
elementMock.getEventListeners()['ember-nexus-get-element-parents'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-element-parents'](event);
const returnedCollection = await event.getParents();
expect(returnedCollection).to.be.equal(collectionToBeReturned);

Expand Down Expand Up @@ -211,7 +211,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetElementRelatedEvent(uuid);
elementMock.getEventListeners()['ember-nexus-get-element-related'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-element-related'](event);
const returnedCollection = await event.getRelated();
expect(returnedCollection).to.be.equal(collectionToBeReturned);

Expand Down Expand Up @@ -243,7 +243,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetIndexEvent();
elementMock.getEventListeners()['ember-nexus-get-index'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-index'](event);
const returnedCollection = await event.getIndexCollection();
expect(returnedCollection).to.be.equal(collectionToBeReturned);

Expand All @@ -267,7 +267,7 @@ describe('BrowserEventHandler tests', () => {
type: 'Data',
data: {},
} as NodeWithOptionalId);
elementMock.getEventListeners()['ember-nexus-post-index'](event);
elementMock.getEventListeners()['ember-nexus-sdk-post-index'](event);
const returnedUuid = await event.getElementId();
expect(returnedUuid).to.be.equal(uuidToBeReturned);

Expand All @@ -291,7 +291,7 @@ describe('BrowserEventHandler tests', () => {
type: 'Data',
data: {},
} as NodeWithOptionalId);
elementMock.getEventListeners()['ember-nexus-post-element'](event);
elementMock.getEventListeners()['ember-nexus-sdk-post-element'](event);
const returnedUuid = await event.getElementId();
expect(returnedUuid).to.be.equal(uuidToBeReturned);

Expand All @@ -311,7 +311,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new PutElementEvent(validateUuidFromString('58a7dc13-ac78-4cac-b786-b09275a60c9e'), {} as Data);
elementMock.getEventListeners()['ember-nexus-put-element'](event);
elementMock.getEventListeners()['ember-nexus-sdk-put-element'](event);
await event.getResult();

browserEventHandler.removeBrowserEventListeners();
Expand All @@ -330,7 +330,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new PatchElementEvent(validateUuidFromString('58a7dc13-ac78-4cac-b786-b09275a60c9e'), {} as Data);
elementMock.getEventListeners()['ember-nexus-patch-element'](event);
elementMock.getEventListeners()['ember-nexus-sdk-patch-element'](event);
await event.getResult();

browserEventHandler.removeBrowserEventListeners();
Expand All @@ -349,7 +349,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new DeleteElementEvent(validateUuidFromString('58a7dc13-ac78-4cac-b786-b09275a60c9e'));
elementMock.getEventListeners()['ember-nexus-delete-element'](event);
elementMock.getEventListeners()['ember-nexus-sdk-delete-element'](event);
await event.getResult();

browserEventHandler.removeBrowserEventListeners();
Expand All @@ -369,7 +369,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new PostRegisterEvent(createUniqueUserIdentifierFromString('someIdentifier'), 'password', {} as Data);
elementMock.getEventListeners()['ember-nexus-post-register'](event);
elementMock.getEventListeners()['ember-nexus-sdk-post-register'](event);
const returnedUuid = await event.getUserId();
expect(returnedUuid).to.be.equal(uuidToBeReturned);

Expand All @@ -393,7 +393,7 @@ describe('BrowserEventHandler tests', () => {
'currentPassword',
'newPassword',
);
elementMock.getEventListeners()['ember-nexus-post-change-password'](event);
elementMock.getEventListeners()['ember-nexus-sdk-post-change-password'](event);
await event.getResult();

browserEventHandler.removeBrowserEventListeners();
Expand All @@ -418,7 +418,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetMeEvent();
elementMock.getEventListeners()['ember-nexus-get-me'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-me'](event);
const returnedElement = await event.getMe();
expect(returnedElement).to.be.equal(elementToBeReturned);

Expand All @@ -439,7 +439,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new PostTokenEvent(createUniqueUserIdentifierFromString('someIdentifier'), 'currentPassword');
elementMock.getEventListeners()['ember-nexus-post-token'](event);
elementMock.getEventListeners()['ember-nexus-sdk-post-token'](event);
const returnedToken = await event.getToken();
expect(returnedToken).to.be.equal(token);

Expand All @@ -465,7 +465,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new GetTokenEvent();
elementMock.getEventListeners()['ember-nexus-get-token'](event);
elementMock.getEventListeners()['ember-nexus-sdk-get-token'](event);
const returnedElement = await event.getToken();
expect(returnedElement).to.be.equal(elementToBeReturned);

Expand All @@ -485,7 +485,7 @@ describe('BrowserEventHandler tests', () => {
browserEventHandler.addBrowserEventListeners(elementMock as HTMLElement);

const event = new DeleteTokenEvent();
elementMock.getEventListeners()['ember-nexus-delete-token'](event);
elementMock.getEventListeners()['ember-nexus-sdk-delete-token'](event);
await event.getResult();

browserEventHandler.removeBrowserEventListeners();
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/DeleteElementEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { validateUuidFromString } from '../../../../src/Type/Definition';

describe('DeleteElementEvent tests', () => {
test('DeleteElementEvent returns correct type', () => {
expect(DeleteElementEvent.type).to.equal('ember-nexus-delete-element');
expect(DeleteElementEvent.type).to.equal('ember-nexus-sdk-delete-element');
});

it('should return null when no result was set', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Collection, validateUuidFromString } from '../../../../src/Type/Definit

describe('GetElementChildrenEvent tests', () => {
test('GetElementChildrenEvent returns correct type', () => {
expect(GetElementChildrenEvent.type).to.equal('ember-nexus-get-element-children');
expect(GetElementChildrenEvent.type).to.equal('ember-nexus-sdk-get-element-children');
});

it('should return null when no element was set', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/GetElementEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Node, Relation, validateUuidFromString } from '../../../../src/Type/Def

describe('GetElementEvent tests', () => {
test('GetElementEvent returns correct type', () => {
expect(GetElementEvent.type).to.equal('ember-nexus-get-element');
expect(GetElementEvent.type).to.equal('ember-nexus-sdk-get-element');
});

it('should return null when no element was set', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Collection, validateUuidFromString } from '../../../../src/Type/Definit

describe('GetElementParentsEvent tests', () => {
test('GetElementParentsEvent returns correct type', () => {
expect(GetElementParentsEvent.type).to.equal('ember-nexus-get-element-parents');
expect(GetElementParentsEvent.type).to.equal('ember-nexus-sdk-get-element-parents');
});

it('should return null when no element was set', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Collection, validateUuidFromString } from '../../../../src/Type/Definit

describe('GetElementRelatedEvent tests', () => {
test('GetElementRelatedEvent returns correct type', () => {
expect(GetElementRelatedEvent.type).to.equal('ember-nexus-get-element-related');
expect(GetElementRelatedEvent.type).to.equal('ember-nexus-sdk-get-element-related');
});

it('should return null when no element was set', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/GetIndexEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Collection } from '../../../../src/Type/Definition';

describe('GetIndexEvent tests', () => {
test('GetIndexEvent returns correct type', () => {
expect(GetIndexEvent.type).to.equal('ember-nexus-get-index');
expect(GetIndexEvent.type).to.equal('ember-nexus-sdk-get-index');
});

it('should return null when no element was set', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/PatchElementEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { validateUuidFromString } from '../../../../src/Type/Definition';

describe('PatchElementEvent tests', () => {
test('PatchElementEvent returns correct type', () => {
expect(PatchElementEvent.type).to.equal('ember-nexus-patch-element');
expect(PatchElementEvent.type).to.equal('ember-nexus-sdk-patch-element');
});

it('should set attributes to null if not explicitly defined', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/PostElementEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NodeWithOptionalId, Uuid, validateUuidFromString } from '../../../../sr

describe('PostElementEvent tests', () => {
test('PostElementEvent returns correct type', () => {
expect(PostElementEvent.type).to.equal('ember-nexus-post-element');
expect(PostElementEvent.type).to.equal('ember-nexus-sdk-post-element');
});

it('should set attributes to null if not explicitly defined', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/PostIndexEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NodeWithOptionalId, Uuid, validateUuidFromString } from '../../../../sr

describe('PostIndexEvent tests', () => {
test('PostIndexEvent returns correct type', () => {
expect(PostIndexEvent.type).to.equal('ember-nexus-post-index');
expect(PostIndexEvent.type).to.equal('ember-nexus-sdk-post-index');
});

it('should set attributes to null if not explicitly defined', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Element/PutElementEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { validateUuidFromString } from '../../../../src/Type/Definition';

describe('PutElementEvent tests', () => {
test('PutElementEvent returns correct type', () => {
expect(PutElementEvent.type).to.equal('ember-nexus-put-element');
expect(PutElementEvent.type).to.equal('ember-nexus-sdk-put-element');
});

it('should set attributes to null if not explicitly defined', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/Search/PostSearchEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Data, ElementCollection, validateUuidFromString } from '../../../../src

describe('PostSearchEvent tests', () => {
test('PostSearchEvent returns correct type', () => {
expect(PostSearchEvent.type).to.equal('ember-nexus-post-search');
expect(PostSearchEvent.type).to.equal('ember-nexus-sdk-post-search');
});

it('should set attributes to null if not explicitly defined', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { InstanceConfiguration } from '../../../../src/Type/Definition';

describe('GetInstanceConfigurationEvent tests', () => {
test('GetInstanceConfigurationEvent returns correct type', () => {
expect(GetInstanceConfigurationEvent.type).to.equal('ember-nexus-get-instance-configuration');
expect(GetInstanceConfigurationEvent.type).to.equal('ember-nexus-sdk-get-instance-configuration');
});

it('should return null when no result was set', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/BrowserEvent/User/DeleteTokenEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DeleteTokenEvent } from '../../../../src/BrowserEvent/User';

describe('DeleteTokenEvent tests', () => {
test('DeleteTokenEvent returns correct type', () => {
expect(DeleteTokenEvent.type).to.equal('ember-nexus-delete-token');
expect(DeleteTokenEvent.type).to.equal('ember-nexus-sdk-delete-token');
});

it('should return null when no result was set', async () => {
Expand Down

0 comments on commit 649f469

Please sign in to comment.