@stackframe/stack-shared 2.0.0 → 2.1.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.
@@ -1 +1,2 @@
1
1
  export declare const fetchTokenPrefix = "#stack-auth--if-you-see-this-you-probably-forgot-to-add-an-auth-provider----";
2
+ //# sourceMappingURL=fetch-token.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare function getPasswordError(password: string): string | null;
2
+ //# sourceMappingURL=password.d.ts.map
@@ -2,3 +2,4 @@ import { AsyncResult } from "../utils/results";
2
2
  export declare function useAsyncExternalStore<T>(subscribe: (callback: (t: T) => void) => (() => void)): AsyncResult<T, never> & {
3
3
  status: "ok" | "pending";
4
4
  };
5
+ //# sourceMappingURL=use-async-external-store.d.ts.map
@@ -4,3 +4,4 @@
4
4
  * The most recent value will be kept from garbage collection until one of the dependencies becomes unreachable. This may be true even after the component no longer renders. Be wary of memory leaks.
5
5
  */
6
6
  export declare function useStrictMemo<T>(callback: () => T, dependencies: any[]): T;
7
+ //# sourceMappingURL=use-strict-memo.d.ts.map
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { StackClientInterface, UserJson as UserJson, UserCustomizableJson, Clien
2
2
  export { StackServerInterface, ServerUserJson, ServerUserCustomizableJson, } from "./interface/serverInterface";
3
3
  export { StackAdminInterface, ApiKeySetBaseJson, ApiKeySetFirstViewJson, ApiKeySetJson, } from "./interface/adminInterface";
4
4
  export { fetchTokenPrefix } from "./helpers/fetch-token";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -76,3 +76,4 @@ export declare class StackAdminInterface extends StackServerInterface {
76
76
  revokeApiKeySetById(id: string): Promise<void>;
77
77
  getApiKeySet(id: string, tokenStore: TokenStore): Promise<ApiKeySetJson>;
78
78
  }
79
+ //# sourceMappingURL=adminInterface.d.ts.map
@@ -141,3 +141,4 @@ export declare class StackClientInterface {
141
141
  createProject(project: Pick<ProjectJson, "displayName" | "description">, tokenStore: TokenStore): Promise<ProjectJson>;
142
142
  }
143
143
  export declare function getProductionModeErrors(project: ProjectJson): ProductionModeError[];
144
+ //# sourceMappingURL=clientInterface.d.ts.map
@@ -28,3 +28,4 @@ export declare class StackServerInterface extends StackClientInterface {
28
28
  setServerUserCustomizableData(userId: string, update: Partial<ServerUserCustomizableJson>): Promise<void>;
29
29
  deleteServerUser(userId: string): Promise<void>;
30
30
  }
31
+ //# sourceMappingURL=serverInterface.d.ts.map
@@ -1,10 +1,11 @@
1
1
  export declare function typedIncludes<T extends readonly any[]>(arr: T, item: unknown): item is T[number];
2
2
  export declare function enumerate<T extends readonly any[]>(arr: T): [number, T[number]][];
3
3
  export declare function isShallowEqual(a: readonly any[], b: readonly any[]): boolean;
4
- export declare function groupBy<T extends readonly any[], K>(arr: T, key: (item: T[number]) => K): Map<K, T[number][]>;
4
+ export declare function groupBy<T extends any, K>(arr: Iterable<T>, key: (item: T) => K): Map<K, T[]>;
5
5
  export declare function range(endExclusive: number): number[];
6
6
  export declare function range(startInclusive: number, endExclusive: number): number[];
7
7
  export declare function range(startInclusive: number, endExclusive: number, step: number): number[];
8
8
  export declare function rotateLeft(arr: readonly any[], n: number): any[];
9
9
  export declare function rotateRight(arr: readonly any[], n: number): any[];
10
10
  export declare function shuffle<T>(arr: readonly T[]): T[];
11
+ //# sourceMappingURL=arrays.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../src/utils/arrays.tsx"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,CAEhG;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAEjF;AAED,wB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CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAEjF;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,CAAC,EAAE,SAAS,GAAG,EAAE,GAAG,OAAO,CAM5E;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC,EACtC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAChB,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAClB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAQb;AAGD,wBAAgB,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AACtD,wBAAgB,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AAC9E,wBAAgB,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AAgB5F,wBAAgB,UAAU,CAAC,GAAG,EAAE,SAAS,GAAG,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE,CAGhE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE,CAEjE;AAGD,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAOjD"}
@@ -1,2 +1,3 @@
1
1
  export declare function encodeBase32(input: Uint8Array): string;
2
2
  export declare function decodeBase32(input: string): Uint8Array;
3
+ //# sourceMappingURL=bytes.d.ts.map
@@ -79,3 +79,4 @@ declare class AsyncValueCache<T> {
79
79
  };
80
80
  }
