Skip to content

Commit

Permalink
#288 reset non-java-client files to master (probably some auto-format…
Browse files Browse the repository at this point in the history
…ting during merge)

Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
  • Loading branch information
dguggemos committed Feb 3, 2021
1 parent c20af63 commit 200de4e
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion javascript/lib/api/src/client/handles/things.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/* tslint:disable:no-duplicate-string */
import { GenericResponse, PutResponse } from '../../model/response';
import { Acl, AclEntry, Thing } from '../../model/things.model';
import { DefaultGetThingsOptions, FieldsOptions, GetThingsOptions, MatchOptions } from '../../options/request.options';
import { FieldsOptions, GetThingsOptions, MatchOptions, DefaultGetThingsOptions } from '../../options/request.options';
import { RequestSender, RequestSenderFactory } from '../request-factory/request-sender';
import { HttpThingsHandleV1, HttpThingsHandleV2, WebSocketThingsHandle } from './things.interfaces';

Expand Down
4 changes: 2 additions & 2 deletions javascript/lib/api/src/model/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export abstract class IndexedEntityModel<EntryType extends EntityModel> implemen
* @param mapKey - how to get the key from an objects key.
*/
static fromPlainObject<T extends EntityModel>(objectToMap: Object | undefined,
mapValue: (value: any, key: string) => T,
mapKey: (key: string, value: any) => string = key => key): IndexedEntityModel<T> {
mapValue: (value: any, key: string) => T,
mapKey: (key: string, value: any) => string = key => key): IndexedEntityModel<T> {
if (objectToMap) {
const entries = Object.keys(objectToMap)
.map(k => {
Expand Down
14 changes: 7 additions & 7 deletions javascript/lib/api/src/model/policies.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { EntityModel, EntityWithId, IndexedEntityModel } from './model';
export class Policy extends EntityWithId {

public constructor(private readonly _id: string,
private readonly _entries: Entries) {
private readonly _entries: Entries) {
super();
}

Expand Down Expand Up @@ -82,8 +82,8 @@ export class Entries extends IndexedEntityModel<Entry> {
export class Entry extends EntityWithId {

public constructor(private readonly _id: string,
private readonly _subjects: Subjects,
private readonly _resources: Resources) {
private readonly _subjects: Subjects,
private readonly _resources: Resources) {
super();
}

Expand All @@ -103,7 +103,7 @@ export class Entry extends EntityWithId {
}

public toObject(): Object {
const subjectsObj = Subjects.toObject(this.subjects);
const subjectsObj = Subjects.toObject(this.subjects) ;
const resourcesObj = Resources.toObject(this.resources);
return EntityModel.buildObject(new Map<string, any>([
['subjects', subjectsObj],
Expand Down Expand Up @@ -196,7 +196,7 @@ export type SubjectType = string;
export class Subject extends EntityWithId {

public constructor(private readonly _id: SubjectId,
private readonly _type: SubjectType) {
private readonly _type: SubjectType) {
super();
}

Expand Down Expand Up @@ -241,8 +241,8 @@ export enum AccessRight {
export class Resource extends EntityWithId {

public constructor(private readonly _id: string,
private readonly _grant: AccessRight[],
private readonly _revoke: AccessRight[]) {
private readonly _grant: AccessRight[],
private readonly _revoke: AccessRight[]) {
super();
}

Expand Down
22 changes: 11 additions & 11 deletions javascript/lib/api/src/model/things.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export class Thing extends EntityWithId {
public static readonly NAMESPACE_SEPARATION_REGEX = /([^:]*):(.*)/;

public constructor(private readonly _thingId: string,
private readonly _policyId?: string,
private readonly _attributes?: Record<string, any>,
private readonly _features?: Features,
private readonly __revision?: number,
private readonly __modified?: string,
private readonly _acl?: Acl) {
private readonly _policyId?: string,
private readonly _attributes?: Record<string, any>,
private readonly _features?: Features,
private readonly __revision?: number,
private readonly __modified?: string,
private readonly _acl?: Acl) {
super();
}

Expand Down Expand Up @@ -143,8 +143,8 @@ export class Features extends IndexedEntityModel<Feature> {
export class Feature extends EntityWithId {

public constructor(private readonly _id: string,
private readonly _definition?: string[],
private readonly _properties?: Record<string, any>) {
private readonly _definition?: string[],
private readonly _properties?: Record<string, any>) {
super();
}

Expand Down Expand Up @@ -204,9 +204,9 @@ export class Acl extends IndexedEntityModel<AclEntry> {
export class AclEntry extends EntityWithId {

public constructor(private readonly _id: string,
private readonly _read: boolean,
private readonly _write: boolean,
private readonly _administrate: boolean) {
private readonly _read: boolean,
private readonly _write: boolean,
private readonly _administrate: boolean) {
super();
}

Expand Down
2 changes: 1 addition & 1 deletion javascript/lib/api/tests/client/http/features.http.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
/* tslint:disable:no-big-function */
import { FeaturesHandle } from '../../../src/client/handles/features.interfaces';
import { PutResponse } from '../../../src/model/response';
import { Features } from '../../../src/model/things.model';
import { HttpHelper as H } from './http.helper';
import { Features } from '../../../src/model/things.model';

describe('Http Features Handle', () => {
const baseRequest = `things/${H.thing.thingId}/features`;
Expand Down
2 changes: 1 addition & 1 deletion javascript/lib/api/tests/client/test.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* SPDX-License-Identifier: EPL-2.0
*/

import { AuthProvider, DittoHeaders, DittoURL } from '../../src/auth/auth-provider';
import { Feature, Thing } from '../../src/model/things.model';
import { AuthProvider, DittoHeaders, DittoURL } from '../../src/auth/auth-provider';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/

import { ProtocolResponseValue } from '../../../src/client/request-factory/websocket-request-handler';
import { Features } from '../../../src/model/things.model';
import { EventsHelper as H } from './events.helper';
import { Features } from '../../../src/model/things.model';


describe('WebSocket Commands Handle', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/

import { ProtocolResponseValue } from '../../../src/client/request-factory/websocket-request-handler';
import { Features } from '../../../src/model/things.model';
import { EventsHelper as H } from './events.helper';
import { Features } from '../../../src/model/things.model';


describe('WebSocket Events Handle', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* SPDX-License-Identifier: EPL-2.0
*/

import { Features } from '../../../src/model/things.model';
import { WebSocketHelper as H } from './websocket.helper';
import { Features } from '../../../src/model/things.model';

// tslint:disable-next-line:no-big-function
describe('WebSocket Features Handle', () => {
Expand Down
11 changes: 4 additions & 7 deletions javascript/lib/api/tests/model/policies.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

/* tslint:disable:no-duplicate-string */
import {
AccessRight,
DittoSubjectIssuer,
AccessRight, DittoSubjectIssuer,
Entries,
Entry,
Policy,
Resource,
Resources,
Subject,
SubjectId,
Subjects
Subjects,
SubjectType
} from '../../src/model/policies.model';

const aResourceObj = { grant: ['READ'], revoke: ['READ'] };
Expand Down Expand Up @@ -136,10 +136,7 @@ describe('Entry', () => {
expect(Entry.fromObject(anEntryObj, 'label1').equals(anEntry)).toBe(true);
});
it('builds an object', () => {
expect(anEntry.toObject()).toEqual({
subjects: Subjects.toObject(someSubjects),
resources: Resources.toObject(someResources)
});
expect(anEntry.toObject()).toEqual({ subjects: Subjects.toObject(someSubjects), resources: Resources.toObject(someResources) });
});
it('returns its content', () => {
expect(anEntry.id).toEqual('label1');
Expand Down
16 changes: 8 additions & 8 deletions legal/templates/third-party-file.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
<#assign p = e.getKey()/>
<#assign licenses = e.getValue()/>
<#return "## " + p.name + " (" + p.version + ")"
+ "\n\n* Maven coordinates: `" + p.groupId + ":" + p.artifactId + ":" + p.version + "`"
+ "\n* License: " + licenseFormat(licenses)
+ "\n* Project: " + ((p.url)!"not declared")
+ "\n* Sources: "
+ "\n * declared as SCM: " + ((p.scm.url)!"not declared")
+ "\n\n* Maven coordinates: `" + p.groupId + ":" + p.artifactId + ":" + p.version + "`"
+ "\n* License: " + licenseFormat(licenses)
+ "\n* Project: " + ((p.url)!"not declared")
+ "\n* Sources: "
+ "\n * declared as SCM: " + ((p.scm.url)!"not declared")
?replace('(git@|scm:git:git://|git://|http://)','https://','r')
?replace('.git','')
?replace('https://github.com:','https://github.com/')
?replace('^github.com/','https://github.com/','r')
+ "\n * Maven sources: https://search.maven.org/remotecontent?filepath=" +
(p.groupId)?replace('.','/') + "/" + (p.artifactId) + "/" + (p.version) + "/" + (p.artifactId) + "-" + (p.version) + "-sources.jar"
?replace('^github.com/','https://github.com/','r')
+ "\n * Maven sources: https://search.maven.org/remotecontent?filepath=" +
(p.groupId)?replace('.','/') + "/" + (p.artifactId) + "/" + (p.version) + "/" + (p.artifactId) + "-" + (p.version) + "-sources.jar"
+ "\n\n">
</#function>
# Third-party Content
Expand Down

0 comments on commit 200de4e

Please sign in to comment.