@octostar/platform-api 0.5.5 → 0.5.7
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/{lib → dist}/apis.js +3 -12
- package/dist/apis.js.map +1 -0
- package/{lib → dist}/components/AbstractContextMenu.js +6 -3
- package/dist/components/AbstractContextMenu.js.map +1 -0
- package/{lib → dist}/components/OsContextMenu.js.map +1 -1
- package/{lib → dist}/components/OsIcon.d.ts +1 -1
- package/{lib → dist}/components/OsIcon.d.ts.map +1 -1
- package/{lib → dist}/components/OsIcon.js +10 -21
- package/dist/components/OsIcon.js.map +1 -0
- package/{lib → dist}/components/OsRecordTitle.d.ts +3 -3
- package/{lib → dist}/components/OsRecordTitle.d.ts.map +1 -1
- package/dist/components/OsRecordTitle.js +89 -0
- package/dist/components/OsRecordTitle.js.map +1 -0
- package/dist/components/OsSpinner.js.map +1 -0
- package/dist/components/OsTag.js +53 -0
- package/dist/components/OsTag.js.map +1 -0
- package/{lib → dist}/components/OsTags.d.ts.map +1 -1
- package/dist/components/OsTags.js +89 -0
- package/dist/components/OsTags.js.map +1 -0
- package/{lib → dist}/components/OsTagsContextMenu.d.ts +1 -1
- package/dist/components/OsTagsContextMenu.d.ts.map +1 -0
- package/dist/components/OsTagsContextMenu.js.map +1 -0
- package/{lib → dist}/components/TagsDots.d.ts +2 -3
- package/{lib → dist}/components/TagsDots.d.ts.map +1 -1
- package/dist/components/TagsDots.js +80 -0
- package/dist/components/TagsDots.js.map +1 -0
- package/{lib → dist}/constants.d.ts.map +1 -1
- package/dist/factory.d.ts.map +1 -0
- package/{lib → dist}/factory.js +6 -16
- package/dist/factory.js.map +1 -0
- package/dist/lib/AIClientImpl.js +38 -0
- package/dist/lib/AIClientImpl.js.map +1 -0
- package/{lib → dist}/lib/AsyncServiceLocator.d.ts.map +1 -1
- package/{lib → dist}/lib/AsyncServiceLocator.js +15 -21
- package/dist/lib/AsyncServiceLocator.js.map +1 -0
- package/dist/lib/JWTProvider.js +26 -0
- package/dist/lib/JWTProvider.js.map +1 -0
- package/{lib → dist}/lib/Proxy.d.ts.map +1 -1
- package/dist/lib/Proxy.js.map +1 -0
- package/{lib → dist}/lib/userWorkspace.d.ts.map +1 -1
- package/dist/lib/userWorkspace.js +19 -0
- package/dist/lib/userWorkspace.js.map +1 -0
- package/dist/octostar-platform-api.js +7325 -0
- package/{lib → dist}/utils.d.ts.map +1 -1
- package/dist/utils.js +28 -0
- package/dist/utils.js.map +1 -0
- package/package.json +26 -19
- package/dist/platform-api.d.ts +0 -383
- package/lib/apis.js.map +0 -1
- package/lib/components/AbstractContextMenu.js.map +0 -1
- package/lib/components/OsIcon.js.map +0 -1
- package/lib/components/OsRecordTitle.js +0 -100
- package/lib/components/OsRecordTitle.js.map +0 -1
- package/lib/components/OsSpinner.js.map +0 -1
- package/lib/components/OsTag.js +0 -64
- package/lib/components/OsTag.js.map +0 -1
- package/lib/components/OsTags.js +0 -99
- package/lib/components/OsTags.js.map +0 -1
- package/lib/components/OsTagsContextMenu.d.ts.map +0 -1
- package/lib/components/OsTagsContextMenu.js.map +0 -1
- package/lib/components/TagsDots.js +0 -86
- package/lib/components/TagsDots.js.map +0 -1
- package/lib/factory.d.ts.map +0 -1
- package/lib/factory.js.map +0 -1
- package/lib/lib/AIClientImpl.js +0 -52
- package/lib/lib/AIClientImpl.js.map +0 -1
- package/lib/lib/AsyncServiceLocator.js.map +0 -1
- package/lib/lib/JWTProvider.js +0 -39
- package/lib/lib/JWTProvider.js.map +0 -1
- package/lib/lib/Proxy.js.map +0 -1
- package/lib/lib/userWorkspace.js +0 -28
- package/lib/lib/userWorkspace.js.map +0 -1
- package/lib/utils.js +0 -38
- package/lib/utils.js.map +0 -1
- /package/{lib → dist}/apis.d.ts +0 -0
- /package/{lib → dist}/apis.d.ts.map +0 -0
- /package/{lib → dist}/components/AbstractContextMenu.d.ts +0 -0
- /package/{lib → dist}/components/AbstractContextMenu.d.ts.map +0 -0
- /package/{lib → dist}/components/OsContextMenu.d.ts +0 -0
- /package/{lib → dist}/components/OsContextMenu.d.ts.map +0 -0
- /package/{lib → dist}/components/OsContextMenu.js +0 -0
- /package/{lib → dist}/components/OsSpinner.d.ts +0 -0
- /package/{lib → dist}/components/OsSpinner.d.ts.map +0 -0
- /package/{lib → dist}/components/OsSpinner.js +0 -0
- /package/{lib → dist}/components/OsTag.d.ts +0 -0
- /package/{lib → dist}/components/OsTag.d.ts.map +0 -0
- /package/{lib → dist}/components/OsTags.d.ts +0 -0
- /package/{lib → dist}/components/OsTagsContextMenu.js +0 -0
- /package/{lib → dist}/components/index.d.ts +0 -0
- /package/{lib → dist}/components/index.d.ts.map +0 -0
- /package/{lib → dist}/components/index.js +0 -0
- /package/{lib → dist}/components/index.js.map +0 -0
- /package/{lib → dist}/constants.d.ts +0 -0
- /package/{lib → dist}/constants.js +0 -0
- /package/{lib → dist}/constants.js.map +0 -0
- /package/{lib → dist}/factory.d.ts +0 -0
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/index.d.ts.map +0 -0
- /package/{lib → dist}/index.js +0 -0
- /package/{lib → dist}/index.js.map +0 -0
- /package/{lib → dist}/lib/AIClientImpl.d.ts +0 -0
- /package/{lib → dist}/lib/AIClientImpl.d.ts.map +0 -0
- /package/{lib → dist}/lib/AsyncServiceLocator.d.ts +0 -0
- /package/{lib → dist}/lib/JWTProvider.d.ts +0 -0
- /package/{lib → dist}/lib/JWTProvider.d.ts.map +0 -0
- /package/{lib → dist}/lib/Proxy.d.ts +0 -0
- /package/{lib → dist}/lib/Proxy.js +0 -0
- /package/{lib → dist}/lib/userWorkspace.d.ts +0 -0
- /package/{lib → dist}/permissions.d.ts +0 -0
- /package/{lib → dist}/permissions.d.ts.map +0 -0
- /package/{lib → dist}/permissions.js +0 -0
- /package/{lib → dist}/permissions.js.map +0 -0
- /package/{lib → dist}/types.d.ts +0 -0
- /package/{lib → dist}/types.d.ts.map +0 -0
- /package/{lib → dist}/types.js +0 -0
- /package/{lib → dist}/types.js.map +0 -0
- /package/{lib → dist}/utils.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,GAAU,CAAC,EAC3B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACpC,UAAU,YAAY,KACrB,OAAO,CAAC,CAAC,CAqBX,CAAC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta
|
|
3
|
+
* Retry a function until it succeeds or the maximum number of attempts is reached.
|
|
4
|
+
*
|
|
5
|
+
* @param fn - The function to retry.
|
|
6
|
+
* @param options - The retry options.
|
|
7
|
+
* @returns The result of the function.
|
|
8
|
+
*/
|
|
9
|
+
export const retry = async (fn, options) => {
|
|
10
|
+
let attempts = 0;
|
|
11
|
+
const maxAttempts = options?.maxAttempts ?? 3;
|
|
12
|
+
const retryInterval = options?.retryInterval ?? 1000;
|
|
13
|
+
while (true) {
|
|
14
|
+
attempts += 1;
|
|
15
|
+
try {
|
|
16
|
+
// eslint-disable-next-line no-await-in-loop
|
|
17
|
+
return await fn();
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
if (attempts < maxAttempts) {
|
|
21
|
+
// eslint-disable-next-line no-await-in-loop
|
|
22
|
+
await new Promise(resolve => setTimeout(resolve, retryInterval));
|
|
23
|
+
}
|
|
24
|
+
throw e;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EACxB,EAAoC,EACpC,OAAsB,EACV,EAAE;IACd,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,IAAI,CAAC;IAErD,OAAO,IAAI,EAAE,CAAC;QACZ,QAAQ,IAAI,CAAC,CAAC;QAEd,IAAI,CAAC;YACH,4CAA4C;YAC5C,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;gBAC3B,4CAA4C;gBAC5C,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;YACnE,CAAC;YAED,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octostar/platform-api",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Provides access to the API exposed by Octostar platform to an application run in an iframe",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"octostar",
|
|
@@ -9,41 +9,48 @@
|
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "",
|
|
12
|
-
"directory": "
|
|
12
|
+
"directory": "packages/octostar-platform-api"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": "",
|
|
16
|
-
"main": "lib/index.js",
|
|
17
|
-
"types": "dist/platform-api.d.ts",
|
|
18
16
|
"files": [
|
|
19
|
-
"dist
|
|
20
|
-
"lib/**/*"
|
|
17
|
+
"dist"
|
|
21
18
|
],
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"source": "./src/index.ts"
|
|
25
|
+
}
|
|
29
26
|
},
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"module": "dist/index.js",
|
|
29
|
+
"types": "dist/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@types/uuid": "^9.0.2",
|
|
32
32
|
"post-robot": "^10.0.46",
|
|
33
33
|
"uuid": "^9.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@microsoft/api-extractor": "^7.42.3",
|
|
37
|
-
"@octostar/platform-types": "file:./packages/octostar-platform-types",
|
|
38
36
|
"babelify": "^10.0.0",
|
|
39
37
|
"browserify": "^17.0.0",
|
|
40
|
-
"rimraf": "^5.0.5"
|
|
38
|
+
"rimraf": "^5.0.5",
|
|
39
|
+
"tsup": "^8.4.0",
|
|
40
|
+
"typescript": "^5.8.2",
|
|
41
|
+
"@octostar/platform-types": "0.5.7"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
|
-
"@octostar/platform-types": "^0.5.
|
|
44
|
+
"@octostar/platform-types": "^0.5.7"
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public"
|
|
47
48
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
49
|
+
"scripts": {
|
|
50
|
+
"browserify": "browserify dist/index.js -s octostar -t [ babelify --presets [@babel/preset-env] ] -o dist/octostar-platform-api.js",
|
|
51
|
+
"build": "pnpm run clean && pnpm run compile && pnpm run browserify",
|
|
52
|
+
"clean": "rimraf ./dist ./temp ./.turbo tsconfig.tsbuildinfo",
|
|
53
|
+
"compile": "tsc",
|
|
54
|
+
"dev": "tsc -b -w"
|
|
55
|
+
}
|
|
56
|
+
}
|
package/dist/platform-api.d.ts
DELETED
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
import { AIClient } from '@octostar/platform-types';
|
|
2
|
-
import { ChatModel } from '@octostar/platform-types';
|
|
3
|
-
import { Concept } from '@octostar/platform-types';
|
|
4
|
-
import { ContextMenuRequest } from '@octostar/platform-types';
|
|
5
|
-
import { Desktop } from '@octostar/platform-types';
|
|
6
|
-
import { Entity } from '@octostar/platform-types';
|
|
7
|
-
import { ExtrasApi } from '@octostar/platform-types';
|
|
8
|
-
import { Ontology } from '@octostar/platform-types';
|
|
9
|
-
import { OsAPIClient } from '@octostar/platform-types';
|
|
10
|
-
import { PromptOptions } from '@octostar/platform-types';
|
|
11
|
-
import { RemoteAppApi } from '@octostar/platform-types';
|
|
12
|
-
import { SavedSearchAPIInterface } from '@octostar/platform-types';
|
|
13
|
-
import { TagWithRelationship } from '@octostar/platform-types';
|
|
14
|
-
import { WorkspaceItem } from '@octostar/platform-types';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @beta
|
|
18
|
-
* Abstract class for creating a context menu.
|
|
19
|
-
*/
|
|
20
|
-
export declare abstract class AbstractContextMenu extends HTMLElement {
|
|
21
|
-
trigger: string[];
|
|
22
|
-
private desktop;
|
|
23
|
-
constructor();
|
|
24
|
-
connectedCallback(): void;
|
|
25
|
-
disconnectedCallback(): void;
|
|
26
|
-
private updateProperties;
|
|
27
|
-
private handleRightClick;
|
|
28
|
-
private onMouseEnter;
|
|
29
|
-
private handleClick;
|
|
30
|
-
protected abstract getContext(): Partial<ContextMenuRequest>;
|
|
31
|
-
private publishMouseEvent;
|
|
32
|
-
private publishRequest;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare class AIClientImpl implements AIClient {
|
|
36
|
-
private osAPIClient;
|
|
37
|
-
private models;
|
|
38
|
-
constructor(osAPIClient: OsAPIClient);
|
|
39
|
-
getChatModels(): Promise<ChatModel[]>;
|
|
40
|
-
prompt(prompt: string, options?: PromptOptions): Promise<string>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @beta
|
|
45
|
-
* All permissions.
|
|
46
|
-
*/
|
|
47
|
-
export declare const ALL_PERMISSIONS = "all";
|
|
48
|
-
|
|
49
|
-
export declare const ALL_PERMISSIONS_ARRAY: string[];
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @beta
|
|
53
|
-
* API names.
|
|
54
|
-
*/
|
|
55
|
-
export declare const apiNames: Record<"desktop", "octostar:api-names:desktop"> & Record<"ontology", "octostar:api-names:ontology"> & Record<"context", "octostar:api-names:context"> & Record<"extras", "octostar:api-names:extras"> & Record<"remoteApp", "octostar:api-names:remoteApp"> & Record<"savedSearch", "octostar:api-names:savedSearch">;
|
|
56
|
-
|
|
57
|
-
declare type BasePostResponsePayload<D, E> = {
|
|
58
|
-
data: D;
|
|
59
|
-
error: E;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @beta
|
|
64
|
-
* Type representing the context API.
|
|
65
|
-
*/
|
|
66
|
-
export declare type ContextApi<T> = {
|
|
67
|
-
getContext: () => Promise<T>;
|
|
68
|
-
subscribeToChanges: (id: string | ContextListener<T>, callback?: ContextListener<T>) => Promise<void>;
|
|
69
|
-
unsubscribeFromChanges: (id: string) => Promise<void>;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @beta
|
|
74
|
-
* Provides access to the context API.
|
|
75
|
-
* For asynchronous access, use {@link getContextApi}.
|
|
76
|
-
*/
|
|
77
|
-
export declare const contextApi: () => EnsureMethodsReturnPromise<ContextApi<unknown>>;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @beta
|
|
81
|
-
* Type representing a context listener.
|
|
82
|
-
*/
|
|
83
|
-
export declare type ContextListener<T> = (context: T) => void;
|
|
84
|
-
|
|
85
|
-
declare type CreateMessageNamesResult<N, M> = M extends readonly [infer F, ...infer R] ? Record<F & string, MessageValue<N, F>> & CreateMessageNamesResult<N, R> : {};
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @beta
|
|
89
|
-
* Create a set of message names with a namespace.
|
|
90
|
-
*/
|
|
91
|
-
export declare const createPrefixesConstants: <N extends string, M extends readonly [string, ...string[]]>(namespace: N, messages: M, channelId?: string) => CreateMessageNamesResult<N, M>;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @beta
|
|
95
|
-
* Desktop permission group.
|
|
96
|
-
*/
|
|
97
|
-
export declare const DESKTOP_PERMISSION_GROUP = "octostar:desktop:";
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @beta
|
|
101
|
-
* Provides access to the desktop API.
|
|
102
|
-
* For asynchronous access, use {@link getDesktopApi}.
|
|
103
|
-
*/
|
|
104
|
-
export declare const desktopApi: () => EnsureMethodsReturnPromise<Desktop>;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @internal
|
|
108
|
-
*/
|
|
109
|
-
export declare type EnsureMethodsReturnPromise<T> = {
|
|
110
|
-
[K in keyof T]: T[K] extends (...args: any[]) => any ? (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>> : T[K];
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @beta
|
|
115
|
-
* Type representing a POST response payload with an error.
|
|
116
|
-
*/
|
|
117
|
-
export declare type ErrorPostResponsePayload = BasePostResponsePayload<null, {
|
|
118
|
-
code: string;
|
|
119
|
-
message: string;
|
|
120
|
-
}>;
|
|
121
|
-
|
|
122
|
-
export declare const extrasApi: () => EnsureMethodsReturnPromise<ExtrasApi>;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @beta
|
|
126
|
-
* Get the context API asynchronously.
|
|
127
|
-
*/
|
|
128
|
-
export declare const getContextApi: () => Promise<EnsureMethodsReturnPromise<ContextApi<unknown>>>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @beta
|
|
132
|
-
* Get the desktop API asynchronously.
|
|
133
|
-
*/
|
|
134
|
-
export declare const getDesktopApi: () => Promise<EnsureMethodsReturnPromise<Desktop>>;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @beta
|
|
138
|
-
* Get the ontology API asynchronously.
|
|
139
|
-
*/
|
|
140
|
-
export declare const getOntologyApi: () => Promise<EnsureMethodsReturnPromise<Ontology>>;
|
|
141
|
-
|
|
142
|
-
export declare const getOrCreateUsersPrivateWorkspaceRecord: (desktop: Desktop, ontology: Ontology) => Promise<WorkspaceItem>;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @beta
|
|
146
|
-
* Message names for post messages.
|
|
147
|
-
*/
|
|
148
|
-
export declare const getPostMessageNames: (channelId: string) => Record<"get_api", "octostar:post-messages:get_api">;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @beta
|
|
152
|
-
* Type representing a message value.
|
|
153
|
-
*/
|
|
154
|
-
export declare type GetRemoteApiParams = {
|
|
155
|
-
name: string;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export declare class JWTProvider implements TokenProvider {
|
|
159
|
-
private token;
|
|
160
|
-
private decoded;
|
|
161
|
-
private tokenProvider;
|
|
162
|
-
private expiresThreshold;
|
|
163
|
-
constructor(tokenProvider: TokenProvider, expiresThreshold?: number);
|
|
164
|
-
private fetchToken;
|
|
165
|
-
private isExpiredOrExpiringSoon;
|
|
166
|
-
getToken(): Promise<string>;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export declare const makeProxy: <T extends object>(obj: T, excludeKeys?: (keyof T)[]) => Record<string, any>;
|
|
170
|
-
|
|
171
|
-
declare type MessageValue<N, M> = `${N & string}:${M & string}`;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* @beta
|
|
175
|
-
* Ontology permission group.
|
|
176
|
-
*/
|
|
177
|
-
export declare const ONTOLOGY_PERMISSION_GROUP = "octostar:ontology:";
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* @beta
|
|
181
|
-
* Provides access to the ontology API.
|
|
182
|
-
* For asynchronous access, use {@link getOntologyApi}.
|
|
183
|
-
*/
|
|
184
|
-
export declare const ontologyApi: () => EnsureMethodsReturnPromise<Ontology>;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* @beta
|
|
188
|
-
* Custom element that renders a context menu.
|
|
189
|
-
*/
|
|
190
|
-
export declare class OsContextMenu extends AbstractContextMenu {
|
|
191
|
-
private innerContext;
|
|
192
|
-
set context(value: Partial<ContextMenuRequest>);
|
|
193
|
-
get context(): Partial<ContextMenuRequest>;
|
|
194
|
-
protected getContext(): Partial<ContextMenuRequest>;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @beta
|
|
199
|
-
* Custom element that renders an icon.
|
|
200
|
-
*/
|
|
201
|
-
export declare class OsIcon extends HTMLElement {
|
|
202
|
-
private root;
|
|
203
|
-
private whatFor;
|
|
204
|
-
private desktop;
|
|
205
|
-
constructor();
|
|
206
|
-
static get observedAttributes(): string[];
|
|
207
|
-
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
208
|
-
connectedCallback(): void;
|
|
209
|
-
loadFontAwesomeStyles(): void;
|
|
210
|
-
set for(value: Entity | Concept | string);
|
|
211
|
-
get for(): Entity | Concept | string;
|
|
212
|
-
render(): Promise<void>;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* @beta
|
|
217
|
-
* Custom element that renders a record title.
|
|
218
|
-
*/
|
|
219
|
-
export declare class OsRecordTitle extends HTMLElement {
|
|
220
|
-
private root;
|
|
221
|
-
record: Entity | WorkspaceItem;
|
|
222
|
-
iconComponent: OsIcon;
|
|
223
|
-
labelElement: any;
|
|
224
|
-
tagsComponent: OsTags;
|
|
225
|
-
elipsisButton: any;
|
|
226
|
-
constructor();
|
|
227
|
-
connectedCallback(): void;
|
|
228
|
-
set recordData(value: any);
|
|
229
|
-
get recordData(): any;
|
|
230
|
-
static get observedAttributes(): string[];
|
|
231
|
-
render(): Promise<void>;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* @beta
|
|
236
|
-
* Spinner component.
|
|
237
|
-
*/
|
|
238
|
-
export declare class OsSpinner extends HTMLElement {
|
|
239
|
-
root: ShadowRoot;
|
|
240
|
-
position: string;
|
|
241
|
-
image: string;
|
|
242
|
-
constructor();
|
|
243
|
-
static get observedAttributes(): string[];
|
|
244
|
-
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
245
|
-
set imageSrc(value: string);
|
|
246
|
-
get imageSrc(): string;
|
|
247
|
-
render(): void;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* @beta
|
|
252
|
-
* Custom element that renders a tag as a colored dot.
|
|
253
|
-
*/
|
|
254
|
-
export declare class OsTag extends HTMLElement {
|
|
255
|
-
root: ShadowRoot;
|
|
256
|
-
tag: TagWithRelationship | undefined;
|
|
257
|
-
constructor();
|
|
258
|
-
static get observedAttributes(): string[];
|
|
259
|
-
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
260
|
-
connectedCallback(): void;
|
|
261
|
-
set OsTag(value: TagWithRelationship);
|
|
262
|
-
render(): Promise<void>;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* @beta
|
|
267
|
-
* Custom element that renders a list of tags.
|
|
268
|
-
*/
|
|
269
|
-
export declare class OsTags extends HTMLElement {
|
|
270
|
-
private root;
|
|
271
|
-
private record;
|
|
272
|
-
private desktop;
|
|
273
|
-
private mode;
|
|
274
|
-
constructor();
|
|
275
|
-
static get observedAttributes(): string[];
|
|
276
|
-
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
277
|
-
loadTags(): Promise<TagWithRelationship[]>;
|
|
278
|
-
connectedCallback(): void;
|
|
279
|
-
set recordData(value: Entity);
|
|
280
|
-
get recordData(): Entity | undefined;
|
|
281
|
-
set dotsMode(visible: string);
|
|
282
|
-
get dotsMode(): string;
|
|
283
|
-
render(): Promise<void>;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @beta
|
|
288
|
-
* Custom element that renders a context menu for tags.
|
|
289
|
-
*/
|
|
290
|
-
export declare class OsTagsContextMenu extends AbstractContextMenu {
|
|
291
|
-
private entity;
|
|
292
|
-
static get observedAttributes(): string[];
|
|
293
|
-
connectedCallback(): void;
|
|
294
|
-
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
295
|
-
set record(entity: Entity);
|
|
296
|
-
protected getContext(): Partial<ContextMenuRequest>;
|
|
297
|
-
private render;
|
|
298
|
-
private update;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* @beta
|
|
303
|
-
* Type representing a POST request.
|
|
304
|
-
*/
|
|
305
|
-
export declare type PostRequest<T extends object> = {
|
|
306
|
-
source: Window | null;
|
|
307
|
-
origin: string;
|
|
308
|
-
data: T;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* @beta
|
|
313
|
-
* Type representing a POST response.
|
|
314
|
-
*/
|
|
315
|
-
export declare type PostResponse<T extends object> = {
|
|
316
|
-
source: Window | null;
|
|
317
|
-
origin: string;
|
|
318
|
-
data: T;
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* @beta
|
|
323
|
-
* Type representing a POST response payload.
|
|
324
|
-
*/
|
|
325
|
-
export declare type PostResponsePayload<T> = ErrorPostResponsePayload | SuccessPostResponsePayload<T>;
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* @beta
|
|
329
|
-
* Type representing a POST response with a payload.
|
|
330
|
-
*/
|
|
331
|
-
export declare type PostResponseWithPayload<T> = PostResponse<PostResponsePayload<T>>;
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* @internal
|
|
335
|
-
*/
|
|
336
|
-
export declare type RemoteApiError = Error & {
|
|
337
|
-
originalError: Error;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
export declare const remoteAppApi: () => EnsureMethodsReturnPromise<RemoteAppApi>;
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* @beta
|
|
344
|
-
* Retry a function until it succeeds or the maximum number of attempts is reached.
|
|
345
|
-
*
|
|
346
|
-
* @param fn - The function to retry.
|
|
347
|
-
* @param options - The retry options.
|
|
348
|
-
* @returns The result of the function.
|
|
349
|
-
*/
|
|
350
|
-
export declare const retry: <T>(fn: (...args: any) => T | Promise<T>, options?: RetryOptions) => Promise<T>;
|
|
351
|
-
|
|
352
|
-
declare type RetryOptions = {
|
|
353
|
-
maxAttempts?: number;
|
|
354
|
-
retryInterval?: number;
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
export declare const savedSearchApi: () => EnsureMethodsReturnPromise<SavedSearchAPIInterface>;
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @beta
|
|
361
|
-
* Type representing a POST response payload with a success.
|
|
362
|
-
*/
|
|
363
|
-
export declare type SuccessPostResponsePayload<T> = BasePostResponsePayload<T, null>;
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* @beta
|
|
367
|
-
* Custom element that renders a list of tags as colored dots.
|
|
368
|
-
* If the number of tags exceeds the maximum number of dots, a count of the remaining tags is displayed.
|
|
369
|
-
*/
|
|
370
|
-
export declare class TagDots extends HTMLElement {
|
|
371
|
-
tags: TagWithRelationship[] | undefined;
|
|
372
|
-
private root;
|
|
373
|
-
constructor();
|
|
374
|
-
set tagsData(value: TagWithRelationship[]);
|
|
375
|
-
get tagsData(): TagWithRelationship[];
|
|
376
|
-
render(): Promise<void>;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export declare interface TokenProvider {
|
|
380
|
-
getToken(): Promise<string>;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
export { }
|
package/lib/apis.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":";;;;;;;;;AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC,cAAc,EAAE;IAClE,KAAK,EAAE,KAAK;CACb,CAAC;KACC,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE,CAC/B,qBAAqB,CAAsC;IACzD,IAAI,EAAE,QAAQ,CAAC,OAAO;CACvB,CAAC,CACH;KACA,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,CAChC,qBAAqB,CAAuC;IAC1D,IAAI,EAAE,QAAQ,CAAC,QAAQ;CACxB,CAAC,CACH;KACA,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE;AAC/B,uCAAuC;AACvC,qBAAqB,CAAkD;IACrE,IAAI,EAAE,QAAQ,CAAC,OAAO;CACvB,CAAC,CACH;KACA,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,CAC9B,qBAAqB,CAAwC;IAC3D,IAAI,EAAE,QAAQ,CAAC,MAAM;CACtB,CAAC,CACH;KACA,eAAe,CAAC,WAAW,EAAE,GAAG,EAAE,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,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACjD,IACE,CAAC,QAAQ,CAAC,aAAa,CACrB,6CAA6C,KAAK,QAAQ,CAC3D,EACD;oBACA,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;oBAC5C,IAAI,CAAC,IAAI,GAAG,kCAAkC,KAAK,MAAM,CAAC;oBAC1D,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;oBACxB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;iBACjC;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,IAAI,GAAG,CAAC,KAAgC;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEK,MAAM;;YACV,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACjB,OAAO;aACR;YAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,mBAAmB,CACnE,IAAI,CAAC,OAAO,CACb,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YAE3B,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACjC,wCAAwC;gBACxC,IAAI,CAAC,qBAAqB,EAAE,CAAC;aAC9B;QACH,CAAC;KAAA;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;IAClC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAC1C"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @beta
|
|
12
|
-
* Custom element that renders a record title.
|
|
13
|
-
*/
|
|
14
|
-
export class OsRecordTitle extends HTMLElement {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
this.root = this.attachShadow({ mode: 'open' });
|
|
18
|
-
}
|
|
19
|
-
connectedCallback() {
|
|
20
|
-
if (this.record) {
|
|
21
|
-
this.render();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
set recordData(value) {
|
|
25
|
-
this.record = value;
|
|
26
|
-
this.setAttribute('record', JSON.stringify(value));
|
|
27
|
-
}
|
|
28
|
-
get recordData() {
|
|
29
|
-
return this.record;
|
|
30
|
-
}
|
|
31
|
-
static get observedAttributes() {
|
|
32
|
-
return ['record', 'tags', 'contextmenu'];
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
if (!this.record) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
this.root.innerHTML = `<style>
|
|
40
|
-
:host {
|
|
41
|
-
width: 100%;
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
gap: 10px;
|
|
45
|
-
justify-content: space-between;
|
|
46
|
-
}
|
|
47
|
-
:host(:hover) {
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
background-color: #f7f7f7;
|
|
50
|
-
}
|
|
51
|
-
.group {
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
gap: 5px;
|
|
55
|
-
}
|
|
56
|
-
.svg-hover:hover {
|
|
57
|
-
border-radius: 6px;
|
|
58
|
-
background-color: #e0e0e0;
|
|
59
|
-
}
|
|
60
|
-
</style>
|
|
61
|
-
`;
|
|
62
|
-
const contextMenuTitle = document.createElement('os-context-menu');
|
|
63
|
-
contextMenuTitle.context = {
|
|
64
|
-
item: this.record,
|
|
65
|
-
};
|
|
66
|
-
const contextMenuSvg = document.createElement('os-context-menu');
|
|
67
|
-
contextMenuSvg.setAttribute('trigger', 'click');
|
|
68
|
-
contextMenuSvg.context = {
|
|
69
|
-
item: this.record,
|
|
70
|
-
};
|
|
71
|
-
const leftGroup = document.createElement('div');
|
|
72
|
-
leftGroup.className = 'group';
|
|
73
|
-
const rightGroup = document.createElement('div');
|
|
74
|
-
rightGroup.className = 'group';
|
|
75
|
-
const ellipsisSVG = document.createElement('span');
|
|
76
|
-
ellipsisSVG.className = 'svg-hover';
|
|
77
|
-
ellipsisSVG.innerHTML =
|
|
78
|
-
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>';
|
|
79
|
-
contextMenuSvg.appendChild(ellipsisSVG);
|
|
80
|
-
const icon = document.createElement('os-icon');
|
|
81
|
-
const label = document.createElement('p');
|
|
82
|
-
const tags = document.createElement('os-tags');
|
|
83
|
-
label.innerText = this.record.entity_label;
|
|
84
|
-
icon.for = this.record;
|
|
85
|
-
tags.recordData = this.record;
|
|
86
|
-
tags.setAttribute('mode', 'dots');
|
|
87
|
-
leftGroup.appendChild(icon);
|
|
88
|
-
leftGroup.appendChild(label);
|
|
89
|
-
rightGroup.appendChild(tags);
|
|
90
|
-
rightGroup.appendChild(contextMenuSvg);
|
|
91
|
-
contextMenuTitle.appendChild(leftGroup);
|
|
92
|
-
contextMenuTitle.appendChild(rightGroup);
|
|
93
|
-
this.root.appendChild(contextMenuTitle);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (!customElements.get('os-record-title')) {
|
|
98
|
-
customElements.define('os-record-title', OsRecordTitle);
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=OsRecordTitle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OsRecordTitle.js","sourceRoot":"","sources":["../../src/components/OsRecordTitle.ts"],"names":[],"mappings":";;;;;;;;;AAMA;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAa5C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;IACH,CAAC;IAED,IAAI,UAAU,CAAC,KAAU;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC3C,CAAC;IAEK,MAAM;;YACV,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBAChB,OAAO;aACR;YAED,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBzB,CAAC;YACE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAC7C,iBAAiB,CACD,CAAC;YACnB,gBAAgB,CAAC,OAAO,GAAG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