81
81
  export {};
82
+ //# sourceMappingURL=caches.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare function generateSecureRandomString(minBitsOfEntropy?: number): string;
2
+ //# sourceMappingURL=crypto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/utils/crypto.tsx"],"names":[],"mappings":"AAMA,wBAAgB,0BAA0B,CAAC,gBAAgB,GAAE,MAAY,UAGxE"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/utils/crypto.tsx"],"names":[],"mappings":"AAGA,wBAAgB,0BAA0B,CAAC,gBAAgB,GAAE,MAAY,UAMxE"}
@@ -1,9 +1,9 @@
1
1
  import crypto from "node:crypto";
2
2
  import { encodeBase32 } from "./bytes";
3
- const characters = "23456789abcdefghjkmnopqrstuvwxyz";
4
- if (characters.length !== 32)
5
- throw new Error("Invalid characters length");
6
3
  export function generateSecureRandomString(minBitsOfEntropy = 224) {
7
- const randomBytes = crypto.randomBytes(Math.ceil(minBitsOfEntropy / 8));
8
- return encodeBase32(randomBytes).toLowerCase();
4
+ const base32CharactersCount = Math.ceil(minBitsOfEntropy / 5);
5
+ const bytesCount = Math.ceil(base32CharactersCount * 5 / 8);
6
+ const randomBytes = crypto.randomBytes(bytesCount);
7
+ const str = encodeBase32(randomBytes);
8
+ return str.slice(str.length - base32CharactersCount).toLowerCase();
9
9
  }
