@squadbase/server 0.0.3-beta.2 → 0.0.3-beta.4

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/dist/index.cjs CHANGED
@@ -32,7 +32,6 @@ var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
32
32
  var PREVIEW_SESSION_COOKIE_NAME = "squadbase-preview-session";
33
33
  var APP_BASE_DOMAIN = "squadbase.app";
34
34
  var PREVIEW_BASE_DOMAIN = "preview.app.squadbase.dev";
35
- var PROJECT_ID_ENV_NAME = "INTERNAL_SQUADBASE_PROJECT_ID";
36
35
  var SANDBOX_ID_ENV_NAME = "INTERNAL_SQUADBASE_SANDBOX_ID";
37
36
 
38
37
  // ../../node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.mjs
@@ -4133,15 +4132,6 @@ var ServerClient = class {
4133
4132
  const user = zUser.parse(body);
4134
4133
  return user;
4135
4134
  }
4136
- get projectIdOrThrow() {
4137
- const projectId = this.options.projectId ?? process.env[PROJECT_ID_ENV_NAME];
4138
- if (!projectId) {
4139
- throw new Error(
4140
- `Project ID is required. Please provide projectId in ServerClient options if you are running in local development environment.`
4141
- );
4142
- }
4143
- return projectId;
4144
- }
4145
4135
  get sandboxIdOrThrow() {
4146
4136
  const sandboxId = process.env[SANDBOX_ID_ENV_NAME];
4147
4137
  if (!sandboxId) {
@@ -4153,7 +4143,7 @@ var ServerClient = class {
4153
4143
  }
4154
4144
  getUserWithAppSessionRequest(appSessionToken) {
4155
4145
  return new Request(
4156
- `https://${this.projectIdOrThrow}.${this.options._internal?.app_base_domain ?? APP_BASE_DOMAIN}/_sqcore/auth`,
4146
+ `https://${this.options.projectId}.${this.options._internal?.app_base_domain ?? APP_BASE_DOMAIN}/_sqcore/auth`,
4157
4147
  {
4158
4148
  method: "POST",
4159
4149
  headers: {
package/dist/index.d.cts CHANGED
@@ -26,7 +26,7 @@ type User = z.infer<typeof zUser>;
26
26
 
27
27
  type GetCookie = () => Promise<string | undefined> | string | undefined;
28
28
  type ServerClientOptions = {
29
- projectId?: string;
29
+ projectId: string;
30
30
  cookieOptions: {
31
31
  getCookie: GetCookie;
32
32
  };
@@ -47,7 +47,6 @@ declare class ServerClient {
47
47
  iconUrl: string | null;
48
48
  roles: string[];
49
49
  }>;
50
- private get projectIdOrThrow();
51
50
  private get sandboxIdOrThrow();
52
51
  private getUserWithAppSessionRequest;
53
52
  private getUserWithPreviewSession;
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ type User = z.infer<typeof zUser>;
26
26
 
27
27
  type GetCookie = () => Promise<string | undefined> | string | undefined;
28
28
  type ServerClientOptions = {
29
- projectId?: string;
29
+ projectId: string;
30
30
  cookieOptions: {
31
31
  getCookie: GetCookie;
32
32
  };
@@ -47,7 +47,6 @@ declare class ServerClient {
47
47
  iconUrl: string | null;
48
48
  roles: string[];
49
49
  }>;
50
- private get projectIdOrThrow();
51
50
  private get sandboxIdOrThrow();
52
51
  private getUserWithAppSessionRequest;
53
52
  private getUserWithPreviewSession;
package/dist/index.js CHANGED
@@ -6,7 +6,6 @@ var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
6
6
  var PREVIEW_SESSION_COOKIE_NAME = "squadbase-preview-session";
7
7
  var APP_BASE_DOMAIN = "squadbase.app";
8
8
  var PREVIEW_BASE_DOMAIN = "preview.app.squadbase.dev";
9
- var PROJECT_ID_ENV_NAME = "INTERNAL_SQUADBASE_PROJECT_ID";
10
9
  var SANDBOX_ID_ENV_NAME = "INTERNAL_SQUADBASE_SANDBOX_ID";
11
10
 
12
11
  // ../../node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.mjs
@@ -4107,15 +4106,6 @@ var ServerClient = class {
4107
4106
  const user = zUser.parse(body);
4108
4107
  return user;
4109
4108
  }
4110
- get projectIdOrThrow() {
4111
- const projectId = this.options.projectId ?? process.env[PROJECT_ID_ENV_NAME];
4112
- if (!projectId) {
4113
- throw new Error(
4114
- `Project ID is required. Please provide projectId in ServerClient options if you are running in local development environment.`
4115
- );
4116
- }
4117
- return projectId;
4118
- }
4119
4109
  get sandboxIdOrThrow() {
4120
4110
  const sandboxId = process.env[SANDBOX_ID_ENV_NAME];
4121
4111
  if (!sandboxId) {
@@ -4127,7 +4117,7 @@ var ServerClient = class {
4127
4117
  }
4128
4118
  getUserWithAppSessionRequest(appSessionToken) {
4129
4119
  return new Request(
4130
- `https://${this.projectIdOrThrow}.${this.options._internal?.app_base_domain ?? APP_BASE_DOMAIN}/_sqcore/auth`,
4120
+ `https://${this.options.projectId}.${this.options._internal?.app_base_domain ?? APP_BASE_DOMAIN}/_sqcore/auth`,
4131
4121
  {
4132
4122
  method: "POST",
4133
4123
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squadbase/server",
3
- "version": "0.0.3-beta.2",
3
+ "version": "0.0.3-beta.4",
4
4
  "description": "Server-side SDK for Squadbase",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",