@palbase/client 0.7.1 → 0.7.2

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
@@ -38,6 +38,7 @@ var import_notifications = require("@palbase/notifications");
38
38
  var import_analytics = require("@palbase/analytics");
39
39
  var import_links = require("@palbase/links");
40
40
  var import_cms = require("@palbase/cms");
41
+ var import_backend_client = require("@palbase/backend-client");
41
42
  function createClient(apiKey, options) {
42
43
  const httpClient = new import_core.HttpClient(apiKey, { url: options?.url, headers: options?.headers });
43
44
  const tokenManager = new import_core.TokenManager();
@@ -55,11 +56,12 @@ function createClient(apiKey, options) {
55
56
  const realtime = new import_realtime.RealtimeClient(httpClient);
56
57
  const functions = new import_functions.FunctionsClient(httpClient);
57
58
  const flags = new import_flags.FlagsClient(httpClient);
58
- const notifications = new import_notifications.NotificationsClient(httpClient);
59
+ const notifications = new import_notifications.ClientNotificationsClient(httpClient);
59
60
  const analytics = new import_analytics.AnalyticsClient(httpClient);
60
61
  const links = new import_links.LinksClient(httpClient);
61
62
  const cms = new import_cms.CmsClient(httpClient);
62
- return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms };
63
+ const backend = new import_backend_client.BackendClient(httpClient);
64
+ return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms, backend };
63
65
  }
64
66
 
