@jsm-mit/chat-motoko-package 0.2.0 → 0.3.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/README.md +2 -0
- package/declarations/chat-motoko-backend/chat-motoko-backend.did +3 -0
- package/declarations/chat-motoko-backend/chat-motoko-backend.did.d.ts +3 -0
- package/declarations/chat-motoko-backend/chat-motoko-backend.did.js +3 -0
- package/dist/actors/chats-actor.d.ts +4 -2
- package/dist/actors/chats-actor.d.ts.map +1 -1
- package/dist/actors/chats-actor.js +4 -2
- package/dist/actors/projects-actor.d.ts +3 -2
- package/dist/actors/projects-actor.d.ts.map +1 -1
- package/dist/actors/projects-actor.js +5 -2
- package/dist/interfaces.d.ts +5 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ that prove it.
|
|
|
7
7
|
```ts
|
|
8
8
|
import { RoomsActor, ChatsActor, MessagesActor, ChatPoller } from "@jsm-mit/chat-motoko-package";
|
|
9
9
|
|
|
10
|
+
// A canister admin creates the project with its accounts canister — the one asked
|
|
11
|
+
// `isUser(principal)` before a non-admin opens a chat (Sultana: sultana-core-motoko).
|
|
10
12
|
// A project admin defines a room: who receives the customer's messages.
|
|
11
13
|
await new RoomsActor(canisterId, adminIdentity).createRoomAsyncUnsafe({
|
|
12
14
|
projectId: "sultana-stage", id: "assistant", name: "Asystent",
|
|
@@ -7,6 +7,7 @@ type UpdateRoomArgs =
|
|
|
7
7
|
};
|
|
8
8
|
type UpdateProjectArgs =
|
|
9
9
|
record {
|
|
10
|
+
accountsCanister: opt principal;
|
|
10
11
|
admins: opt vec principal;
|
|
11
12
|
projectId: ProjectId;
|
|
12
13
|
};
|
|
@@ -120,6 +121,7 @@ type PurgeChatArgs = record {chatId: ChatId;};
|
|
|
120
121
|
type ProjectId = text;
|
|
121
122
|
type Project =
|
|
122
123
|
record {
|
|
124
|
+
accountsCanister: principal;
|
|
123
125
|
admins: vec principal;
|
|
124
126
|
createdAt: int;
|
|
125
127
|
createdBy: principal;
|
|
@@ -246,6 +248,7 @@ type CreateRoomArgs =
|
|
|
246
248
|
};
|
|
247
249
|
type CreateProjectArgs =
|
|
248
250
|
record {
|
|
251
|
+
accountsCanister: principal;
|
|
249
252
|
admins: vec principal;
|
|
250
253
|
id: ProjectId;
|
|
251
254
|
};
|
|
@@ -26,6 +26,7 @@ export interface ChatSummary {
|
|
|
26
26
|
}
|
|
27
27
|
export interface CreateProjectArgs {
|
|
28
28
|
'id' : ProjectId,
|
|
29
|
+
'accountsCanister' : Principal,
|
|
29
30
|
'admins' : Array<Principal>,
|
|
30
31
|
}
|
|
31
32
|
export interface CreateRoomArgs {
|
|
@@ -118,6 +119,7 @@ export interface Project {
|
|
|
118
119
|
'id' : ProjectId,
|
|
119
120
|
'createdAt' : bigint,
|
|
120
121
|
'createdBy' : Principal,
|
|
122
|
+
'accountsCanister' : Principal,
|
|
121
123
|
'admins' : Array<Principal>,
|
|
122
124
|
}
|
|
123
125
|
export type ProjectId = string;
|
|
@@ -175,6 +177,7 @@ export interface SetLoggingEnabledArgs { 'enabled' : boolean }
|
|
|
175
177
|
export interface SetQuotaLimitsArgs { 'limits' : QuotaLimits }
|
|
176
178
|
export type SystemEvent = { 'chatCreated' : null };
|
|
177
179
|
export interface UpdateProjectArgs {
|
|
180
|
+
'accountsCanister' : [] | [Principal],
|
|
178
181
|
'projectId' : ProjectId,
|
|
179
182
|
'admins' : [] | [Array<Principal>],
|
|
180
183
|
}
|
|
@@ -14,12 +14,14 @@ export const idlFactory = ({ IDL }) => {
|
|
|
14
14
|
const ProjectId = IDL.Text;
|
|
15
15
|
const CreateProjectArgs = IDL.Record({
|
|
16
16
|
'id' : ProjectId,
|
|
17
|
+
'accountsCanister' : IDL.Principal,
|
|
17
18
|
'admins' : IDL.Vec(IDL.Principal),
|
|
18
19
|
});
|
|
19
20
|
const Project = IDL.Record({
|
|
20
21
|
'id' : ProjectId,
|
|
21
22
|
'createdAt' : IDL.Int,
|
|
22
23
|
'createdBy' : IDL.Principal,
|
|
24
|
+
'accountsCanister' : IDL.Principal,
|
|
23
25
|
'admins' : IDL.Vec(IDL.Principal),
|
|
24
26
|
});
|
|
25
27
|
const Result_1 = IDL.Variant({ 'ok' : Project, 'err' : Error });
|
|
@@ -171,6 +173,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
171
173
|
const SetLoggingEnabledArgs = IDL.Record({ 'enabled' : IDL.Bool });
|
|
172
174
|
const SetQuotaLimitsArgs = IDL.Record({ 'limits' : QuotaLimits });
|
|
173
175
|
const UpdateProjectArgs = IDL.Record({
|
|
176
|
+
'accountsCanister' : IDL.Opt(IDL.Principal),
|
|
174
177
|
'projectId' : ProjectId,
|
|
175
178
|
'admins' : IDL.Opt(IDL.Vec(IDL.Principal)),
|
|
176
179
|
});
|
|
@@ -7,8 +7,10 @@ export declare class ChatsActor extends ActorBase {
|
|
|
7
7
|
/**
|
|
8
8
|
* Opens the caller's chat in a room: the caller becomes the `customer`, the room's
|
|
9
9
|
* recipients are copied in, the canister writes the `chatCreated` event. One chat per
|
|
10
|
-
* (room, customer, recipients) — calling again returns the same chat unchanged.
|
|
11
|
-
*
|
|
10
|
+
* (room, customer, recipients) — calling again returns the same chat unchanged. A NEW
|
|
11
|
+
* chat is created only once the project's accounts canister confirms the caller
|
|
12
|
+
* (`isUser`); admins of the canister and of the project skip that.
|
|
13
|
+
* @throws Error with message `CanisterError` when the canister returns a business error (`NotAuthorized` also when the accounts canister does not know the caller, `NotFound` for the room, `InvalidData` when the caller is a recipient of the room, the name is too long or the daily chat limit is reached, `InterCanisterConnectionError` when the accounts canister cannot be asked). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
12
14
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
13
15
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution (anonymous, or today's chat quota used up).
|
|
14
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats-actor.d.ts","sourceRoot":"","sources":["../../src/actors/chats-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGzH,gFAAgF;AAChF,qBAAa,UAAW,SAAQ,SAAS;gBAEzB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD
|
|
1
|
+
{"version":3,"file":"chats-actor.d.ts","sourceRoot":"","sources":["../../src/actors/chats-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGzH,gFAAgF;AAChF,qBAAa,UAAW,SAAQ,SAAS;gBAEzB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;;;;OASG;IACU,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC;IAWzE;;;;;OAKG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKlE;;;;;;OAMG;IACU,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAW/E;;;;;;OAMG;IACU,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAWlG;;;;;;;OAOG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGtE"}
|
|
@@ -9,8 +9,10 @@ export class ChatsActor extends ActorBase {
|
|
|
9
9
|
/**
|
|
10
10
|
* Opens the caller's chat in a room: the caller becomes the `customer`, the room's
|
|
11
11
|
* recipients are copied in, the canister writes the `chatCreated` event. One chat per
|
|
12
|
-
* (room, customer, recipients) — calling again returns the same chat unchanged.
|
|
13
|
-
*
|
|
12
|
+
* (room, customer, recipients) — calling again returns the same chat unchanged. A NEW
|
|
13
|
+
* chat is created only once the project's accounts canister confirms the caller
|
|
14
|
+
* (`isUser`); admins of the canister and of the project skip that.
|
|
15
|
+
* @throws Error with message `CanisterError` when the canister returns a business error (`NotAuthorized` also when the accounts canister does not know the caller, `NotFound` for the room, `InvalidData` when the caller is a recipient of the room, the name is too long or the daily chat limit is reached, `InterCanisterConnectionError` when the accounts canister cannot be asked). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
14
16
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
15
17
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution (anonymous, or today's chat quota used up).
|
|
16
18
|
*/
|
|
@@ -7,14 +7,15 @@ export declare class ProjectsActor extends ActorBase {
|
|
|
7
7
|
constructor(canisterId: string, identity?: Identity);
|
|
8
8
|
/**
|
|
9
9
|
* Creates a project. Canister admin only.
|
|
10
|
-
* @param input - id (max 50 chars, no '/' or '|')
|
|
10
|
+
* @param input - id (max 50 chars, no '/' or '|'), admins (max 10, no anonymous) and the accounts canister the chat asks `isUser` before a non-admin opens a chat.
|
|
11
11
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `AlreadyExists`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
12
12
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
13
13
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
14
14
|
*/
|
|
15
15
|
createProjectAsyncUnsafe(input: CreateProjectInput): Promise<ProjectView>;
|
|
16
16
|
/**
|
|
17
|
-
* Replaces the admin list when given. Canister admins and
|
|
17
|
+
* Replaces the admin list and/or the accounts canister when given. Canister admins and
|
|
18
|
+
* the project's admins.
|
|
18
19
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
19
20
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
20
21
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects-actor.d.ts","sourceRoot":"","sources":["../../src/actors/projects-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG5F;8CAC8C;AAC9C,qBAAa,aAAc,SAAQ,SAAS;gBAE5B,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;OAMG;IACU,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"projects-actor.d.ts","sourceRoot":"","sources":["../../src/actors/projects-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG5F;8CAC8C;AAC9C,qBAAa,aAAc,SAAQ,SAAS;gBAE5B,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;OAMG;IACU,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAWtF;;;;;;OAMG;IACU,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAWtF;;;;;OAKG;IACU,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAK3E;;;;;OAKG;IACU,uBAAuB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAI/E"}
|
|
@@ -10,7 +10,7 @@ export class ProjectsActor extends ActorBase {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Creates a project. Canister admin only.
|
|
13
|
-
* @param input - id (max 50 chars, no '/' or '|')
|
|
13
|
+
* @param input - id (max 50 chars, no '/' or '|'), admins (max 10, no anonymous) and the accounts canister the chat asks `isUser` before a non-admin opens a chat.
|
|
14
14
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `AlreadyExists`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
15
15
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
16
16
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
@@ -19,11 +19,13 @@ export class ProjectsActor extends ActorBase {
|
|
|
19
19
|
const project = await this.executeFunctionAsyncUnsafe(() => this.actor.createProject({
|
|
20
20
|
id: input.id,
|
|
21
21
|
admins: input.admins.map((p) => Principal.fromText(p)),
|
|
22
|
+
accountsCanister: Principal.fromText(input.accountsCanisterId),
|
|
22
23
|
}));
|
|
23
24
|
return mapProjectView(project);
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* Replaces the admin list when given. Canister admins and
|
|
27
|
+
* Replaces the admin list and/or the accounts canister when given. Canister admins and
|
|
28
|
+
* the project's admins.
|
|
27
29
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, `NotFound`, `InvalidData`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
28
30
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
29
31
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
@@ -32,6 +34,7 @@ export class ProjectsActor extends ActorBase {
|
|
|
32
34
|
const project = await this.executeFunctionAsyncUnsafe(() => this.actor.updateProject({
|
|
33
35
|
projectId: input.projectId,
|
|
34
36
|
admins: toOpt(input.admins?.map((p) => Principal.fromText(p))),
|
|
37
|
+
accountsCanister: toOpt(input.accountsCanisterId === undefined ? undefined : Principal.fromText(input.accountsCanisterId)),
|
|
35
38
|
}));
|
|
36
39
|
return mapProjectView(project);
|
|
37
40
|
}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export interface ProjectView {
|
|
|
13
13
|
createdAt: bigint;
|
|
14
14
|
/** Define the rooms, see the project's chats as metadata, may purge them. */
|
|
15
15
|
admins: string[];
|
|
16
|
+
/** Asked (`isUser`) before somebody who is not an admin opens a chat in the project. */
|
|
17
|
+
accountsCanisterId: string;
|
|
16
18
|
}
|
|
17
19
|
export interface RecipientView {
|
|
18
20
|
principal: string;
|
|
@@ -98,10 +100,13 @@ export interface QuotaLimitsView {
|
|
|
98
100
|
export interface CreateProjectInput {
|
|
99
101
|
id: string;
|
|
100
102
|
admins: string[];
|
|
103
|
+
/** The canister that answers `isUser(principal)` for this project — mandatory. */
|
|
104
|
+
accountsCanisterId: string;
|
|
101
105
|
}
|
|
102
106
|
export interface UpdateProjectInput {
|
|
103
107
|
projectId: string;
|
|
104
108
|
admins?: string[];
|
|
109
|
+
accountsCanisterId?: string;
|
|
105
110
|
}
|
|
106
111
|
export interface CreateRoomInput {
|
|
107
112
|
projectId: string;
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mGAAmG;AACnG,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AACvD,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mGAAmG;AACnG,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AACvD,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,wFAAwF;IACxF,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,iBAAiB,CAAC;IACxB,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAA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AAa,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/mappers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,IAAI,EACJ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX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kB,CAAC,MAAM,EAAE,WAAW,GAAG,eAAe,CAEvE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAiB5D;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAExE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,cAAc,CAMpE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,eAAe,CAEvE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CAExE"}
|
package/dist/mappers.js
CHANGED
|
@@ -40,6 +40,7 @@ export function mapProjectView(project) {
|
|
|
40
40
|
createdBy: project.createdBy.toText(),
|
|
41
41
|
createdAt: project.createdAt,
|
|
42
42
|
admins: project.admins.map((p) => p.toText()),
|
|
43
|
+
accountsCanisterId: project.accountsCanister.toText(),
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
export function mapRoomView(room) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/chat-motoko-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Wrapper TypeScript package for the chat-motoko canister: projects, multi-party chats, messages and a poller for agent hosts.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
"chatMotoko": {
|
|
59
59
|
"repo": "chat-motoko",
|
|
60
60
|
"repoUrl": "https://github.com/JSM-Chat-Platform/chat-motoko",
|
|
61
|
-
"commit": "
|
|
61
|
+
"commit": "caf02c560d1c988bb79f26d6221a173a0ba8b7c2"
|
|
62
62
|
}
|
|
63
63
|
}
|