mirror of
https://github.com/esiur/esiur-js.git
synced 2026-03-18 15:30:38 +00:00
Esiur 1.2.3
This commit is contained in:
@@ -28,9 +28,9 @@
|
||||
|
||||
import IStore from '../../Resource/IStore.js';
|
||||
import Session from '../../Security/Authority/Session.js';
|
||||
import {Authentication, AuthenticationType} from '../../Security/Authority/Authentication.js';
|
||||
import IIPPacket from '../../Net/Packets/IIPPacket.js';
|
||||
import IIPAuthPacket from '../../Net/Packets/IIPAuthPacket.js';
|
||||
import Authentication from '../../Security/Authority/Authentication.js';
|
||||
import AuthenticationType from "../../Security/Authority/AuthenticationType.js";
|
||||
|
||||
import SHA256 from '../../Security/Integrity/SHA256.js';
|
||||
import {BL, DC} from '../../Data/DataConverter.js';
|
||||
import SendList from '../SendList.js';
|
||||
@@ -42,6 +42,29 @@ import KeyList from '../../Data/KeyList.js';
|
||||
import AsyncQueue from '../../Engine/AsyncQueue.js';
|
||||
import Warehouse from '../../Resource/Warehouse.js';
|
||||
|
||||
import IIPAuthPacket from "../Packets/IIPAuthPacket.js";
|
||||
import IIPPacket from "../Packets/IIPPacket.js";
|
||||
import IIPAuthPacketAction from "../Packets/IIPAuthPacketAction.js";
|
||||
import IIPAuthPacketCommand from "../Packets/IIPAuthPacketCommand.js";
|
||||
import IIPAuthPacketMethod from "../Packets/IIPAuthPacketMethod.js";
|
||||
|
||||
import IIPPacketAction from "../Packets/IIPPacketAction.js";
|
||||
import IIPPacketCommand from "../Packets/IIPPacketCommand.js";
|
||||
import IIPPacketEvent from "../Packets/IIPPacketEvent.js";
|
||||
import IIPPacketReport from "../Packets//IIPPacketReport.js";
|
||||
|
||||
import ErrorType from "../../Engine/ErrorType.js";
|
||||
import ProgressType from "../../Engine/ProgressType.js";
|
||||
import ExceptionCode from "../../Engine/ExceptionCode.js";
|
||||
|
||||
import DistributedResource from './DistributedResource.js';
|
||||
import ResourceTemplate from '../../Resource/Template/ResourceTemplate.js';
|
||||
|
||||
import DistributedResourceQueueItem from './DistributedResourceQueueItem.js';
|
||||
import DistributedResourceQueueItemType from './DistributedResourceQueueItemType.js';
|
||||
|
||||
import DistributedPropertyContext from './DistributedPropertyContext.js';
|
||||
|
||||
export default class DistributedConnection extends IStore {
|
||||
|
||||
send(data) {
|
||||
@@ -157,7 +180,7 @@ export default class DistributedConnection extends IStore {
|
||||
var self = this;
|
||||
|
||||
this.socket.onopen = function () {
|
||||
var bl = new BinaryList();
|
||||
var bl = BL();
|
||||
bl.addUint8(0x60).addUint8(dmn.length).addUint8Array(dmn).addUint8Array(self.localNonce).addUint8(un.length).addUint8Array(un);
|
||||
self.send(bl.toArray());
|
||||
};
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
import IResource from '../../Resource/IResource.js';
|
||||
import AsyncReply from '../../Engine/AsyncReply.js';
|
||||
import Codec from '../../Data/Codec.js';
|
||||
import Structure from '../../Data/Structure.js';
|
||||
import IIPPacketAction from '../Packets//IIPPacketAction.js';
|
||||
|
||||
export default class DistributedResource extends IResource
|
||||
{
|
||||
@@ -87,7 +89,7 @@ export default class DistributedResource extends IResource
|
||||
{
|
||||
var func = function () {
|
||||
|
||||
if ( arguments.length = 1
|
||||
if ( arguments.length == 1
|
||||
&& arguments[0] instanceof Object
|
||||
&& arguments[0].constructor.name == "Object")
|
||||
{
|
||||
|
||||
@@ -26,11 +26,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
export const DistributedResourceQueueItemType =
|
||||
{
|
||||
Propery: 0,
|
||||
Event: 1
|
||||
};
|
||||
|
||||
export default class DistributedResourceQueueItem {
|
||||
constructor(resource, type, value, index) {
|
||||
|
||||
6
src/Net/IIP/DistributedResourceQueueItemType.js
Normal file
6
src/Net/IIP/DistributedResourceQueueItemType.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
export default
|
||||
{
|
||||
Propery: 0,
|
||||
Event: 1
|
||||
};
|
||||
@@ -27,31 +27,9 @@
|
||||
"use strict";
|
||||
|
||||
|
||||
export const IIPAuthPacketCommand =
|
||||
{
|
||||
Action: 0,
|
||||
Declare: 1,
|
||||
Acknowledge: 2,
|
||||
Error: 3
|
||||
};
|
||||
|
||||
export const IIPAuthPacketAction =
|
||||
{
|
||||
// Authenticate
|
||||
AuthenticateHash: 0,
|
||||
NewConnection: 0x20,
|
||||
ResumeConnection: 0x21,
|
||||
ConnectionEstablished: 0x28
|
||||
};
|
||||
|
||||
|
||||
export const IIPAuthPacketMethod =
|
||||
{
|
||||
None: 0,
|
||||
Certificate: 1,
|
||||
Credentials: 2,
|
||||
Token: 3
|
||||
};
|
||||
import IIPAuthPacketCommand from "./IIPAuthPacketCommand.js";
|
||||
import IIPAuthPacketAction from "./IIPAuthPacketAction.js";
|
||||
import IIPAuthPacketMethod from "./IIPAuthPacketMethod.js";
|
||||
|
||||
export default class IIPAuthPacket
|
||||
{
|
||||
|
||||
8
src/Net/Packets/IIPAuthPacketAction.js
Normal file
8
src/Net/Packets/IIPAuthPacketAction.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export default // const IIPAuthPacketAction =
|
||||
{
|
||||
// Authenticate
|
||||
AuthenticateHash: 0,
|
||||
NewConnection: 0x20,
|
||||
ResumeConnection: 0x21,
|
||||
ConnectionEstablished: 0x28
|
||||
};
|
||||
7
src/Net/Packets/IIPAuthPacketCommand.js
Normal file
7
src/Net/Packets/IIPAuthPacketCommand.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default //const IIPAuthPacketCommand =
|
||||
{
|
||||
Action: 0,
|
||||
Declare: 1,
|
||||
Acknowledge: 2,
|
||||
Error: 3
|
||||
};
|
||||
7
src/Net/Packets/IIPAuthPacketMethod.js
Normal file
7
src/Net/Packets/IIPAuthPacketMethod.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default //const IIPAuthPacketMethod =
|
||||
{
|
||||
None: 0,
|
||||
Certificate: 1,
|
||||
Credentials: 2,
|
||||
Token: 3
|
||||
};
|
||||
@@ -26,77 +26,11 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
export const IIPPacketCommand =
|
||||
{
|
||||
Event: 0,
|
||||
Request: 1,
|
||||
Reply: 2,
|
||||
Report: 3
|
||||
};
|
||||
|
||||
export const IIPPacketReport =
|
||||
{
|
||||
ManagementError: 0,
|
||||
ExecutionError: 1,
|
||||
ProgressReport: 0x8,
|
||||
ChunkStream: 0x9
|
||||
};
|
||||
|
||||
export const IIPPacketEvent =
|
||||
{
|
||||
// Event Manage
|
||||
ResourceReassigned : 0,
|
||||
ResourceDestroyed: 1,
|
||||
ChildAdded: 2,
|
||||
ChildRemoved: 3,
|
||||
Renamed: 4,
|
||||
|
||||
// Event Invoke
|
||||
PropertyUpdated : 0x10,
|
||||
EventOccurred: 0x11,
|
||||
|
||||
// Attribute
|
||||
AttributesUpdated: 0x18
|
||||
|
||||
};
|
||||
|
||||
export const IIPPacketAction =
|
||||
{
|
||||
// Request Manage
|
||||
AttachResource: 0,
|
||||
ReattachResource: 1,
|
||||
DetachResource: 2,
|
||||
CreateResource: 3,
|
||||
DeleteResource: 4,
|
||||
AddChild: 5,
|
||||
RemoveChild: 6,
|
||||
RenameResource: 7,
|
||||
|
||||
// Request Inquire
|
||||
TemplateFromClassName: 8,
|
||||
TemplateFromClassId: 9,
|
||||
TemplateFromResourceId: 10,
|
||||
QueryLink: 11,
|
||||
ResourceHistory: 12,
|
||||
ResourceChildren: 13,
|
||||
ResourceParents: 14,
|
||||
|
||||
// Request Invoke
|
||||
InvokeFunctionArrayArguments: 16,
|
||||
GetProperty: 17,
|
||||
GetPropertyIfModified: 18,
|
||||
SetProperty: 19,
|
||||
InvokeFunctionNamedArguments: 20,
|
||||
|
||||
// Request Attribute
|
||||
GetAllAttributes: 24,
|
||||
UpdateAllAttributes: 25,
|
||||
ClearAllAttributes: 26,
|
||||
GetAttributes: 27,
|
||||
UpdateAttributes: 28,
|
||||
ClearAttributes: 29
|
||||
};
|
||||
|
||||
import IIPPacketAction from "./IIPPacketAction.js";
|
||||
import IIPPacketCommand from "./IIPPacketCommand.js";
|
||||
import IIPPacketEvent from "./IIPPacketEvent.js";
|
||||
import IIPPacketReport from "./IIPPacketReport.js";
|
||||
import DataType from '../../Data/DataType.js';
|
||||
|
||||
export default class IIPPacket
|
||||
{
|
||||
|
||||
36
src/Net/Packets/IIPPacketAction.js
Normal file
36
src/Net/Packets/IIPPacketAction.js
Normal file
@@ -0,0 +1,36 @@
|
||||
export default // const IIPPacketAction =
|
||||
{
|
||||
// Request Manage
|
||||
AttachResource: 0,
|
||||
ReattachResource: 1,
|
||||
DetachResource: 2,
|
||||
CreateResource: 3,
|
||||
DeleteResource: 4,
|
||||
AddChild: 5,
|
||||
RemoveChild: 6,
|
||||
RenameResource: 7,
|
||||
|
||||
// Request Inquire
|
||||
TemplateFromClassName: 8,
|
||||
TemplateFromClassId: 9,
|
||||
TemplateFromResourceId: 10,
|
||||
QueryLink: 11,
|
||||
ResourceHistory: 12,
|
||||
ResourceChildren: 13,
|
||||
ResourceParents: 14,
|
||||
|
||||
// Request Invoke
|
||||
InvokeFunctionArrayArguments: 16,
|
||||
GetProperty: 17,
|
||||
GetPropertyIfModified: 18,
|
||||
SetProperty: 19,
|
||||
InvokeFunctionNamedArguments: 20,
|
||||
|
||||
// Request Attribute
|
||||
GetAllAttributes: 24,
|
||||
UpdateAllAttributes: 25,
|
||||
ClearAllAttributes: 26,
|
||||
GetAttributes: 27,
|
||||
UpdateAttributes: 28,
|
||||
ClearAttributes: 29
|
||||
};
|
||||
7
src/Net/Packets/IIPPacketCommand.js
Normal file
7
src/Net/Packets/IIPPacketCommand.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default // IIPPacketCommand =
|
||||
{
|
||||
Event: 0,
|
||||
Request: 1,
|
||||
Reply: 2,
|
||||
Report: 3
|
||||
};
|
||||
19
src/Net/Packets/IIPPacketEvent.js
Normal file
19
src/Net/Packets/IIPPacketEvent.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const IIPPacketEvent =
|
||||
{
|
||||
// Event Manage
|
||||
ResourceReassigned : 0,
|
||||
ResourceDestroyed: 1,
|
||||
ChildAdded: 2,
|
||||
ChildRemoved: 3,
|
||||
Renamed: 4,
|
||||
|
||||
// Event Invoke
|
||||
PropertyUpdated : 0x10,
|
||||
EventOccurred: 0x11,
|
||||
|
||||
// Attribute
|
||||
AttributesUpdated: 0x18
|
||||
|
||||
};
|
||||
|
||||
export default IIPPacketEvent;
|
||||
9
src/Net/Packets/IIPPacketReport.js
Normal file
9
src/Net/Packets/IIPPacketReport.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const IIPPacketReport =
|
||||
{
|
||||
ManagementError: 0,
|
||||
ExecutionError: 1,
|
||||
ProgressReport: 0x8,
|
||||
ChunkStream: 0x9
|
||||
};
|
||||
|
||||
export default IIPPacketReport;
|
||||
Reference in New Issue
Block a user