65
67
  // src/index.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts"],"sourcesContent":["export { createClient } from './client.js';\nexport type { CreateClientOptions, PalbaseClient } from './client.js';\n\n// Re-export common types\nexport { PalbaseError } from '@palbase/core';\nexport type { PalbaseResponse, PalbaseConfig, Session } from '@palbase/core';\n\n// Re-export module types for convenience\nexport type { User, AuthEvent } from '@palbase/auth';\nexport type { QueryBuilder, GenericSchema } from '@palbase/db';\nexport type { StorageClient, BucketClient, FileObject, TransformOptions } from '@palbase/storage';\nexport type { DocsClient, CollectionRef, DocumentRef, DocumentSnapshot, QuerySnapshot } from '@palbase/docs';\nexport type { RealtimeClient, RealtimeChannel, PresenceState } from '@palbase/realtime';\nexport type { FunctionsClient, InvokeOptions } from '@palbase/functions';\nexport type { FlagsClient, FlagContext, FlagVariant, Flag } from '@palbase/flags';\nexport type { NotificationsClient, RegisterDeviceParams } from '@palbase/notifications';\nexport type { AnalyticsClient, AnalyticsProperties, IdentifyTraits } from '@palbase/analytics';\nexport type { LinksClient, CreateLinkParams, Link, InitialLink } from '@palbase/links';\nexport type { CmsClient, CmsFindOptions, CmsFindOneOptions } from '@palbase/cms';\n","import { HttpClient, TokenManager } from '@palbase/core';\nimport { DatabaseClient } from '@palbase/db';\nimport { AuthClient } from '@palbase/auth';\nimport { StorageClient } from '@palbase/storage';\nimport { DocsClient } from '@palbase/docs';\nimport { RealtimeClient } from '@palbase/realtime';\nimport { FunctionsClient } from '@palbase/functions';\nimport { FlagsClient } from '@palbase/flags';\nimport { NotificationsClient } from '@palbase/notifications';\nimport { AnalyticsClient } from '@palbase/analytics';\nimport { LinksClient } from '@palbase/links';\nimport { CmsClient } from '@palbase/cms';\n\nexport interface CreateClientOptions {\n url?: string;\n headers?: Record<string, string>;\n}\n\nexport interface PalbaseClient<Schema = unknown> {\n auth: AuthClient;\n db: DatabaseClient<Schema>;\n storage: StorageClient;\n docs: DocsClient;\n realtime: RealtimeClient;\n functions: FunctionsClient;\n flags: FlagsClient;\n notifications: NotificationsClient;\n analytics: AnalyticsClient;\n links: LinksClient;\n cms: CmsClient;\n}\n\nexport function createClient<Schema = unknown>(\n apiKey: string,\n options?: CreateClientOptions,\n): PalbaseClient<Schema> {\n const httpClient = new HttpClient(apiKey, { url: options?.url, headers: options?.headers });\n\n const tokenManager = new TokenManager();\n httpClient.tokenManager = tokenManager;\n\n const auth = new AuthClient(httpClient, tokenManager);\n\n // Wire App Check: auth.device token → X-App-Check header on every request\n httpClient.addInterceptor(({ headers }) => {\n const appCheckToken = auth.device.getToken();\n if (appCheckToken) {\n headers['X-App-Check'] = appCheckToken;\n }\n });\n const db = new DatabaseClient<Schema>(httpClient);\n const storage = new StorageClient(httpClient);\n const docs = new DocsClient(httpClient);\n const realtime = new RealtimeClient(httpClient);\n const functions = new FunctionsClient(httpClient);\n const flags = new FlagsClient(httpClient);\n const notifications = new NotificationsClient(httpClient);\n const analytics = new AnalyticsClient(httpClient);\n const links = new LinksClient(httpClient);\n const cms = new CmsClient(httpClient);\n\n return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAyC;AACzC,gBAA+B;AAC/B,kBAA2B;AAC3B,qBAA8B;AAC9B,kBAA2B;AAC3B,sBAA+B;AAC/B,uBAAgC;AAChC,mBAA4B;AAC5B,2BAAoC;AACpC,uBAAgC;AAChC,mBAA4B;AAC5B,iBAA0B;AAqBnB,SAAS,aACd,QACA,SACuB;AACvB,QAAM,aAAa,IAAI,uBAAW,QAAQ,EAAE,KAAK,SAAS,KAAK,SAAS,SAAS,QAAQ,CAAC;AAE1F,QAAM,eAAe,IAAI,yBAAa;AACtC,aAAW,eAAe;AAE1B,QAAM,OAAO,IAAI,uBAAW,YAAY,YAAY;AAGpD,aAAW,eAAe,CAAC,EAAE,QAAQ,MAAM;AACzC,UAAM,gBAAgB,KAAK,OAAO,SAAS;AAC3C,QAAI,eAAe;AACjB,cAAQ,aAAa,IAAI;AAAA,IAC3B;AAAA,EACF,CAAC;AACD,QAAM,KAAK,IAAI,yBAAuB,UAAU;AAChD,QAAM,UAAU,IAAI,6BAAc,UAAU;AAC5C,QAAM,OAAO,IAAI,uBAAW,UAAU;AACtC,QAAM,WAAW,IAAI,+BAAe,UAAU;AAC9C,QAAM,YAAY,IAAI,iCAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,yBAAY,UAAU;AACxC,QAAM,gBAAgB,IAAI,yCAAoB,UAAU;AACxD,QAAM,YAAY,IAAI,iCAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,yBAAY,UAAU;AACxC,QAAM,MAAM,IAAI,qBAAU,UAAU;AAEpC,SAAO,EAAE,MAAM,IAAI,SAAS,MAAM,UAAU,WAAW,OAAO,eAAe,WAAW,OAAO,IAAI;AACrG;;;AD1DA,IAAAA,eAA6B;","names":["import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts"],"sourcesContent":["export { createClient } from './client.js';\nexport type { CreateClientOptions, PalbaseClient } from './client.js';\n\n// Re-export common types\nexport { PalbaseError } from '@palbase/core';\nexport type { PalbaseResponse, PalbaseConfig, Session } from '@palbase/core';\n\n// Re-export module types for convenience\nexport type { User, AuthEvent } from '@palbase/auth';\nexport type { QueryBuilder, GenericSchema } from '@palbase/db';\nexport type { StorageClient, BucketClient, FileObject, TransformOptions } from '@palbase/storage';\nexport type { DocsClient, CollectionRef, DocumentRef, DocumentSnapshot, QuerySnapshot } from '@palbase/docs';\nexport type { RealtimeClient, RealtimeChannel, PresenceState } from '@palbase/realtime';\nexport type { FunctionsClient, InvokeOptions } from '@palbase/functions';\nexport type { FlagsClient, FlagContext, FlagVariant, Flag } from '@palbase/flags';\nexport type {\n ClientNotificationsClient,\n RegisterDeviceParams,\n DevicePlatform,\n DeviceTokenView,\n InboxMessage,\n InboxListOptions,\n InboxListResult,\n PreferenceChannel,\n PreferencesGetResponse,\n PreferencesUpdateParams,\n} from '@palbase/notifications';\nexport type { AnalyticsClient, AnalyticsProperties, IdentifyTraits } from '@palbase/analytics';\nexport type { LinksClient, CreateLinkParams, Link, InitialLink } from '@palbase/links';\nexport type { CmsClient, CmsFindOptions, CmsFindOneOptions } from '@palbase/cms';\nexport type { BackendClient, BackendInvocationBuilder, InvokeOptions as BackendInvokeOptions } from '@palbase/backend-client';\n","import { HttpClient, TokenManager } from '@palbase/core';\nimport { DatabaseClient } from '@palbase/db';\nimport { AuthClient } from '@palbase/auth';\nimport { StorageClient } from '@palbase/storage';\nimport { DocsClient } from '@palbase/docs';\nimport { RealtimeClient } from '@palbase/realtime';\nimport { FunctionsClient } from '@palbase/functions';\nimport { FlagsClient } from '@palbase/flags';\nimport { ClientNotificationsClient } from '@palbase/notifications';\nimport { AnalyticsClient } from '@palbase/analytics';\nimport { LinksClient } from '@palbase/links';\nimport { CmsClient } from '@palbase/cms';\nimport { BackendClient } from '@palbase/backend-client';\n\nexport interface CreateClientOptions {\n url?: string;\n headers?: Record<string, string>;\n}\n\nexport interface PalbaseClient<Schema = unknown> {\n auth: AuthClient;\n db: DatabaseClient<Schema>;\n storage: StorageClient;\n docs: DocsClient;\n realtime: RealtimeClient;\n functions: FunctionsClient;\n flags: FlagsClient;\n notifications: ClientNotificationsClient;\n analytics: AnalyticsClient;\n links: LinksClient;\n cms: CmsClient;\n backend: BackendClient;\n}\n\nexport function createClient<Schema = unknown>(\n apiKey: string,\n options?: CreateClientOptions,\n): PalbaseClient<Schema> {\n const httpClient = new HttpClient(apiKey, { url: options?.url, headers: options?.headers });\n\n const tokenManager = new TokenManager();\n httpClient.tokenManager = tokenManager;\n\n const auth = new AuthClient(httpClient, tokenManager);\n\n // Wire App Check: auth.device token → X-App-Check header on every request\n httpClient.addInterceptor(({ headers }) => {\n const appCheckToken = auth.device.getToken();\n if (appCheckToken) {\n headers['X-App-Check'] = appCheckToken;\n }\n });\n const db = new DatabaseClient<Schema>(httpClient);\n const storage = new StorageClient(httpClient);\n const docs = new DocsClient(httpClient);\n const realtime = new RealtimeClient(httpClient);\n const functions = new FunctionsClient(httpClient);\n const flags = new FlagsClient(httpClient);\n const notifications = new ClientNotificationsClient(httpClient);\n const analytics = new AnalyticsClient(httpClient);\n const links = new LinksClient(httpClient);\n const cms = new CmsClient(httpClient);\n const backend = new BackendClient(httpClient);\n\n return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms, backend };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAyC;AACzC,gBAA+B;AAC/B,kBAA2B;AAC3B,qBAA8B;AAC9B,kBAA2B;AAC3B,sBAA+B;AAC/B,uBAAgC;AAChC,mBAA4B;AAC5B,2BAA0C;AAC1C,uBAAgC;AAChC,mBAA4B;AAC5B,iBAA0B;AAC1B,4BAA8B;AAsBvB,SAAS,aACd,QACA,SACuB;AACvB,QAAM,aAAa,IAAI,uBAAW,QAAQ,EAAE,KAAK,SAAS,KAAK,SAAS,SAAS,QAAQ,CAAC;AAE1F,QAAM,eAAe,IAAI,yBAAa;AACtC,aAAW,eAAe;AAE1B,QAAM,OAAO,IAAI,uBAAW,YAAY,YAAY;AAGpD,aAAW,eAAe,CAAC,EAAE,QAAQ,MAAM;AACzC,UAAM,gBAAgB,KAAK,OAAO,SAAS;AAC3C,QAAI,eAAe;AACjB,cAAQ,aAAa,IAAI;AAAA,IAC3B;AAAA,EACF,CAAC;AACD,QAAM,KAAK,IAAI,yBAAuB,UAAU;AAChD,QAAM,UAAU,IAAI,6BAAc,UAAU;AAC5C,QAAM,OAAO,IAAI,uBAAW,UAAU;AACtC,QAAM,WAAW,IAAI,+BAAe,UAAU;AAC9C,QAAM,YAAY,IAAI,iCAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,yBAAY,UAAU;AACxC,QAAM,gBAAgB,IAAI,+CAA0B,UAAU;AAC9D,QAAM,YAAY,IAAI,iCAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,yBAAY,UAAU;AACxC,QAAM,MAAM,IAAI,qBAAU,UAAU;AACpC,QAAM,UAAU,IAAI,oCAAc,UAAU;AAE5C,SAAO,EAAE,MAAM,IAAI,SAAS,MAAM,UAAU,WAAW,OAAO,eAAe,WAAW,OAAO,KAAK,QAAQ;AAC9G;;;AD7DA,IAAAA,eAA6B;","names":["import_core"]}
