@authhero/adapter-interfaces 4.10.0 → 4.11.0

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.
@@ -28,6 +28,23 @@ export interface UpdateRefreshTokenOptions {
28
28
  expires_at: string;
29
29
  };
30
30
  }
31
+ /**
32
+ * Update payload for a refresh token.
33
+ *
34
+ * The two expiry columns are three-valued on the way in: `undefined` leaves
35
+ * the stored value alone, a string overwrites it, and `null` clears it — the
36
+ * token stops expiring on that axis.
37
+ *
38
+ * Clearing exists for the in-place refresh exchange. A rotating client
39
+ * reconciles a changed refresh-token config for free, because the child row is
40
+ * minted from the current lifetimes; a non-rotating one keeps handing back the
41
+ * row it was given, so switching a client to non-expiring has to be able to
42
+ * drop the expiries that row was stamped with.
43
+ */
44
+ export type RefreshTokenUpdate = Partial<Omit<RefreshToken, "expires_at" | "idle_expires_at">> & {
45
+ expires_at?: string | null;
46
+ idle_expires_at?: string | null;
47
+ };
31
48
  export interface RefreshTokensAdapter {
32
49
  create: (tenant_id: string, refresh_token: RefreshTokenInsert) => Promise<RefreshToken>;
33
50
  get: (tenant_id: string, id: string) => Promise<RefreshToken | null>;
@@ -38,7 +55,7 @@ export interface RefreshTokensAdapter {
38
55
  */
39
56
  getByLookup: (tenant_id: string, token_lookup: string) => Promise<RefreshToken | null>;
40
57
  list(tenant_id: string, params?: RefreshTokenListParams): Promise<ListRefreshTokenResponse>;
41
- update: (tenant_id: string, id: string, refresh_token: Partial<RefreshToken>, options?: UpdateRefreshTokenOptions) => Promise<boolean>;
58
+ update: (tenant_id: string, id: string, refresh_token: RefreshTokenUpdate, options?: UpdateRefreshTokenOptions) => Promise<boolean>;
42
59
  remove: (tenant_id: string, id: string) => Promise<boolean>;
43
60
  /**
44
61
  * Soft-revoke every refresh token belonging to a user that isn't already
@@ -1,7 +1,13 @@
1
1
  /**
2
2
  * Shared pieces of the Lucene-style `q` filter handling. The SQL generation
3
3
  * itself is ORM-specific and lives in each adapter; what is shared here is
4
- * the query-string sanitization that enforces the tenant boundary.
4
+ * the tokenizer (including the OR split) and the query-string sanitization
5
+ * that enforces the tenant boundary.
5
6
  */
7
+ export declare function tokenizeLuceneQuery(query: string): string[];
8
+ export declare function unescapeLuceneValue(value: string): string;
9
+ export declare function escapeLuceneValue(value: string): string;
10
+ export declare function unquoteLuceneValue(value: string): string;
11
+ export declare function splitLuceneOrGroups(query: string): string[][];
6
12
  export declare function sanitizeLuceneQuery(query: string, allowedFields: string[]): string;
7
13
  export declare function isEmailSearchTerm(value: string): boolean;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "4.10.0",
14
+ "version": "4.11.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],