@nu-art/ts-focused-object-shared 0.400.5
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/api-def.d.ts +14 -0
- package/api-def.js +10 -0
- package/consts.d.ts +2 -0
- package/consts.js +3 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +62 -0
- package/types.d.ts +21 -0
- package/types.js +1 -0
package/api-def.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiDefResolver, BodyApi } from '@nu-art/thunderstorm-shared';
|
|
2
|
+
import { FocusedEntity } from './types.js';
|
|
3
|
+
export type FocusedItem_Update = {
|
|
4
|
+
request: {
|
|
5
|
+
focusedEntities: FocusedEntity[];
|
|
6
|
+
};
|
|
7
|
+
response: void;
|
|
8
|
+
};
|
|
9
|
+
export type ApiStruct_FocusedObject = {
|
|
10
|
+
_v1: {
|
|
11
|
+
update: BodyApi<FocusedItem_Update['response'], FocusedItem_Update['request']>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const ApiDef_FocusedObject: ApiDefResolver<ApiStruct_FocusedObject>;
|
package/api-def.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpMethod } from '@nu-art/thunderstorm-shared';
|
|
2
|
+
export const ApiDef_FocusedObject = {
|
|
3
|
+
_v1: {
|
|
4
|
+
// setFocusStatusByTabId: {method: HttpMethod.POST, path: '/v1/focus-object/set-focus-status'},
|
|
5
|
+
// updateFocusData: {method: HttpMethod.POST, path: '/v1/focus-object/focus'},
|
|
6
|
+
// releaseObject: {method: HttpMethod.POST, path: '/v1/focus-object/release'},
|
|
7
|
+
// releaseByTabId: {method: HttpMethod.POST, path: '/v1/focus-object/release-tab'}, // Tab Id is sent as header, so we know what tab to release.
|
|
8
|
+
update: { method: HttpMethod.POST, path: '/v1/focus-object/update' },
|
|
9
|
+
}
|
|
10
|
+
};
|
package/consts.d.ts
ADDED
package/consts.js
ADDED
package/index.d.ts
ADDED
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nu-art/ts-focused-object-shared",
|
|
3
|
+
"version": "0.400.5",
|
|
4
|
+
"description": "ts-focused-object - Express & Typescript based backend framework Shared",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"TacB0sS",
|
|
7
|
+
"infra",
|
|
8
|
+
"nu-art",
|
|
9
|
+
"thunderstorm",
|
|
10
|
+
"typescript",
|
|
11
|
+
"ts-focused-object"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/nu-art-js/thunderstorm",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/nu-art-js/thunderstorm/issues"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"directory": "dist",
|
|
19
|
+
"linkDirectory": true
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+ssh://git@github.com:nu-art-js/thunderstorm.git"
|
|
24
|
+
},
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"author": "TacB0sS",
|
|
27
|
+
"files": [
|
|
28
|
+
"**/*"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@nu-art/ts-common": "0.400.5",
|
|
35
|
+
"@nu-art/thunderstorm-shared": "0.400.5",
|
|
36
|
+
"@nu-art/firebase-shared": "0.400.5",
|
|
37
|
+
"@nu-art/user-account-shared": "0.400.5",
|
|
38
|
+
"firebase": "^11.9.0",
|
|
39
|
+
"firebase-admin": "13.4.0",
|
|
40
|
+
"firebase-functions": "6.3.2",
|
|
41
|
+
"react": "^18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/react": "^18.0.0",
|
|
45
|
+
"@types/chai": "^4.3.4",
|
|
46
|
+
"@types/mocha": "^10.0.1"
|
|
47
|
+
},
|
|
48
|
+
"unitConfig": {
|
|
49
|
+
"type": "typescript-lib"
|
|
50
|
+
},
|
|
51
|
+
"type": "module",
|
|
52
|
+
"exports": {
|
|
53
|
+
".": {
|
|
54
|
+
"types": "./index.d.ts",
|
|
55
|
+
"import": "./index.js"
|
|
56
|
+
},
|
|
57
|
+
"./*": {
|
|
58
|
+
"types": "./*.d.ts",
|
|
59
|
+
"import": "./*.js"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TypedMap, UniqueId } from '@nu-art/ts-common';
|
|
2
|
+
type TabId_Map<T> = TypedMap<T>;
|
|
3
|
+
type DeviceId_Map<T> = TypedMap<T>;
|
|
4
|
+
type AccountId_Map<T> = TypedMap<T>;
|
|
5
|
+
type ItemId_Map<T> = TypedMap<T>;
|
|
6
|
+
type DbName_Map<T> = TypedMap<T>;
|
|
7
|
+
/**
|
|
8
|
+
* First layer is dbKey.<br>
|
|
9
|
+
* Then _id of an item in the collection.<br>
|
|
10
|
+
* Then _id of the user-account.<br>
|
|
11
|
+
* Then the id of the device, as we can have multiple devices for each account.<br>
|
|
12
|
+
* Then the id of the tab, as we can have multiple tabs across each device.<br>
|
|
13
|
+
* And only then the actual data, which is a timestamp (number)<br>
|
|
14
|
+
* <p>===<p><b>dbName / objectId / accountId / deviceId / tabId / timestamp
|
|
15
|
+
*/
|
|
16
|
+
export type FocusData_Map = DbName_Map<ItemId_Map<AccountId_Map<DeviceId_Map<TabId_Map<number>>>>>;
|
|
17
|
+
export type FocusedEntity = {
|
|
18
|
+
dbKey: string;
|
|
19
|
+
itemId: UniqueId;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|