package/dist/index.d.cts CHANGED
@@ -12,14 +12,16 @@ import { FunctionsClient } from '@palbase/functions';
12
12
  export { FunctionsClient, InvokeOptions } from '@palbase/functions';
13
13
  import { FlagsClient } from '@palbase/flags';
14
14
  export { Flag, FlagContext, FlagVariant, FlagsClient } from '@palbase/flags';
15
- import { NotificationsClient } from '@palbase/notifications';
16
- export { NotificationsClient, RegisterDeviceParams } from '@palbase/notifications';
15
+ import { ClientNotificationsClient } from '@palbase/notifications';
16
+ export { ClientNotificationsClient, DevicePlatform, DeviceTokenView, InboxListOptions, InboxListResult, InboxMessage, PreferenceChannel, PreferencesGetResponse, PreferencesUpdateParams, RegisterDeviceParams } from '@palbase/notifications';
17
17
  import { AnalyticsClient } from '@palbase/analytics';
18
18
  export { AnalyticsClient, AnalyticsProperties, IdentifyTraits } from '@palbase/analytics';
19
19
  import { LinksClient } from '@palbase/links';
20
20
  export { CreateLinkParams, InitialLink, Link, LinksClient } from '@palbase/links';
21
21
  import { CmsClient } from '@palbase/cms';
