MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / createKey

Function createKey

packages/typesense/src/utils/keys.ts:6–21  ·  view source on GitHub ↗
({
  keyWithSearchPermissions,
  filter_by,
}: {
  keyWithSearchPermissions: string;
  filter_by: string;
})

Source from the content-addressed store, hash-verified

4const expiresAt = () => Math.floor(new Date().getTime() / 1000.0) + week;
5
6function createKey({
7 keyWithSearchPermissions,
8 filter_by,
9}: {
10 keyWithSearchPermissions: string;
11 filter_by: string;
12}) {
13 const expires_at = expiresAt();
14 const value = client
15 .keys()
16 .generateScopedSearchKey(keyWithSearchPermissions, {
17 filter_by,
18 expires_at,
19 });
20 return { value, expires_at };
21}
22
23export function createFeedKey({
24 keyWithSearchPermissions,

Callers 3

createFeedKeyFunction · 0.85
createUserKeyFunction · 0.85
createAccountKeyFunction · 0.85

Calls 1

expiresAtFunction · 0.85

Tested by

no test coverage detected