@softr/sdk 0.0.16 → 0.0.18

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.
@@ -68,7 +68,7 @@ const getSoftrContext = createServerFn({ method: "GET" }).handler(async () => {
68
68
  function initialSoftrContext() {
69
69
  return {
70
70
  user: null,
71
- permissions: { datasource: {} }
71
+ permissions: { datasources: {} }
72
72
  };
73
73
  }
74
74
  /**
@@ -105,7 +105,7 @@ function useCurrentUser() {
105
105
  function usePermissions(datasourceId) {
106
106
  return useRouteContext({
107
107
  from: rootRouteId,
108
- select: (context) => requireDefined(context.permissions.datasource[datasourceId], `the application has no datasource "${datasourceId}"`)
108
+ select: (context) => requireDefined(context.permissions.datasources[datasourceId], `the application has no datasource "${datasourceId}"`)
109
109
  });
110
110
  }
111
111
 
@@ -11,7 +11,7 @@ import { z } from "zod";
11
11
  */
12
12
  type Permissions = {
13
13
  /** Keyed by datasource id. */
14
- datasource: Record<string, DatasourcePermissions>;
14
+ datasources: Record<string, DatasourcePermissions>;
15
15
  };
16
16
  //#endregion
17
17
  export { Permissions };
@@ -7,7 +7,7 @@ const datasourcePermissionsSchema = z.object({
7
7
  update: z.boolean(),
8
8
  delete: z.boolean()
9
9
  });
10
- const permissionsSchema = z.object({ datasource: z.record(z.string(), datasourcePermissionsSchema) });
10
+ const permissionsSchema = z.object({ datasources: z.record(z.string(), datasourcePermissionsSchema) });
11
11
 
12
12
  //#endregion
13
13
  export { permissionsSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softr/sdk",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: core
12
12
  library: softr-sdk
13
- library_version: 0.0.16
13
+ library_version: 0.0.17
14
14
  ---
15
15
 
16
16
  # Softr SDK core
@@ -105,7 +105,7 @@ export function getRouter() {
105
105
  ```ts
106
106
  type SoftrContext = {
107
107
  user: User | null // null means signed out
108
- permissions: { datasource: Record<string, DatasourcePermissions> }
108
+ permissions: { datasources: Record<string, DatasourcePermissions> }
109
109
  }
110
110
 
111
111
  type User = {
@@ -118,4 +118,4 @@ type User = {
118
118
 
119
119
  ## Version
120
120
 
121
- Targets `@softr/sdk` v0.0.15.
121
+ Targets `@softr/sdk` v0.0.17.
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 0.0.16
13
+ library_version: 0.0.17
14
14
  ---
15
15
 
16
16
  This skill builds on softr-sdk. Read it first for the entrypoints and the client/server boundary.
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 0.0.16
13
+ library_version: 0.0.17
14
14
  ---
15
15
 
16
16
  This skill builds on softr-sdk. Read it first for the entrypoints and the wiring that puts a visitor on route context.
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 0.0.16
13
+ library_version: 0.0.17
14
14
  ---
15
15
 
16
16
  This skill builds on softr-sdk. Read it first for the entrypoints and the client/server boundary.
@@ -12,7 +12,7 @@ description: >-
12
12
  metadata:
13
13
  type: sub-skill
14
14
  library: softr-sdk
15
- library_version: 0.0.16
15
+ library_version: 0.0.17
16
16
  ---
17
17
 
18
18
  This skill builds on softr-sdk. Read it first for the entrypoints and the wiring that puts a visitor on route context.