@@ -10,3 +10,4 @@ export declare function fromNowDetailed(date: Date): {
10
10
  * Returns a string representation of the given date in the format expected by the `datetime-local` input type.
11
11
  */
12
12
  export declare function getInputDatetimeLocalString(date: Date): string;
13
+ //# sourceMappingURL=dates.d.ts.map
@@ -2,3 +2,4 @@
2
2
  * https://n2d4.github.io/frontend-starter/guides/advanced-concepts#clickable-parents
3
3
  */
4
4
  export declare function hasClickableParent(element: HTMLElement): boolean;
5
+ //# sourceMappingURL=dom.d.ts.map
@@ -2,3 +2,4 @@
2
2
  * Returns the environment variable with the given name, throwing an error if it's undefined or the empty string.
3
3
  */
4
4
  export declare function getEnvVariable(name: string): string;
5
+ //# sourceMappingURL=env.d.ts.map
@@ -9,12 +9,12 @@ type StatusErrorConstructorParameters = [
9
9
  statusCode: number | Status,
10
10
  message?: string,
11
11
  options?: {
12
- headers: Record<string, string>;
12
+ headers: Record<string, string[]>;
13
13
  }
14
14
  ];
15
15
  export declare class StatusError extends Error {
16
16
  readonly options?: {
17
- headers: Record<string, string>;
17
+ headers: Record<string, string[]>;
18
18
  } | undefined;
19
19
  readonly statusCode: number;
20
20
  static BadRequest: {
@@ -182,3 +182,4 @@ export declare class StatusError extends Error {
182
182
  isServerError(): boolean;
183
183
  }
184
184
  export {};
185
+ //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC;AACtD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;AAC9C,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,gCAAgC,GAAG,KAAK,CAAC;AAY3E,KAAK,MAAM,GAAG;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,gCAAgC,GAAG;IACtC,UAAU,EAAE,MAAM,GAAG,MAAM;IAC3B,OAAO,CAAC,EAAE,MAAM;IAChB,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE;CAC9C,CAAC;AAEF,qBAAa,WAAY,SAAQ,KAAK;aA+CmC,OAAO,CAAC;iBAAa,OAAO,MAAM,EAAE,MAAM,CAAC;;IA9ClH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC,OAAc,UAAU;;;MAA+C;IACvE,OAAc,YAAY;;;MAAgD;IAC1E,OAAc,eAAe;;;MAAoD;IACjF,OAAc,SAAS;;;MAA6C;IACpE,OAAc,QAAQ;;;MAA6C;IACnE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gBAAgB;;;MAAqD;IACnF,OAAc,QAAQ;;;MAA6C;IACnE,OAAc,eAAe;;;MAAoD;IACjF,OAAc,oBAAoB;;;MAAyD;IAC3F,OAAc,eAAe;;;MAAqD;IAClF,OAAc,2BAA2B;;;MAAmE;IAC5G,OAAc,0BAA0B;;;MAAiE;IAEzG,OAAc,mBAAmB;;;MAAyD;IAC1F,OAAc,cAAc;;;MAAmD;IAC/E,OAAc,UAAU;;;MAA+C;IACvE,OAAc,kBAAkB;;;MAAuD;IACvF,OAAc,cAAc;;;MAAmD;IAC/E,OAAc,uBAAuB;;;MAA8D;IACnG,OAAc,qBAAqB;;;MAA2D;IAC9F,OAAc,mBAAmB;;;MAAwD;IACzF,OAAc,YAAY;;;MAAiD;IAC3E,OAAc,WAAW;;;MAAgD;IACzE,OAAc,6BAA6B;;;MAAmE;gBAGlG,GAAG,IAAI,EAAE,gCAAgC;IAW9C,aAAa;IAIb,aAAa;CAGrB"}
@@ -1,2 +1,3 @@
1
1
  export declare function escapeHtml(unsafe: string): string;
2
2
  export declare function html(strings: TemplateStringsArray, ...values: any[]): string;
3
+ //# sourceMappingURL=html.d.ts.map
@@ -8,3 +8,4 @@ export type ReadonlyJson = null | boolean | number | string | readonly ReadonlyJ
8
8
  export declare function isJson(value: unknown): value is Json;
9
9
  export declare function parseJson(json: string): Result<Json>;
10
10
  export declare function stringifyJson(json: Json): Result<string>;
11
+ //# sourceMappingURL=json.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import * as jose from "jose";
2
2
  export declare function encryptJWT(payload: any, expirationTime?: string): Promise<string>;
3
3
  export declare function decryptJWT(jwt: string): Promise<jose.JWTPayload>;
4
+ //# sourceMappingURL=jwt.d.ts.map
@@ -21,3 +21,4 @@ export declare class DependenciesMap<K extends any[], V> {
21
21
  clear(): void;
22
22
  [Symbol.toStringTag]: string;
23
23
  }
24
+ //# sourceMappingURL=maps.d.ts.map
@@ -2,3 +2,4 @@
2
2
  * Similar to the modulo operator, but always returns a positive number (even when the input is negative).
3
3
  */
4
4
  export declare function remainder(n: number, d: number): number;
5
+ //# sourceMappingURL=math.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export declare function prettyPrintWithMagnitudes(num: number): string;
2
2
  export declare function toFixedMax(num: number, maxDecimals: number): string;
3
+ //# sourceMappingURL=numbers.d.ts.map
@@ -1,3 +1,6 @@
1
+ export type DeepPartial<T> = T extends object ? {
2
+ [P in keyof T]?: DeepPartial<T[P]>;
3
+ } : T;
1
4
  /**
2
5
  * Assumes both objects are primitives, arrays, or non-function plain objects, and compares them deeply.
3
6
  *
@@ -16,3 +19,4 @@ export declare function typedAssign<T extends {}, U extends {}>(target: T, sourc
16
19
  export declare function filterUndefined<T extends {}>(obj: T): {
17
20
  [k in keyof T]+?: T[k] & ({} | null);
18
21
  };
22
+ //# sourceMappingURL=objects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"objects.d.ts","sourceRoot":"","sources":["../../src/utils/objects.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,CAAC,CAgCpE;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAE1E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAE3F;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAE3D;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,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E3D;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAE9D;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAErG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;CAAE,CAE9F"}
@@ -1,2 +1,3 @@
1
1
  export declare function hashPassword(password: string): Promise<string>;
2
2
  export declare function comparePassword(password: string, hash: string): Promise<boolean>;
3
+ //# sourceMappingURL=password.d.ts.map
@@ -48,3 +48,4 @@ export type RateLimitOptions = {
48
48
  export declare function rateLimited<T>(func: () => Promise<T>, options: RateLimitOptions): () => Promise<T>;
49
49
  export declare function throttled<T, A extends any[]>(func: (...args: A) => Promise<T>, delayMs: number): (...args: A) => Promise<T>;
50
50
  export {};
51
+ //# sourceMappingURL=promises.d.ts.map
@@ -10,3 +10,4 @@ export declare function suspend(): never;
10
10
  * Use this in a component or a hook to disable SSR. Should be wrapped in a Suspense boundary, or it will throw an error.
11
11
  */
12
12
  export declare function suspendIfSsr(caller?: string): void;
13
+ //# sourceMappingURL=react.d.ts.map
@@ -71,3 +71,4 @@ declare function retry<T>(fn: () => Result<T> | Promise<Result<T>>, retries: num
71
71
  exponentialDelayBase?: number | undefined;
72
72
  }): Promise<Result<T, RetryError>>;
73
73
  export {};
74
+ //# sourceMappingURL=results.d.ts.map
@@ -55,3 +55,4 @@ export declare class AsyncStore<T> implements ReadonlyAsyncStore<T> {
55
55
  unsubscribe: () => void;
56
56
  };
57
57
  }
58
+ //# sourceMappingURL=stores.d.ts.map
@@ -38,3 +38,4 @@ export declare function trimLines(s: string): string;
38
38
  export declare function templateIdentity(strings: TemplateStringsArray | readonly string[], ...values: any[]): string;
39
39
  export declare function deindent(code: string): string;
40
40
  export declare function deindent(strings: TemplateStringsArray | readonly string[], ...values: any[]): string;
41
+ //# sourceMappingURL=strings.d.ts.map
@@ -28,3 +28,4 @@ export declare class KnownError extends StatusError {
28
28
  readonly errorCode: KnownErrorCode;
29
29
  constructor(errorCode: KnownErrorCode);
30
30
  }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -53,7 +53,7 @@ export class KnownError extends StatusError {
53
53
  error_code: errorCode,
54
54
  }), {
55
55
  headers: {
56
- "content-type": "application/json",
56
+ "content-type": ["application/json"],
57
57
  },
58
58
  });
