@holochain-syn/client 0.0.2 → 0.1.0
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.
- package/dist/client.d.ts +22 -0
- package/dist/client.js +46 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -2194
- package/dist/types.d.ts +53 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.js +10 -4
- package/dist/utils.js.map +1 -1
- package/package.json +15 -10
- package/dist/syn-client.d.ts +0 -47
- package/dist/syn-client.js +0 -133
- package/dist/syn-client.js.map +0 -1
- package/dist/types/change.d.ts +0 -44
- package/dist/types/change.js +0 -2
- package/dist/types/change.js.map +0 -1
- package/dist/types/commit.d.ts +0 -27
- package/dist/types/commit.js +0 -2
- package/dist/types/commit.js.map +0 -1
- package/dist/types/folks.d.ts +0 -10
- package/dist/types/folks.js +0 -2
- package/dist/types/folks.js.map +0 -1
- package/dist/types/heartbeat.d.ts +0 -10
- package/dist/types/heartbeat.js +0 -2
- package/dist/types/heartbeat.js.map +0 -1
- package/dist/types/session.d.ts +0 -21
- package/dist/types/session.js +0 -2
- package/dist/types/session.js.map +0 -1
- package/dist/types/signal.d.ts +0 -27
- package/dist/types/signal.js +0 -24
- package/dist/types/signal.js.map +0 -1
- package/dist/types/sync.d.ts +0 -27
- package/dist/types/sync.js +0 -2
- package/dist/types/sync.js.map +0 -1
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CellClient } from '@holochain-open-dev/cell-client';
|
|
2
|
+
import type { AgentPubKey, EntryHash, Record } from '@holochain/client';
|
|
3
|
+
import { Commit, CreateWorkspaceInput, JoinWorkspaceOutput, UpdateWorkspaceTipInput, WorkspaceMessage } from './types';
|
|
4
|
+
export declare class SynClient {
|
|
5
|
+
cellClient: CellClient;
|
|
6
|
+
protected zomeName: string;
|
|
7
|
+
constructor(cellClient: CellClient, zomeName?: string);
|
|
8
|
+
/** Commits */
|
|
9
|
+
createCommit(commit: Commit): Promise<Record>;
|
|
10
|
+
getCommit(commitHash: EntryHash): Promise<Record>;
|
|
11
|
+
getAllCommits(): Promise<Array<Record>>;
|
|
12
|
+
/** Workspaces */
|
|
13
|
+
createWorkspace(input: CreateWorkspaceInput): Promise<Record>;
|
|
14
|
+
getAllWorkspaces(): Promise<Array<Record>>;
|
|
15
|
+
getWorkspaceParticipants(workspace_hash: EntryHash): Promise<Array<AgentPubKey>>;
|
|
16
|
+
updateWorkspaceTip(input: UpdateWorkspaceTipInput): Promise<Array<Record>>;
|
|
17
|
+
joinWorkspace(workspace_hash: EntryHash): Promise<JoinWorkspaceOutput>;
|
|
18
|
+
leaveWorkspace(workspace_hash: EntryHash): Promise<void>;
|
|
19
|
+
sendMessage(recipients: Array<AgentPubKey>, workspace_message: WorkspaceMessage): Promise<void>;
|
|
20
|
+
/** Helpers */
|
|
21
|
+
private callZome;
|
|
22
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class SynClient {
|
|
2
|
+
constructor(cellClient, zomeName = 'syn') {
|
|
3
|
+
this.cellClient = cellClient;
|
|
4
|
+
this.zomeName = zomeName;
|
|
5
|
+
}
|
|
6
|
+
/** Commits */
|
|
7
|
+
createCommit(commit) {
|
|
8
|
+
return this.callZome('create_commit', commit);
|
|
9
|
+
}
|
|
10
|
+
async getCommit(commitHash) {
|
|
11
|
+
return this.callZome('get_commit', commitHash);
|
|
12
|
+
}
|
|
13
|
+
async getAllCommits() {
|
|
14
|
+
return await this.callZome('get_all_commits', null);
|
|
15
|
+
}
|
|
16
|
+
/** Workspaces */
|
|
17
|
+
async createWorkspace(input) {
|
|
18
|
+
return this.callZome('create_workspace', input);
|
|
19
|
+
}
|
|
20
|
+
getAllWorkspaces() {
|
|
21
|
+
return this.callZome('get_all_workspaces', null);
|
|
22
|
+
}
|
|
23
|
+
getWorkspaceParticipants(workspace_hash) {
|
|
24
|
+
return this.callZome('get_workspace_participants', workspace_hash);
|
|
25
|
+
}
|
|
26
|
+
updateWorkspaceTip(input) {
|
|
27
|
+
return this.callZome('update_workspace_tip', input);
|
|
28
|
+
}
|
|
29
|
+
async joinWorkspace(workspace_hash) {
|
|
30
|
+
return this.callZome('join_workspace', workspace_hash);
|
|
31
|
+
}
|
|
32
|
+
async leaveWorkspace(workspace_hash) {
|
|
33
|
+
return this.callZome('leave_workspace', workspace_hash);
|
|
34
|
+
}
|
|
35
|
+
sendMessage(recipients, workspace_message) {
|
|
36
|
+
return this.callZome('send_message', {
|
|
37
|
+
recipients,
|
|
38
|
+
workspace_message,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Helpers */
|
|
42
|
+
async callZome(fnName, payload) {
|
|
43
|
+
return this.cellClient.callZome(this.zomeName, fnName, payload);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,SAAS;IACpB,YAAmB,UAAsB,EAAY,WAAW,KAAK;QAAlD,eAAU,GAAV,UAAU,CAAY;QAAY,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAEzE,cAAc;IACP,YAAY,CAAC,MAAc;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,UAAqB;QAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,aAAa;QACxB,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,iBAAiB;IACV,KAAK,CAAC,eAAe,CAAC,KAA2B;QACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAEM,gBAAgB;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAEM,wBAAwB,CAC7B,cAAyB;QAEzB,OAAO,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;IACrE,CAAC;IAEM,kBAAkB,CACvB,KAA8B;QAE9B,OAAO,IAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAEM,KAAK,CAAC,aAAa,CACxB,cAAyB;QAEzB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,cAAyB;QACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC;IAEM,WAAW,CAChB,UAA8B,EAC9B,iBAAmC;QAEnC,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YACnC,UAAU;YACV,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC;IAED,cAAc;IACN,KAAK,CAAC,QAAQ,CAAC,MAAc,EAAE,OAAY;QACjD,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./types
|
|
3
|
-
export * from "./types/commit";
|
|
4
|
-
export * from "./types/change";
|
|
5
|
-
export * from "./types/folks";
|
|
6
|
-
export * from "./types/heartbeat";
|
|
7
|
-
export * from "./types/session";
|
|
8
|
-
export * from "./types/sync";
|
|
1
|
+
export * from "./client";
|
|
2
|
+
export * from "./types";
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./types
|
|
3
|
-
export * from "./types/commit";
|
|
4
|
-
export * from "./types/change";
|
|
5
|
-
export * from "./types/folks";
|
|
6
|
-
export * from "./types/heartbeat";
|
|
7
|
-
export * from "./types/session";
|
|
8
|
-
export * from "./types/sync";
|
|
1
|
+
export * from "./client";
|
|
2
|
+
export * from "./types";
|
|
9
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|