22
22
  export { CmsClient, CmsFindOneOptions, CmsFindOptions } from '@palbase/cms';
23
+ import { BackendClient } from '@palbase/backend-client';
24
+ export { BackendClient, BackendInvocationBuilder, InvokeOptions as BackendInvokeOptions } from '@palbase/backend-client';
23
25
  export { PalbaseConfig, PalbaseError, PalbaseResponse, Session } from '@palbase/core';
24
26
 
25
27
  interface CreateClientOptions {
@@ -34,10 +36,11 @@ interface PalbaseClient<Schema = unknown> {
34
36
  realtime: RealtimeClient;
35
37
  functions: FunctionsClient;
36
38
  flags: FlagsClient;
37
- notifications: NotificationsClient;
39
+ notifications: ClientNotificationsClient;
38
40
  analytics: AnalyticsClient;
39
41
  links: LinksClient;
40
42
  cms: CmsClient;
43
+ backend: BackendClient;
41
44
  }
42
45
  declare function createClient<Schema = unknown>(apiKey: string, options?: CreateClientOptions): PalbaseClient<Schema>;
43
46
 
package/dist/index.d.ts CHANGED
@@ -12,14 +12,16 @@ import { FunctionsClient } from '@palbase/functions';
12
12
  export { FunctionsClient, InvokeOptions } from '@palbase/functions';
13
13
  import { FlagsClient } from '@palbase/flags';
14
14
  export { Flag, FlagContext, FlagVariant, FlagsClient } from '@palbase/flags';
15
- import { NotificationsClient } from '@palbase/notifications';
16
- export { NotificationsClient, RegisterDeviceParams } from '@palbase/notifications';
15
+ import { ClientNotificationsClient } from '@palbase/notifications';
16
+ export { ClientNotificationsClient, DevicePlatform, DeviceTokenView, InboxListOptions, InboxListResult, InboxMessage, PreferenceChannel, PreferencesGetResponse, PreferencesUpdateParams, RegisterDeviceParams } from '@palbase/notifications';
17
17
  import { AnalyticsClient } from '@palbase/analytics';
18
18
  export { AnalyticsClient, AnalyticsProperties, IdentifyTraits } from '@palbase/analytics';
19
19
  import { LinksClient } from '@palbase/links';
20
20
  export { CreateLinkParams, InitialLink, Link, LinksClient } from '@palbase/links';
21
21
  import { CmsClient } from '@palbase/cms';
22
22
  export { CmsClient, CmsFindOneOptions, CmsFindOptions } from '@palbase/cms';
23
+ import { BackendClient } from '@palbase/backend-client';
24
+ export { BackendClient, BackendInvocationBuilder, InvokeOptions as BackendInvokeOptions } from '@palbase/backend-client';
23
25
  export { PalbaseConfig, PalbaseError, PalbaseResponse, Session } from '@palbase/core';
24
26
 
25
27
  interface CreateClientOptions {
@@ -34,10 +36,11 @@ interface PalbaseClient<Schema = unknown> {
34
36
  realtime: RealtimeClient;
35
37
  functions: FunctionsClient;
36
38
  flags: FlagsClient;
37
- notifications: NotificationsClient;
39
+ notifications: ClientNotificationsClient;
38
40
  analytics: AnalyticsClient;
39
41
  links: LinksClient;
40
42
  cms: CmsClient;
43
+ backend: BackendClient;
41
44
  }
42
45
  declare function createClient<Schema = unknown>(apiKey: string, options?: CreateClientOptions): PalbaseClient<Schema>;
43
46
 
package/dist/index.js CHANGED
@@ -7,10 +7,11 @@ import { DocsClient } from "@palbase/docs";
7
7
  import { RealtimeClient } from "@palbase/realtime";
8
8
  import { FunctionsClient } from "@palbase/functions";
9
9
  import { FlagsClient } from "@palbase/flags";
10
- import { NotificationsClient } from "@palbase/notifications";
10
+ import { ClientNotificationsClient } from "@palbase/notifications";
11
11
  import { AnalyticsClient } from "@palbase/analytics";
12
12
  import { LinksClient } from "@palbase/links";
13
13
  import { CmsClient } from "@palbase/cms";
14
+ import { BackendClient } from "@palbase/backend-client";
14
15
  function createClient(apiKey, options) {
15
16
  const httpClient = new HttpClient(apiKey, { url: options?.url, headers: options?.headers });
16
17
  const tokenManager = new TokenManager();
@@ -28,11 +29,12 @@ function createClient(apiKey, options) {
28
29
  const realtime = new RealtimeClient(httpClient);
29
30
  const functions = new FunctionsClient(httpClient);
30
31
  const flags = new FlagsClient(httpClient);
31
- const notifications = new NotificationsClient(httpClient);
32
+ const notifications = new ClientNotificationsClient(httpClient);
32
33
  const analytics = new AnalyticsClient(httpClient);
33
34
  const links = new LinksClient(httpClient);
34
35
  const cms = new CmsClient(httpClient);
35
- return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms };
36
+ const backend = new BackendClient(httpClient);
37
+ return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms, backend };
36
38
  }
37
39
 
38
40
  // src/index.ts
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/index.ts"],"sourcesContent":["import { HttpClient, TokenManager } from '@palbase/core';\nimport { DatabaseClient } from '@palbase/db';\nimport { AuthClient } from '@palbase/auth';\nimport { StorageClient } from '@palbase/storage';\nimport { DocsClient } from '@palbase/docs';\nimport { RealtimeClient } from '@palbase/realtime';\nimport { FunctionsClient } from '@palbase/functions';\nimport { FlagsClient } from '@palbase/flags';\nimport { NotificationsClient } from '@palbase/notifications';\nimport { AnalyticsClient } from '@palbase/analytics';\nimport { LinksClient } from '@palbase/links';\nimport { CmsClient } from '@palbase/cms';\n\nexport interface CreateClientOptions {\n url?: string;\n headers?: Record<string, string>;\n}\n\nexport interface PalbaseClient<Schema = unknown> {\n auth: AuthClient;\n db: DatabaseClient<Schema>;\n storage: StorageClient;\n docs: DocsClient;\n realtime: RealtimeClient;\n functions: FunctionsClient;\n flags: FlagsClient;\n notifications: NotificationsClient;\n analytics: AnalyticsClient;\n links: LinksClient;\n cms: CmsClient;\n}\n\nexport function createClient<Schema = unknown>(\n apiKey: string,\n options?: CreateClientOptions,\n): PalbaseClient<Schema> {\n const httpClient = new HttpClient(apiKey, { url: options?.url, headers: options?.headers });\n\n const tokenManager = new TokenManager();\n httpClient.tokenManager = tokenManager;\n\n const auth = new AuthClient(httpClient, tokenManager);\n\n // Wire App Check: auth.device token → X-App-Check header on every request\n httpClient.addInterceptor(({ headers }) => {\n const appCheckToken = auth.device.getToken();\n if (appCheckToken) {\n headers['X-App-Check'] = appCheckToken;\n }\n });\n const db = new DatabaseClient<Schema>(httpClient);\n const storage = new StorageClient(httpClient);\n const docs = new DocsClient(httpClient);\n const realtime = new RealtimeClient(httpClient);\n const functions = new FunctionsClient(httpClient);\n const flags = new FlagsClient(httpClient);\n const notifications = new NotificationsClient(httpClient);\n const analytics = new AnalyticsClient(httpClient);\n const links = new LinksClient(httpClient);\n const cms = new CmsClient(httpClient);\n\n return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms };\n}\n","export { createClient } from './client.js';\nexport type { CreateClientOptions, PalbaseClient } from './client.js';\n\n// Re-export common types\nexport { PalbaseError } from '@palbase/core';\nexport type { PalbaseResponse, PalbaseConfig, Session } from '@palbase/core';\n\n// Re-export module types for convenience\nexport type { User, AuthEvent } from '@palbase/auth';\nexport type { QueryBuilder, GenericSchema } from '@palbase/db';\nexport type { StorageClient, BucketClient, FileObject, TransformOptions } from '@palbase/storage';\nexport type { DocsClient, CollectionRef, DocumentRef, DocumentSnapshot, QuerySnapshot } from '@palbase/docs';\nexport type { RealtimeClient, RealtimeChannel, PresenceState } from '@palbase/realtime';\nexport type { FunctionsClient, InvokeOptions } from '@palbase/functions';\nexport type { FlagsClient, FlagContext, FlagVariant, Flag } from '@palbase/flags';\nexport type { NotificationsClient, RegisterDeviceParams } from '@palbase/notifications';\nexport type { AnalyticsClient, AnalyticsProperties, IdentifyTraits } from '@palbase/analytics';\nexport type { LinksClient, CreateLinkParams, Link, InitialLink } from '@palbase/links';\nexport type { CmsClient, CmsFindOptions, CmsFindOneOptions } from '@palbase/cms';\n"],"mappings":";AAAA,SAAS,YAAY,oBAAoB;AACzC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAqBnB,SAAS,aACd,QACA,SACuB;AACvB,QAAM,aAAa,IAAI,WAAW,QAAQ,EAAE,KAAK,SAAS,KAAK,SAAS,SAAS,QAAQ,CAAC;AAE1F,QAAM,eAAe,IAAI,aAAa;AACtC,aAAW,eAAe;AAE1B,QAAM,OAAO,IAAI,WAAW,YAAY,YAAY;AAGpD,aAAW,eAAe,CAAC,EAAE,QAAQ,MAAM;AACzC,UAAM,gBAAgB,KAAK,OAAO,SAAS;AAC3C,QAAI,eAAe;AACjB,cAAQ,aAAa,IAAI;AAAA,IAC3B;AAAA,EACF,CAAC;AACD,QAAM,KAAK,IAAI,eAAuB,UAAU;AAChD,QAAM,UAAU,IAAI,cAAc,UAAU;AAC5C,QAAM,OAAO,IAAI,WAAW,UAAU;AACtC,QAAM,WAAW,IAAI,eAAe,UAAU;AAC9C,QAAM,YAAY,IAAI,gBAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,YAAY,UAAU;AACxC,QAAM,gBAAgB,IAAI,oBAAoB,UAAU;AACxD,QAAM,YAAY,IAAI,gBAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,YAAY,UAAU;AACxC,QAAM,MAAM,IAAI,UAAU,UAAU;AAEpC,SAAO,EAAE,MAAM,IAAI,SAAS,MAAM,UAAU,WAAW,OAAO,eAAe,WAAW,OAAO,IAAI;AACrG;;;AC1DA,SAAS,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../src/client.ts","../src/index.ts"],"sourcesContent":["import { HttpClient, TokenManager } from '@palbase/core';\nimport { DatabaseClient } from '@palbase/db';\nimport { AuthClient } from '@palbase/auth';\nimport { StorageClient } from '@palbase/storage';\nimport { DocsClient } from '@palbase/docs';\nimport { RealtimeClient } from '@palbase/realtime';\nimport { FunctionsClient } from '@palbase/functions';\nimport { FlagsClient } from '@palbase/flags';\nimport { ClientNotificationsClient } from '@palbase/notifications';\nimport { AnalyticsClient } from '@palbase/analytics';\nimport { LinksClient } from '@palbase/links';\nimport { CmsClient } from '@palbase/cms';\nimport { BackendClient } from '@palbase/backend-client';\n\nexport interface CreateClientOptions {\n url?: string;\n headers?: Record<string, string>;\n}\n\nexport interface PalbaseClient<Schema = unknown> {\n auth: AuthClient;\n db: DatabaseClient<Schema>;\n storage: StorageClient;\n docs: DocsClient;\n realtime: RealtimeClient;\n functions: FunctionsClient;\n flags: FlagsClient;\n notifications: ClientNotificationsClient;\n analytics: AnalyticsClient;\n links: LinksClient;\n cms: CmsClient;\n backend: BackendClient;\n}\n\nexport function createClient<Schema = unknown>(\n apiKey: string,\n options?: CreateClientOptions,\n): PalbaseClient<Schema> {\n const httpClient = new HttpClient(apiKey, { url: options?.url, headers: options?.headers });\n\n const tokenManager = new TokenManager();\n httpClient.tokenManager = tokenManager;\n\n const auth = new AuthClient(httpClient, tokenManager);\n\n // Wire App Check: auth.device token → X-App-Check header on every request\n httpClient.addInterceptor(({ headers }) => {\n const appCheckToken = auth.device.getToken();\n if (appCheckToken) {\n headers['X-App-Check'] = appCheckToken;\n }\n });\n const db = new DatabaseClient<Schema>(httpClient);\n const storage = new StorageClient(httpClient);\n const docs = new DocsClient(httpClient);\n const realtime = new RealtimeClient(httpClient);\n const functions = new FunctionsClient(httpClient);\n const flags = new FlagsClient(httpClient);\n const notifications = new ClientNotificationsClient(httpClient);\n const analytics = new AnalyticsClient(httpClient);\n const links = new LinksClient(httpClient);\n const cms = new CmsClient(httpClient);\n const backend = new BackendClient(httpClient);\n\n return { auth, db, storage, docs, realtime, functions, flags, notifications, analytics, links, cms, backend };\n}\n","export { createClient } from './client.js';\nexport type { CreateClientOptions, PalbaseClient } from './client.js';\n\n// Re-export common types\nexport { PalbaseError } from '@palbase/core';\nexport type { PalbaseResponse, PalbaseConfig, Session } from '@palbase/core';\n\n// Re-export module types for convenience\nexport type { User, AuthEvent } from '@palbase/auth';\nexport type { QueryBuilder, GenericSchema } from '@palbase/db';\nexport type { StorageClient, BucketClient, FileObject, TransformOptions } from '@palbase/storage';\nexport type { DocsClient, CollectionRef, DocumentRef, DocumentSnapshot, QuerySnapshot } from '@palbase/docs';\nexport type { RealtimeClient, RealtimeChannel, PresenceState } from '@palbase/realtime';\nexport type { FunctionsClient, InvokeOptions } from '@palbase/functions';\nexport type { FlagsClient, FlagContext, FlagVariant, Flag } from '@palbase/flags';\nexport type {\n ClientNotificationsClient,\n RegisterDeviceParams,\n DevicePlatform,\n DeviceTokenView,\n InboxMessage,\n InboxListOptions,\n InboxListResult,\n PreferenceChannel,\n PreferencesGetResponse,\n PreferencesUpdateParams,\n} from '@palbase/notifications';\nexport type { AnalyticsClient, AnalyticsProperties, IdentifyTraits } from '@palbase/analytics';\nexport type { LinksClient, CreateLinkParams, Link, InitialLink } from '@palbase/links';\nexport type { CmsClient, CmsFindOptions, CmsFindOneOptions } from '@palbase/cms';\nexport type { BackendClient, BackendInvocationBuilder, InvokeOptions as BackendInvokeOptions } from '@palbase/backend-client';\n"],"mappings":";AAAA,SAAS,YAAY,oBAAoB;AACzC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAsBvB,SAAS,aACd,QACA,SACuB;AACvB,QAAM,aAAa,IAAI,WAAW,QAAQ,EAAE,KAAK,SAAS,KAAK,SAAS,SAAS,QAAQ,CAAC;AAE1F,QAAM,eAAe,IAAI,aAAa;AACtC,aAAW,eAAe;AAE1B,QAAM,OAAO,IAAI,WAAW,YAAY,YAAY;AAGpD,aAAW,eAAe,CAAC,EAAE,QAAQ,MAAM;AACzC,UAAM,gBAAgB,KAAK,OAAO,SAAS;AAC3C,QAAI,eAAe;AACjB,cAAQ,aAAa,IAAI;AAAA,IAC3B;AAAA,EACF,CAAC;AACD,QAAM,KAAK,IAAI,eAAuB,UAAU;AAChD,QAAM,UAAU,IAAI,cAAc,UAAU;AAC5C,QAAM,OAAO,IAAI,WAAW,UAAU;AACtC,QAAM,WAAW,IAAI,eAAe,UAAU;AAC9C,QAAM,YAAY,IAAI,gBAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,YAAY,UAAU;AACxC,QAAM,gBAAgB,IAAI,0BAA0B,UAAU;AAC9D,QAAM,YAAY,IAAI,gBAAgB,UAAU;AAChD,QAAM,QAAQ,IAAI,YAAY,UAAU;AACxC,QAAM,MAAM,IAAI,UAAU,UAAU;AACpC,QAAM,UAAU,IAAI,cAAc,UAAU;AAE5C,SAAO,EAAE,MAAM,IAAI,SAAS,MAAM,UAAU,WAAW,OAAO,eAAe,WAAW,OAAO,KAAK,QAAQ;AAC9G;;;AC7DA,SAAS,oBAAoB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palbase/client",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Palbase client SDK — browser/mobile client for auth, database, storage, and more",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,18 +29,19 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@palbase/auth": "^0.7.0",
33
- "@palbase/cms": "^0.7.0",
34
- "@palbase/core": "^0.7.0",
35
- "@palbase/analytics": "^0.7.0",
36
- "@palbase/db": "^0.8.0",
37
- "@palbase/flags": "^0.7.0",
38
- "@palbase/functions": "^0.7.0",
39
- "@palbase/docs": "^0.7.0",
40
- "@palbase/notifications": "^0.7.0",
41
- "@palbase/realtime": "^0.7.0",
42
- "@palbase/links": "^0.7.0",
43
- "@palbase/storage": "^0.7.0"
32
+ "@palbase/analytics": "^0.7.1",
33
+ "@palbase/auth": "^0.7.1",
34
+ "@palbase/backend-client": "^0.7.1",
35
+ "@palbase/cms": "^0.7.1",
36
+ "@palbase/core": "^0.9.0",
37
+ "@palbase/db": "^0.8.1",
38
+ "@palbase/docs": "^0.7.1",
39
+ "@palbase/flags": "^0.7.1",
40
+ "@palbase/functions": "^0.7.1",
41
+ "@palbase/links": "^0.7.1",
42
+ "@palbase/notifications": "^0.7.1",
43
+ "@palbase/realtime": "^0.7.1",
44
+ "@palbase/storage": "^0.7.1"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@biomejs/biome": "^2.0.0",