59
59
  this.errorCode = errorCode;
@@ -1 +1,2 @@
1
1
  export declare function generateUuid(): string;
2
+ //# sourceMappingURL=uuids.d.ts.map
package/package.json CHANGED
@@ -1,18 +1,13 @@
1
1
  {
2
2
  "name": "@stackframe/stack-shared",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "peerDependencies": {
10
- "react": "^18.2.0"
11
- },
12
- "peerDependenciesMeta": {
13
- "react": {
14
- "optional": true
15
- }
10
+ "react": "^18.2"
16
11
  },
17
12
  "dependencies": {
18
13
  "bcrypt": "^5.1.1",
@@ -22,14 +17,8 @@
22
17
  },
23
18
  "devDependencies": {
24
19
  "@types/bcrypt": "^5.0.2",
25
- "@types/react": "^18.2.60",
26
- "@types/uuid": "^9.0.8",
27
- "@typescript-eslint/eslint-plugin": "^6",
28
- "@typescript-eslint/parser": "^6.x",
29
- "eslint": "^8",
30
- "eslint-config-next": "^14",
31
- "rimraf": "^5.0.5",
32
- "react": "^18.2.0"
20
+ "@types/react": "^18.2.66",
21
+ "@types/uuid": "^9.0.8"
33
22
  },
34
23
  "scripts": {
35
24
  "build": "tsc",