@diory/client-js 0.2.2 → 0.4.0-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { IDiographObject } from '@diograph/diograph';
2
2
  import { IConnectionObject, IDiosphereObject } from '@diory/diosphere-js';
3
- import { IConnectionClient, IDataClient } from '../types';
3
+ import { IDataClient } from '@diograph/local-client';
4
+ import { IConnectionClient } from '../types';
4
5
  declare class ConnectionClient implements IConnectionClient {
5
6
  type: string;
6
7
  client: IDataClient;
@@ -1,6 +1,7 @@
1
1
  import { IConnectionObject, IDiosphere, IDiosphereObject, IRoom, IRoomObject } from '@diory/diosphere-js';
2
2
  import { IDiograph, IDiographObject, IDiory, IDioryObject } from '@diograph/diograph';
3
- import { IDioryClient, IDataClient } from '../types';
3
+ import { IDataClient } from '@diograph/local-client';
4
+ import { IDioryClient } from '../types';
4
5
  declare class DioryClient implements IDioryClient {
5
6
  dataClients: IDataClient[];
6
7
  connections: IConnectionObject[];
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { DioryClient } from './dioryClient/dioryClient';
2
2
  export { ConnectionClient } from './connectionClient/connectionClient';
3
- export { IDioryClient, IConnectionClient, IDataClient, IFileType, IMetadata } from './types';
3
+ export { IDioryClient, IConnectionClient } from './types';
package/dist/types.d.ts CHANGED
@@ -1,36 +1,6 @@
1
- /// <reference types="node" />
2
1
  import { IConnectionObject, IDiosphere, IDiosphereObject, IRoom, IRoomObject } from '@diory/diosphere-js';
3
2
  import { IDiograph, IDiographObject, IDiory, IDioryObject } from '@diograph/diograph';
4
- export interface IMetadata {
5
- name: string;
6
- created?: string;
7
- modified?: string;
8
- duration?: string;
9
- thumbnail?: string;
10
- latlng?: string;
11
- }
12
- export interface IFileType {
13
- ext?: string;
14
- mime?: string;
15
- }
16
- export interface IDataClient {
17
- type: string;
18
- readTextItem(url: string): Promise<string>;
19
- readItem(url: string): Promise<Buffer>;
20
- readToStream(url: string): any;
21
- exists(url: string): Promise<boolean>;
22
- writeTextItem(url: string, fileContent: string): Promise<boolean>;
23
- writeItem(url: string, fileContent: Buffer | string): Promise<boolean>;
24
- deleteItem(url: string): Promise<boolean>;
25
- deleteFolder(url: string): Promise<void>;
26
- list(url: string): Promise<string[]>;
27
- getFileNames(url: string): Promise<string[]>;
28
- getFolderNames(url: string): Promise<string[]>;
29
- getFileType(url: string): Promise<IFileType>;
30
- getMetadata(url: string): IMetadata;
31
- getThumbnail?(imageUrl: string): Promise<string | undefined>;
32
- getVideoMetadata?(videoUrl: string): Promise<IMetadata>;
33
- }
3
+ import { IDataClient } from '@diograph/local-client';
34
4
  export interface IConnectionClient {
35
5
  type: string;
36
6
  client: IDataClient;
@@ -1,3 +1,4 @@
1
1
  import { IConnectionObject } from '@diory/diosphere-js';
2
- import { IConnectionClient, IDataClient } from '../types';
2
+ import { IDataClient } from '@diograph/local-client';
3
+ import { IConnectionClient } from '../types';
3
4
  export declare function getConnectionClients(dataClients: IDataClient[], connections?: IConnectionObject[]): IConnectionClient[];
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@diory/client-js",
3
- "version": "0.2.2",
3
+ "version": "0.4.0-rc1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Olli-Pekka Pohjola <op@diory.me>, Jouni Alanen <jouni@diory.me>",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
9
  "@diograph/diograph": "^0.3.0",
10
- "@diograph/folder-generator": "^0.3.0",
10
+ "@diograph/folder-generator": "^0.4.0-rc1",
11
+ "@diograph/local-client": "^0.3.2",
11
12
  "@diory/diosphere-js": "^0.2.6",
12
13
  "path-browserify": "^1.0.1",
13
14
  "uuid": "8.3.2"
@@ -3,7 +3,9 @@ import { generateDiograph } from '@diograph/folder-generator'
3
3
 
4
4
  import { IDiographObject } from '@diograph/diograph'
5
5
  import { IConnectionObject, IDiosphereObject } from '@diory/diosphere-js'
6
- import { IConnectionClient, IDataClient } from '../types'
6
+ import { IDataClient } from '@diograph/local-client'
7
+
8
+ import { IConnectionClient } from '../types'
7
9
 
8
10
  const DIOSPHERE_JSON = 'diosphere.json'
9
11
  const DIOGRAPH_JSON = 'diograph.json'
@@ -7,8 +7,9 @@ import {
7
7
  IRoomObject,
8
8
  } from '@diory/diosphere-js'
9
9
  import { Diograph, IDiograph, IDiographObject, IDiory, IDioryObject } from '@diograph/diograph'
10
+ import { IDataClient } from '@diograph/local-client'
10
11
 
11
- import { IDioryClient, IDataClient } from '../types'
12
+ import { IDioryClient } from '../types'
12
13
  import { getConnectionClients } from '../utils/getConnectionClients'
13
14
  import { debounce } from '../utils/debounce'
14
15
 
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { DioryClient } from './dioryClient/dioryClient'
2
2
  export { ConnectionClient } from './connectionClient/connectionClient'
3
- export { IDioryClient, IConnectionClient, IDataClient, IFileType, IMetadata } from './types'
3
+ export { IDioryClient, IConnectionClient } from './types'
package/src/types.ts CHANGED
@@ -6,39 +6,7 @@ import {
6
6
  IRoomObject,
7
7
  } from '@diory/diosphere-js'
8
8
  import { IDiograph, IDiographObject, IDiory, IDioryObject } from '@diograph/diograph'
9
-
10
- export interface IMetadata {
11
- name: string
12
- created?: string
13
- modified?: string
14
- duration?: string
15
- thumbnail?: string
16
- latlng?: string
17
- }
18
-
19
- export interface IFileType {
20
- ext?: string
21
- mime?: string
22
- }
23
-
24
- export interface IDataClient {
25
- type: string
26
- readTextItem(url: string): Promise<string>
27
- readItem(url: string): Promise<Buffer>
28
- readToStream(url: string): any
29
- exists(url: string): Promise<boolean>
30
- writeTextItem(url: string, fileContent: string): Promise<boolean>
31
- writeItem(url: string, fileContent: Buffer | string): Promise<boolean>
32
- deleteItem(url: string): Promise<boolean>
33
- deleteFolder(url: string): Promise<void>
34
- list(url: string): Promise<string[]>
35
- getFileNames(url: string): Promise<string[]>
36
- getFolderNames(url: string): Promise<string[]>
37
- getFileType(url: string): Promise<IFileType>
38
- getMetadata(url: string): IMetadata
39
- getThumbnail?(imageUrl: string): Promise<string | undefined>
40
- getVideoMetadata?(videoUrl: string): Promise<IMetadata>
41
- }
9
+ import { IDataClient } from '@diograph/local-client'
42
10
 
43
11
  export interface IConnectionClient {
44
12
  type: string
@@ -1,7 +1,8 @@
1
1
  import { IConnectionObject } from '@diory/diosphere-js'
2
+ import { IDataClient } from '@diograph/local-client'
2
3
 
3
4
  import { ConnectionClient } from '../connectionClient/connectionClient'
4
- import { IConnectionClient, IDataClient } from '../types'
5
+ import { IConnectionClient } from '../types'
5
6
 
6
7
  function getDataClient(
7
8
  dataClients: IDataClient[],