ode-ts-client 1.2.1-develop-b2school.202311301157 → 1.2.1
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/configure/Service.d.ts +1 -0
- package/dist/configure/interfaces.d.ts +1 -2
- package/dist/{explore → explorer}/interfaces.d.ts +4 -3
- package/dist/globals.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/ode-ts-client.esm.js +990 -1423
- package/dist/ode-ts-client.esm.js.map +1 -1
- package/dist/ode-ts-client.js +4 -4
- package/dist/ode-ts-client.js.map +1 -1
- package/dist/ode-ts-client.mjs +990 -1423
- package/dist/ode-ts-client.mjs.map +1 -1
- package/dist/resources/BlogResourceService.d.ts +2 -1
- package/dist/resources/MindmapResourceService.d.ts +12 -0
- package/dist/resources/ResourceService.d.ts +2 -1
- package/dist/resources/interface.d.ts +46 -0
- package/dist/rights/Service.d.ts +1 -1
- package/dist/version.txt +1 -1
- package/dist/widget/interfaces.d.ts +1 -0
- package/package.json +21 -22
- package/dist/agents/blog.agent.d.ts +0 -2
- package/dist/agents/folder.agent.d.ts +0 -2
- package/dist/agents/index.d.ts +0 -4
- package/dist/explore/Agent.d.ts +0 -20
- package/dist/explore/AgentLoader.d.ts +0 -13
- package/dist/explore/Bus.d.ts +0 -20
- package/dist/explore/Context.d.ts +0 -33
- package/dist/explore/Framework.d.ts +0 -15
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ResourceType } from "..";
|
|
2
|
-
import { BlogUpdate, UpdateResult } from "./interface";
|
|
2
|
+
import { BlogUpdate, CreateParameters, CreateResult, UpdateResult } from "./interface";
|
|
3
3
|
import { ResourceService } from "./ResourceService";
|
|
4
4
|
export declare class BlogResourceService extends ResourceService {
|
|
5
|
+
create(parameters: CreateParameters): Promise<CreateResult>;
|
|
5
6
|
update(parameters: BlogUpdate): Promise<UpdateResult>;
|
|
6
7
|
getResourceType(): ResourceType;
|
|
7
8
|
getApplication(): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ResourceType } from "..";
|
|
2
|
+
import { CreateParameters, CreateResult, MindmapUpdate, UpdateResult } from "./interface";
|
|
3
|
+
import { ResourceService } from "./ResourceService";
|
|
4
|
+
export declare class MindmapResourceService extends ResourceService {
|
|
5
|
+
create(parameters: CreateParameters): Promise<CreateResult>;
|
|
6
|
+
update(parameters: MindmapUpdate): Promise<UpdateResult>;
|
|
7
|
+
getResourceType(): ResourceType;
|
|
8
|
+
getApplication(): string;
|
|
9
|
+
getFormUrl(folderId?: string): string;
|
|
10
|
+
getViewUrl(resourceId: string): string;
|
|
11
|
+
getPrintUrl(resourceId: string, withComment?: boolean): string;
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublishParameters, PublishResult, GetContextParameters, GetContextResult, ISearchResults, CreateFolderParameters, MoveParameters, IActionResult, TrashParameters, CreateFolderResult, UpdateFolderParameters, ID, GetSubFoldersResult, DeleteParameters, ResourceType } from "..";
|
|
2
2
|
import { OdeServices } from "../services/OdeServices";
|
|
3
|
-
import { UpdateParameters, UpdateResult } from "./interface";
|
|
3
|
+
import { CreateParameters, CreateResult, UpdateParameters, UpdateResult } from "./interface";
|
|
4
4
|
export declare abstract class ResourceService {
|
|
5
5
|
protected context: OdeServices;
|
|
6
6
|
private static registry;
|
|
@@ -21,6 +21,7 @@ export declare abstract class ResourceService {
|
|
|
21
21
|
abstract getPrintUrl(resourceId: string, withComment?: boolean): string;
|
|
22
22
|
abstract getViewUrl(resourceId: string): string;
|
|
23
23
|
abstract getFormUrl(folderId?: string): string;
|
|
24
|
+
abstract create<T extends CreateParameters>(parameters: T): Promise<CreateResult>;
|
|
24
25
|
abstract update<T extends UpdateParameters>(parameters: T): Promise<UpdateResult>;
|
|
25
26
|
abstract getResourceType(): ResourceType;
|
|
26
27
|
getShareReadUrl(id: string): string;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { IResource } from "..";
|
|
2
|
+
/**
|
|
3
|
+
* Parameters expected to create resource
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateParameters {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
thumbnail: string | Blob | File;
|
|
9
|
+
folder: number | undefined;
|
|
10
|
+
public?: boolean;
|
|
11
|
+
slug?: string;
|
|
12
|
+
commentType?: string;
|
|
13
|
+
publishType?: string;
|
|
14
|
+
app?: string;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* Parameters expected to update resource
|
|
4
18
|
*/
|
|
@@ -11,6 +25,32 @@ export interface UpdateParameters {
|
|
|
11
25
|
public: boolean;
|
|
12
26
|
slug: string;
|
|
13
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Response when creating resource
|
|
30
|
+
*/
|
|
31
|
+
export interface CreateResult {
|
|
32
|
+
entId: string;
|
|
33
|
+
thumbnail: string | undefined;
|
|
34
|
+
_id?: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
visibility?: string;
|
|
38
|
+
trashed?: boolean;
|
|
39
|
+
"publish-type"?: string;
|
|
40
|
+
"comment-type"?: string;
|
|
41
|
+
created?: {
|
|
42
|
+
"$date": string;
|
|
43
|
+
};
|
|
44
|
+
modified?: {
|
|
45
|
+
"$date": string;
|
|
46
|
+
};
|
|
47
|
+
author?: {
|
|
48
|
+
userId: string;
|
|
49
|
+
username: string;
|
|
50
|
+
login: string;
|
|
51
|
+
};
|
|
52
|
+
shared?: Array<string>;
|
|
53
|
+
}
|
|
14
54
|
/**
|
|
15
55
|
* Response when updating resource
|
|
16
56
|
*/
|
|
@@ -24,3 +64,9 @@ export interface BlogUpdate extends UpdateParameters {
|
|
|
24
64
|
export interface BlogResource extends IResource {
|
|
25
65
|
"publish-type": "RESTRAINT" | "IMMEDIATE";
|
|
26
66
|
}
|
|
67
|
+
export interface MindmapUpdate extends UpdateParameters {
|
|
68
|
+
"publish-type"?: "RESTRAINT" | "IMMEDIATE";
|
|
69
|
+
}
|
|
70
|
+
export interface MindmapResource extends IResource {
|
|
71
|
+
"publish-type": "RESTRAINT" | "IMMEDIATE";
|
|
72
|
+
}
|
package/dist/rights/Service.d.ts
CHANGED
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-ts-client=
|
|
1
|
+
ode-ts-client= 04/03/2024 10:52:02
|
|
@@ -18,6 +18,7 @@ export declare const WIDGET_NAME: {
|
|
|
18
18
|
readonly UNIVERSALIS: "universalis-widget";
|
|
19
19
|
readonly BRIEFME: "briefme-widget";
|
|
20
20
|
readonly SCHOOL: "school-widget";
|
|
21
|
+
readonly EDUMALIN: "edumalin-widget";
|
|
21
22
|
};
|
|
22
23
|
export declare type WidgetName = (typeof WIDGET_NAME)[keyof typeof WIDGET_NAME];
|
|
23
24
|
export declare abstract class WidgetFrameworkFactory {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ode-ts-client",
|
|
3
|
-
"version": "1.2.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Foundation frameworks by Open Digital Education",
|
|
5
5
|
"homepage": "https://github.com/opendigitaleducation/ode-ts-client#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -25,38 +25,37 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"format:check": "npx prettier --check \"src/ts/**/*.ts\"",
|
|
33
|
-
"format:write": "npx prettier --write \"src/ts/**/*.ts\"",
|
|
34
|
-
"prepare": "npx husky install",
|
|
35
|
-
"test": "node scripts/test.mjs && npx jasmine --config=src/test/config/jasmine.json",
|
|
36
|
-
"watch": "export build_target=${npm_config_build_target}; export watch=true; npx rollup -c --watch"
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"axios": "0.21.1",
|
|
30
|
+
"core-js": "3.8.3",
|
|
31
|
+
"rxjs": "7.3.0"
|
|
37
32
|
},
|
|
38
33
|
"devDependencies": {
|
|
39
34
|
"@types/jasmine": "3.6.3",
|
|
40
35
|
"@types/node": "14.14.28",
|
|
41
|
-
"prettier": "2.8.4",
|
|
42
36
|
"husky": "7.0.2",
|
|
43
37
|
"jasmine": "3.6.4",
|
|
38
|
+
"prettier": "2.8.4",
|
|
44
39
|
"rimraf": "3.0.2",
|
|
45
|
-
"
|
|
40
|
+
"rollup-plugin-visualizer": "5.9.0",
|
|
46
41
|
"terser": "5.16.0",
|
|
42
|
+
"typedoc": "0.22.13",
|
|
47
43
|
"typedoc-plugin-markdown": "3.11.14",
|
|
48
44
|
"typescript": "4.6.4",
|
|
49
45
|
"vite": "3.2.3",
|
|
50
|
-
"vite-plugin-dts": "1.7.1"
|
|
51
|
-
"rollup-plugin-visualizer": "5.9.0"
|
|
46
|
+
"vite-plugin-dts": "1.7.1"
|
|
52
47
|
},
|
|
53
|
-
"
|
|
54
|
-
"axios": "0.21.1",
|
|
55
|
-
"core-js": "3.8.3",
|
|
56
|
-
"rxjs": "7.3.0"
|
|
57
|
-
},
|
|
58
|
-
"packageManager": "yarn@1.22.19",
|
|
48
|
+
"packageManager": "pnpm@8.6.6",
|
|
59
49
|
"engines": {
|
|
60
|
-
"node": "16
|
|
50
|
+
"node": "16 || 18"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "node scripts/build.mjs",
|
|
54
|
+
"docs": "npx rimraf ./docs/ && npx typedoc src/ts/index.ts --excludePrivate --disableSources --plugin typedoc-plugin-markdown",
|
|
55
|
+
"format": "pnpm format:write && pnpm format:check",
|
|
56
|
+
"format:check": "npx prettier --check \"src/ts/**/*.ts\"",
|
|
57
|
+
"format:write": "npx prettier --write \"src/ts/**/*.ts\"",
|
|
58
|
+
"test": "node scripts/test.mjs && npx jasmine --config=src/test/config/jasmine.json",
|
|
59
|
+
"watch": "export build_target=${npm_config_build_target}; export watch=true; npx pnpm rollup -c --watch"
|
|
61
60
|
}
|
|
62
|
-
}
|
|
61
|
+
}
|
package/dist/agents/index.d.ts
DELETED
package/dist/explore/Agent.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ActionType, IActionParameters, IActionResult, IBusAgent, ResourceType } from "./interfaces";
|
|
2
|
-
export declare type IHandler = (parameters: IActionParameters) => Promise<IActionResult>;
|
|
3
|
-
/**
|
|
4
|
-
* Manage a generic RESOURCE
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class AbstractBusAgent implements IBusAgent {
|
|
7
|
-
constructor(managedResource: ResourceType);
|
|
8
|
-
/** Type of resource this agent can manage. */
|
|
9
|
-
protected managedResource: ResourceType;
|
|
10
|
-
protected static defaultHandler: IHandler;
|
|
11
|
-
protected handlerFor: {
|
|
12
|
-
[action in ActionType]: IHandler;
|
|
13
|
-
};
|
|
14
|
-
protected initialize(): void;
|
|
15
|
-
protected setHandler(action: ActionType, handler: IHandler): void;
|
|
16
|
-
protected getHandler(action: ActionType): IHandler;
|
|
17
|
-
/** Override to register handlers for actions this agent support. */
|
|
18
|
-
protected abstract registerHandlers(): void;
|
|
19
|
-
activate(res: ResourceType, action: ActionType, parameters: IActionParameters): Promise<IActionResult>;
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ResourceType } from "./interfaces";
|
|
2
|
-
/**
|
|
3
|
-
* Inner representation of an agent loader, from the bus' perspective.
|
|
4
|
-
*/
|
|
5
|
-
export interface IAgentLoader {
|
|
6
|
-
load(res: ResourceType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Default implementation of the loader.
|
|
10
|
-
*/
|
|
11
|
-
export declare class AgentLoader implements IAgentLoader {
|
|
12
|
-
load(res: ResourceType): Promise<void>;
|
|
13
|
-
}
|
package/dist/explore/Bus.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ActionType, IActionResult, IBus, ResourceType, IBusAgent } from "./interfaces";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { IActionParameters } from "..";
|
|
4
|
-
declare class Bus implements IBus {
|
|
5
|
-
private agents;
|
|
6
|
-
private comm;
|
|
7
|
-
setAgentFor(res: ResourceType, action: ActionType, agent: IBusAgent): void;
|
|
8
|
-
getAgentFor(res: ResourceType, action: ActionType): IBusAgent | null;
|
|
9
|
-
publish(res: ResourceType, action: ActionType, parameters: any): Promise<IActionResult>;
|
|
10
|
-
subscribe(res: ResourceType, action: ActionType): Observable<{
|
|
11
|
-
input: IActionParameters;
|
|
12
|
-
output: IActionResult;
|
|
13
|
-
}>;
|
|
14
|
-
private getActionMapping;
|
|
15
|
-
}
|
|
16
|
-
export declare class BusFactory {
|
|
17
|
-
private static _instance;
|
|
18
|
-
static get instance(): Bus;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { App } from "../globals";
|
|
3
|
-
import { IContext, IExplorerContext, ISearchParameters, ResourceType, GetResourcesResult, GetSubFoldersResult, CreateFolderResult, UpdateFolderResult, ID, ISearchResults, IResource, ManagePropertiesResult, UpdatePropertiesResult, PropKeyType, PublishParameters, PublishResult } from "./interfaces";
|
|
4
|
-
export declare class ExplorerContext implements IExplorerContext {
|
|
5
|
-
private searchParameters;
|
|
6
|
-
private context;
|
|
7
|
-
private bus;
|
|
8
|
-
private latestResults;
|
|
9
|
-
constructor(types: ResourceType[], app: App);
|
|
10
|
-
clear(): void;
|
|
11
|
-
isInitialized(): boolean;
|
|
12
|
-
getContext(): IContext | undefined;
|
|
13
|
-
getSearchParameters(): ISearchParameters;
|
|
14
|
-
private duplicateSearchParameters;
|
|
15
|
-
latestResources(): Observable<{
|
|
16
|
-
input: ISearchParameters;
|
|
17
|
-
output: ISearchResults;
|
|
18
|
-
}>;
|
|
19
|
-
initialize(): Promise<IContext>;
|
|
20
|
-
getResources(): Promise<GetResourcesResult>;
|
|
21
|
-
getSubFolders(parentId: string): Promise<GetSubFoldersResult>;
|
|
22
|
-
createFolder(resourceType: ResourceType, parentId: string, name: string): Promise<CreateFolderResult>;
|
|
23
|
-
updateFolder(folderId: ID, resourceType: ResourceType, parentId: ID | "default", name: string): Promise<UpdateFolderResult>;
|
|
24
|
-
copy(targetId: string, resourceIds: ID[], folderIds: ID[]): Promise<void>;
|
|
25
|
-
move(targetId: string, resourceIds: ID[], folderIds: ID[]): Promise<void>;
|
|
26
|
-
delete(resourceIds: string[], folderIds: string[]): Promise<void>;
|
|
27
|
-
trash(trash: boolean, resourceIds: string[], folderIds: string[]): Promise<void>;
|
|
28
|
-
manageProperties(resourceType: ResourceType, resources: IResource[]): Promise<ManagePropertiesResult>;
|
|
29
|
-
updateProperties(resourceType: ResourceType, resources: IResource[], props: {
|
|
30
|
-
[key in PropKeyType]?: string;
|
|
31
|
-
}): Promise<UpdatePropertiesResult>;
|
|
32
|
-
publish(resourceType: ResourceType, parameters: PublishParameters): Promise<PublishResult>;
|
|
33
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IBusAgent } from "..";
|
|
2
|
-
import { App } from "../globals";
|
|
3
|
-
import { IAgentLoader } from "./AgentLoader";
|
|
4
|
-
import { ActionType, IBus, IExplorerContext, IExplorerFramework, ResourceType } from "./interfaces";
|
|
5
|
-
export declare class ExplorerFramework implements IExplorerFramework {
|
|
6
|
-
private _agentLoader?;
|
|
7
|
-
get agentLoader(): IAgentLoader;
|
|
8
|
-
setAgentLoader(loader: IAgentLoader): void;
|
|
9
|
-
/** Load the agent dedicated to resolve this @param action on this @param resource */
|
|
10
|
-
requestAgentFor(resource: ResourceType, action: ActionType): Promise<IBusAgent>;
|
|
11
|
-
createContext(types: ResourceType[], app: App): IExplorerContext;
|
|
12
|
-
getBus(): IBus;
|
|
13
|
-
}
|
|
14
|
-
/** The whole framework is a singleton. */
|
|
15
|
-
export declare const explorer: IExplorerFramework;
|