This commit is contained in:
2026-09-19 22:19:35 +02:00
commit 231b3e006a
124 changed files with 13816 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
{
"name": "@kooltab/shared",
"version": "1.0.0",
"main": "dist/index.js",
"types": "src/index.ts",
"scripts": {
"build": "tsc",
"typecheck": "tsc --noEmit",
"lint": "echo 'no linter configured'",
"clean": "rimraf dist"
},
"devDependencies": {
"typescript": "^5.4.0"
}
}
+12
View File
@@ -0,0 +1,12 @@
export declare const DEVICE_ONLINE_THRESHOLD_MS = 60000;
export declare const DEVICE_STALE_THRESHOLD_MS = 300000;
export declare const DEVICE_OFFLINE_THRESHOLD_MS = 600000;
export declare const COMMAND_EXPIRY_HOURS = 24;
export declare const TOKEN_EXPIRY_DAYS = 90;
export declare const SYNC_RATE_LIMIT_WINDOW_MS = 30000;
export declare const COMMAND_RATE_LIMIT_WINDOW_MS = 60000;
export declare const COMMAND_RATE_LIMIT_MAX = 10;
export declare const CURSOR_TIEBREAKER_LENGTH = 8;
export declare const TOKEN_PREFIX_LENGTH = 8;
export declare const TOKEN_BYTE_LENGTH = 48;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,yBAAyB,SAAU,CAAC;AACjD,eAAO,MAAM,2BAA2B,SAAU,CAAC;AACnD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAChD,eAAO,MAAM,4BAA4B,QAAS,CAAC;AACnD,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,KAAK,CAAC"}
+15
View File
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TOKEN_BYTE_LENGTH = exports.TOKEN_PREFIX_LENGTH = exports.CURSOR_TIEBREAKER_LENGTH = exports.COMMAND_RATE_LIMIT_MAX = exports.COMMAND_RATE_LIMIT_WINDOW_MS = exports.SYNC_RATE_LIMIT_WINDOW_MS = exports.TOKEN_EXPIRY_DAYS = exports.COMMAND_EXPIRY_HOURS = exports.DEVICE_OFFLINE_THRESHOLD_MS = exports.DEVICE_STALE_THRESHOLD_MS = exports.DEVICE_ONLINE_THRESHOLD_MS = void 0;
exports.DEVICE_ONLINE_THRESHOLD_MS = 60_000; // 1 minute
exports.DEVICE_STALE_THRESHOLD_MS = 300_000; // 5 minutes
exports.DEVICE_OFFLINE_THRESHOLD_MS = 600_000; // 10 minutes
exports.COMMAND_EXPIRY_HOURS = 24;
exports.TOKEN_EXPIRY_DAYS = 90;
exports.SYNC_RATE_LIMIT_WINDOW_MS = 30_000; // 30 seconds
exports.COMMAND_RATE_LIMIT_WINDOW_MS = 60_000; // 1 minute
exports.COMMAND_RATE_LIMIT_MAX = 10;
exports.CURSOR_TIEBREAKER_LENGTH = 8;
exports.TOKEN_PREFIX_LENGTH = 8;
exports.TOKEN_BYTE_LENGTH = 48;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,MAAM,CAAC,CAAC,WAAW;AAChD,QAAA,yBAAyB,GAAG,OAAO,CAAC,CAAC,YAAY;AACjD,QAAA,2BAA2B,GAAG,OAAO,CAAC,CAAC,aAAa;AACpD,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAC1B,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,yBAAyB,GAAG,MAAM,CAAC,CAAC,aAAa;AACjD,QAAA,4BAA4B,GAAG,MAAM,CAAC,CAAC,WAAW;AAClD,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAC5B,QAAA,wBAAwB,GAAG,CAAC,CAAC;AAC7B,QAAA,mBAAmB,GAAG,CAAC,CAAC;AACxB,QAAA,iBAAiB,GAAG,EAAE,CAAC"}
+11
View File
@@ -0,0 +1,11 @@
export const DEVICE_ONLINE_THRESHOLD_MS = 60_000; // 1 minute
export const DEVICE_STALE_THRESHOLD_MS = 300_000; // 5 minutes
export const DEVICE_OFFLINE_THRESHOLD_MS = 600_000; // 10 minutes
export const COMMAND_EXPIRY_HOURS = 24;
export const TOKEN_EXPIRY_DAYS = 90;
export const SYNC_RATE_LIMIT_WINDOW_MS = 30_000; // 30 seconds
export const COMMAND_RATE_LIMIT_WINDOW_MS = 60_000; // 1 minute
export const COMMAND_RATE_LIMIT_MAX = 10;
export const CURSOR_TIEBREAKER_LENGTH = 8;
export const TOKEN_PREFIX_LENGTH = 8;
export const TOKEN_BYTE_LENGTH = 48;
+3
View File
@@ -0,0 +1,3 @@
export * from './types';
export * from './constants';
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
+19
View File
@@ -0,0 +1,19 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./types"), exports);
__exportStar(require("./constants"), exports);
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B"}
+2
View File
@@ -0,0 +1,2 @@
export * from './types';
export * from './constants';
+8
View File
@@ -0,0 +1,8 @@
export type DeviceStatus = 'online' | 'recently_seen' | 'stale' | 'offline' | 'revoked';
export type CommandStatus = 'pending' | 'completed' | 'failed' | 'conflict' | 'expired';
export type CommandType = 'close_tab';
export type PaymentMethod = 'cash' | 'payconiq' | 'payment_pending';
export type ClientUserRole = 'admin' | 'viewer';
export type ActorType = 'client_user' | 'device' | 'system';
export type AuditAction = 'command_created' | 'command_acknowledged' | 'command_expired' | 'device_registered' | 'device_revoked' | 'snapshot_conflict';
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAExF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,iBAAiB,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5D,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,CAAC"}
+3
View File
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
+19
View File
@@ -0,0 +1,19 @@
export type DeviceStatus = 'online' | 'recently_seen' | 'stale' | 'offline' | 'revoked';
export type CommandStatus = 'pending' | 'completed' | 'failed' | 'conflict' | 'expired';
export type CommandType = 'close_tab';
export type PaymentMethod = 'cash' | 'payconiq' | 'payment_pending';
export type ClientUserRole = 'admin' | 'viewer';
export type ActorType = 'client_user' | 'device' | 'system';
export type AuditAction =
| 'command_created'
| 'command_acknowledged'
| 'command_expired'
| 'device_registered'
| 'device_revoked'
| 'snapshot_conflict';
+8
View File
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}