@rebasepro/server-core 0.0.1-canary.f81da60 → 0.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.
Files changed (108) hide show
  1. package/app/frontend/node_modules/esbuild/LICENSE.md +21 -0
  2. package/app/frontend/node_modules/esbuild/README.md +3 -0
  3. package/app/frontend/node_modules/esbuild/bin/esbuild +220 -0
  4. package/app/frontend/node_modules/esbuild/install.js +285 -0
  5. package/app/frontend/node_modules/esbuild/lib/main.d.ts +705 -0
  6. package/app/frontend/node_modules/esbuild/lib/main.js +2239 -0
  7. package/app/frontend/node_modules/esbuild/package.json +46 -0
  8. package/dist/index.es.js +140 -28
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.umd.js +140 -28
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/server-core/src/auth/google-oauth.d.ts +33 -3
  13. package/dist/server-core/src/auth/index.d.ts +1 -0
  14. package/dist/server-core/src/init.d.ts +1 -0
  15. package/dist/types/src/controllers/auth.d.ts +8 -2
  16. package/dist/types/src/controllers/client.d.ts +13 -0
  17. package/dist/types/src/controllers/navigation.d.ts +18 -6
  18. package/dist/types/src/controllers/registry.d.ts +9 -1
  19. package/dist/types/src/controllers/side_entity_controller.d.ts +7 -0
  20. package/dist/types/src/rebase_context.d.ts +17 -0
  21. package/dist/types/src/types/collections.d.ts +20 -1
  22. package/dist/types/src/types/component_ref.d.ts +47 -0
  23. package/dist/types/src/types/entity_views.d.ts +2 -1
  24. package/dist/types/src/types/index.d.ts +1 -0
  25. package/dist/types/src/types/properties.d.ts +15 -3
  26. package/dist/types/src/types/translations.d.ts +2 -0
  27. package/examples/firebase/node_modules/esbuild/LICENSE.md +21 -0
  28. package/examples/firebase/node_modules/esbuild/README.md +3 -0
  29. package/examples/firebase/node_modules/esbuild/bin/esbuild +220 -0
  30. package/examples/firebase/node_modules/esbuild/install.js +285 -0
  31. package/examples/firebase/node_modules/esbuild/lib/main.d.ts +705 -0
  32. package/examples/firebase/node_modules/esbuild/lib/main.js +2239 -0
  33. package/examples/firebase/node_modules/esbuild/package.json +46 -0
  34. package/examples/medmot-staging/frontend/node_modules/esbuild/LICENSE.md +21 -0
  35. package/examples/medmot-staging/frontend/node_modules/esbuild/README.md +3 -0
  36. package/examples/medmot-staging/frontend/node_modules/esbuild/bin/esbuild +220 -0
  37. package/examples/medmot-staging/frontend/node_modules/esbuild/install.js +285 -0
  38. package/examples/medmot-staging/frontend/node_modules/esbuild/lib/main.d.ts +705 -0
  39. package/examples/medmot-staging/frontend/node_modules/esbuild/lib/main.js +2239 -0
  40. package/examples/medmot-staging/frontend/node_modules/esbuild/package.json +46 -0
  41. package/examples/sdk-demo/node_modules/esbuild/LICENSE.md +21 -0
  42. package/examples/sdk-demo/node_modules/esbuild/README.md +3 -0
  43. package/examples/sdk-demo/node_modules/esbuild/bin/esbuild +223 -0
  44. package/examples/sdk-demo/node_modules/esbuild/install.js +289 -0
  45. package/examples/sdk-demo/node_modules/esbuild/lib/main.d.ts +716 -0
  46. package/examples/sdk-demo/node_modules/esbuild/lib/main.js +2242 -0
  47. package/examples/sdk-demo/node_modules/esbuild/package.json +49 -0
  48. package/package.json +7 -7
  49. package/packages/client/node_modules/esbuild/LICENSE.md +21 -0
  50. package/packages/client/node_modules/esbuild/README.md +3 -0
  51. package/packages/client/node_modules/esbuild/bin/esbuild +220 -0
  52. package/packages/client/node_modules/esbuild/install.js +285 -0
  53. package/packages/client/node_modules/esbuild/lib/main.d.ts +705 -0
  54. package/packages/client/node_modules/esbuild/lib/main.js +2239 -0
  55. package/packages/client/node_modules/esbuild/package.json +46 -0
  56. package/packages/client-postgresql/node_modules/esbuild/LICENSE.md +21 -0
  57. package/packages/client-postgresql/node_modules/esbuild/README.md +3 -0
  58. package/packages/client-postgresql/node_modules/esbuild/bin/esbuild +220 -0
  59. package/packages/client-postgresql/node_modules/esbuild/install.js +285 -0
  60. package/packages/client-postgresql/node_modules/esbuild/lib/main.d.ts +705 -0
  61. package/packages/client-postgresql/node_modules/esbuild/lib/main.js +2239 -0
  62. package/packages/client-postgresql/node_modules/esbuild/package.json +46 -0
  63. package/packages/common/node_modules/esbuild/LICENSE.md +21 -0
  64. package/packages/common/node_modules/esbuild/README.md +3 -0
  65. package/packages/common/node_modules/esbuild/bin/esbuild +220 -0
  66. package/packages/common/node_modules/esbuild/install.js +285 -0
  67. package/packages/common/node_modules/esbuild/lib/main.d.ts +705 -0
  68. package/packages/common/node_modules/esbuild/lib/main.js +2239 -0
  69. package/packages/common/node_modules/esbuild/package.json +46 -0
  70. package/packages/server-mongodb/node_modules/esbuild/LICENSE.md +21 -0
  71. package/packages/server-mongodb/node_modules/esbuild/README.md +3 -0
  72. package/packages/server-mongodb/node_modules/esbuild/bin/esbuild +220 -0
  73. package/packages/server-mongodb/node_modules/esbuild/install.js +285 -0
  74. package/packages/server-mongodb/node_modules/esbuild/lib/main.d.ts +705 -0
  75. package/packages/server-mongodb/node_modules/esbuild/lib/main.js +2239 -0
  76. package/packages/server-mongodb/node_modules/esbuild/package.json +46 -0
  77. package/packages/server-postgresql/node_modules/esbuild/LICENSE.md +21 -0
  78. package/packages/server-postgresql/node_modules/esbuild/README.md +3 -0
  79. package/packages/server-postgresql/node_modules/esbuild/bin/esbuild +220 -0
  80. package/packages/server-postgresql/node_modules/esbuild/install.js +285 -0
  81. package/packages/server-postgresql/node_modules/esbuild/lib/main.d.ts +705 -0
  82. package/packages/server-postgresql/node_modules/esbuild/lib/main.js +2239 -0
  83. package/packages/server-postgresql/node_modules/esbuild/package.json +46 -0
  84. package/packages/types/node_modules/esbuild/LICENSE.md +21 -0
  85. package/packages/types/node_modules/esbuild/README.md +3 -0
  86. package/packages/types/node_modules/esbuild/bin/esbuild +220 -0
  87. package/packages/types/node_modules/esbuild/install.js +285 -0
  88. package/packages/types/node_modules/esbuild/lib/main.d.ts +705 -0
  89. package/packages/types/node_modules/esbuild/lib/main.js +2239 -0
  90. package/packages/types/node_modules/esbuild/package.json +46 -0
  91. package/packages/utils/node_modules/esbuild/LICENSE.md +21 -0
  92. package/packages/utils/node_modules/esbuild/README.md +3 -0
  93. package/packages/utils/node_modules/esbuild/bin/esbuild +220 -0
  94. package/packages/utils/node_modules/esbuild/install.js +285 -0
  95. package/packages/utils/node_modules/esbuild/lib/main.d.ts +705 -0
  96. package/packages/utils/node_modules/esbuild/lib/main.js +2239 -0
  97. package/packages/utils/node_modules/esbuild/package.json +46 -0
  98. package/src/api/errors.ts +3 -2
  99. package/src/api/server.ts +5 -2
  100. package/src/auth/google-oauth.ts +148 -17
  101. package/src/auth/index.ts +1 -0
  102. package/src/auth/routes.ts +25 -5
  103. package/src/collections/loader.ts +3 -3
  104. package/src/init.ts +14 -2
  105. package/history_diff.log +0 -385
  106. package/scratch.ts +0 -9
  107. package/test-ast.ts +0 -28
  108. package/test_output.txt +0 -1133
@@ -6,12 +6,42 @@ export interface GoogleUserInfo {
6
6
  photoUrl: string | null;
7
7
  emailVerified: boolean;
8
8
  }
9
+ export interface GoogleProviderConfig {
10
+ clientId: string;
11
+ /**
12
+ * The OAuth 2.0 client secret from Google Cloud Console.
13
+ *
14
+ * Required for the **authorization code flow** (Path 3), where the
15
+ * frontend sends an authorization `code` and the backend exchanges it
16
+ * server-side for tokens. This is the most secure flow because tokens
17
+ * never touch the browser.
18
+ *
19
+ * When omitted, only ID-token and access-token verification are available
20
+ * (Paths 1 & 2), which rely on the frontend obtaining tokens directly.
21
+ */
22
+ clientSecret?: string;
23
+ }
9
24
  /**
10
25
  * Creates a Google OAuth Provider integration.
11
- * Supports both ID-token verification (One Tap / renderButton) and
12
- * access-token verification (popup via initTokenClient).
26
+ *
27
+ * Supports three verification paths:
28
+ *
29
+ * **Path 1 – ID Token** (One Tap / Sign In With Google button):
30
+ * Frontend sends `idToken`. Backend verifies cryptographically using
31
+ * Google's public keys. No secret required.
32
+ *
33
+ * **Path 2 – Access Token** (popup via `initTokenClient`):
34
+ * Frontend sends `accessToken`. Backend validates by calling Google's
35
+ * userinfo endpoint. No secret required.
36
+ *
37
+ * **Path 3 – Authorization Code** (most secure, requires `clientSecret`):
38
+ * Frontend sends `code` + `redirectUri`. Backend exchanges the code
39
+ * server-side for an ID token using `clientId` + `clientSecret`, then
40
+ * verifies the ID token. Tokens never touch the browser.
13
41
  */
14
- export declare function createGoogleProvider(clientId: string): OAuthProvider<{
42
+ export declare function createGoogleProvider(config: GoogleProviderConfig | string): OAuthProvider<{
15
43
  idToken?: string;
16
44
  accessToken?: string;
45
+ code?: string;
46
+ redirectUri?: string;
17
47
  }>;
@@ -4,6 +4,7 @@ export type { JwtConfig, AccessTokenPayload } from "./jwt";
4
4
  export { hashPassword, verifyPassword, validatePasswordStrength } from "./password";
5
5
  export type { PasswordValidationResult } from "./password";
6
6
  export { createGoogleProvider } from "./google-oauth";
7
+ export type { GoogleProviderConfig } from "./google-oauth";
7
8
  export { createLinkedinProvider } from "./linkedin-oauth";
8
9
  export { createGitHubProvider } from "./github-oauth";
9
10
  export { createMicrosoftProvider } from "./microsoft-oauth";
@@ -29,6 +29,7 @@ export interface RebaseAuthConfig {
29
29
  email?: EmailConfig;
30
30
  google?: {
31
31
  clientId: string;
32
+ clientSecret?: string;
32
33
  };
33
34
  linkedin?: {
34
35
  clientId: string;
@@ -80,8 +80,14 @@ export type AuthController<USER extends User = User, ExtraData = unknown> = {
80
80
  export interface AuthControllerExtended<USER extends User = User, ExtraData = unknown> extends AuthController<USER, ExtraData> {
81
81
  /** Login with email and password */
82
82
  emailPasswordLogin?(email: string, password: string): Promise<void>;
83
- /** Login with a Google token (ID token or access token from popup) */
84
- googleLogin?(token: string, tokenType?: "idToken" | "accessToken"): Promise<void>;
83
+ /** Login with a Google token or authorization code */
84
+ googleLogin?: {
85
+ (token: string, tokenType?: "idToken" | "accessToken"): Promise<void>;
86
+ (payload: {
87
+ code: string;
88
+ redirectUri: string;
89
+ }): Promise<void>;
90
+ };
85
91
  /** Register a new user */
86
92
  register?(email: string, password: string, displayName?: string): Promise<void>;
87
93
  /** Skip login (for anonymous access if enabled) */
@@ -167,4 +167,17 @@ export interface RebaseClient<DB = unknown> {
167
167
  email?: EmailService;
168
168
  /** Admin API for user and role management */
169
169
  admin?: AdminAPI;
170
+ /**
171
+ * The base HTTP URL of the backend server.
172
+ * Exposed by the SDK client (`@rebasepro/client`) and used to auto-derive
173
+ * the `ApiConfigProvider` URL.
174
+ */
175
+ baseUrl?: string;
176
+ /**
177
+ * WebSocket client for realtime subscriptions and admin capabilities.
178
+ * Exposed by the SDK client (`@rebasepro/client`). The shape is intentionally
179
+ * left as `unknown` in the base interface — callers should narrow via feature
180
+ * detection (e.g. `typeof ws.executeSql === "function"`).
181
+ */
182
+ ws?: unknown;
170
183
  }
@@ -144,17 +144,18 @@ export interface AppView {
144
144
  * It will still be accessible if you reach the specified path
145
145
  */
146
146
  hideFromNavigation?: boolean;
147
+ /**
148
+ * Navigation group for this view.
149
+ * Views sharing the same group name will be visually grouped
150
+ * together in the drawer and home page. If not set, the view
151
+ * falls into the default "Views" group.
152
+ */
153
+ group?: string;
147
154
  /**
148
155
  * Component to be rendered. This can be any React component, and can use
149
156
  * any of the provided hooks
150
157
  */
151
158
  view: React.ReactNode;
152
- /**
153
- * Optional field used to group top level navigation entries under a
154
- * navigation view.
155
- * This prop is ignored for admin views.
156
- */
157
- group?: string;
158
159
  /**
159
160
  * If true, a wildcard route (slug/*) is automatically registered
160
161
  * alongside the base route, enabling nested navigation within this view.
@@ -193,6 +194,17 @@ export interface NavigationGroupMapping {
193
194
  * List of collection ids or view paths that belong to this group.
194
195
  */
195
196
  entries: string[];
197
+ /**
198
+ * Configure which groups start collapsed.
199
+ * Set to `true` to collapse in both drawer and home page,
200
+ * or use an object to control each independently.
201
+ *
202
+ * @defaultValue false (expanded)
203
+ */
204
+ collapsedByDefault?: boolean | {
205
+ drawer?: boolean;
206
+ home?: boolean;
207
+ };
196
208
  }
197
209
  export interface NavigationEntry {
198
210
  id: string;
@@ -3,7 +3,7 @@ import type { EntityCollection } from "../types/collections";
3
3
  import type { EntityCollectionsBuilder } from "../types/builders";
4
4
  import type { EntityCustomView } from "../types/entity_views";
5
5
  import type { EntityAction } from "../types/entity_actions";
6
- import type { AppView } from "./navigation";
6
+ import type { AppView, NavigationGroupMapping } from "./navigation";
7
7
  /**
8
8
  * Options to enable the built-in collection editor.
9
9
  * When provided to `<RebaseCMS>`, the editor is auto-wired as a native feature.
@@ -25,6 +25,14 @@ export interface RebaseCMSConfig<EC extends EntityCollection = any> {
25
25
  entityViews?: EntityCustomView<any>[];
26
26
  entityActions?: EntityAction[];
27
27
  plugins?: any[];
28
+ /**
29
+ * Centralized configuration for how collections and views are grouped
30
+ * in the navigation sidebar and home page.
31
+ * Each mapping defines a named group and the collection/view slugs
32
+ * that belong to it. The array order determines group display order.
33
+ * Entry order within each group determines card order.
34
+ */
35
+ navigationGroupMappings?: NavigationGroupMapping[];
28
36
  /**
29
37
  * Enable the built-in visual collection/schema editor.
30
38
  * Pass `true` for zero-config, or an options object for fine-grained control.
@@ -62,6 +62,13 @@ export interface EntitySidePanelProps<M extends Record<string, unknown> = Record
62
62
  * Allow the user to open the entity fullscreen
63
63
  */
64
64
  allowFullScreen?: boolean;
65
+ /**
66
+ * Pre-populate the form with these values when creating a new entity.
67
+ * Only applied when `entityId` is not set (i.e. the form is in "new" mode).
68
+ * Useful for actions that fetch data from an external source (e.g. a URL)
69
+ * and want to pre-fill the document before the user saves.
70
+ */
71
+ defaultValues?: Partial<M>;
65
72
  }
66
73
  /**
67
74
  * Controller to open the side dialog displaying entity forms
@@ -3,6 +3,7 @@ import type { AuthController } from "./controllers/auth";
3
3
  import type { StorageSource } from "./controllers/storage";
4
4
  import type { UserConfigurationPersistence } from "./controllers/local_config_persistence";
5
5
  import type { DatabaseAdmin } from "./types/backend";
6
+ import type { RebaseClient } from "./controllers/client";
6
7
  import type { RebaseData } from "./controllers/data";
7
8
  import type { User } from "./users";
8
9
  import type { UserManagementDelegate } from "./types/user_management_delegate";
@@ -12,6 +13,22 @@ import type { UserManagementDelegate } from "./types/user_management_delegate";
12
13
  * @group Hooks and utilities
13
14
  */
14
15
  export type RebaseCallContext<USER extends User = User> = {
16
+ /**
17
+ * The Rebase client instance.
18
+ * Available in all entity callbacks (beforeSave, afterSave, afterRead,
19
+ * beforeDelete, afterDelete) and in CollectionActionsProps via context.
20
+ * Use it to call backend functions, access data, storage, etc.
21
+ *
22
+ * @example
23
+ * // In a beforeSave callback:
24
+ * const result = await context.client.functions.invoke('my-function', { ... });
25
+ *
26
+ * @example
27
+ * // In a CollectionAction component:
28
+ * const { client } = props.context;
29
+ * const result = await client.functions.invoke('extract-job', { url });
30
+ */
31
+ client: RebaseClient<any>;
15
32
  /**
16
33
  * Unified data access — `context.data.products.create(...)`.
17
34
  * Access any collection as a dynamic property.
@@ -9,6 +9,7 @@ import type { RebaseContext } from "../rebase_context";
9
9
  import type { Relation } from "./relations";
10
10
  import type { EntityCustomView } from "./entity_views";
11
11
  import type { EntityAction } from "./entity_actions";
12
+ import type { ComponentRef } from "./component_ref";
12
13
  /**
13
14
  * Base interface containing all driver-agnostic collection properties.
14
15
  * Use {@link PostgresCollection} or {@link FirebaseCollection} for
@@ -86,6 +87,9 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
86
87
  icon?: string | React.ReactNode;
87
88
  /**
88
89
  * Navigation group for this collection.
90
+ * Collections sharing the same group name will be visually grouped
91
+ * together in the drawer and home page. If not set, the collection
92
+ * falls into the default "Views" group.
89
93
  */
90
94
  group?: string;
91
95
  /**
@@ -301,7 +305,7 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
301
305
  /**
302
306
  * Builder for the collection actions rendered in the toolbar
303
307
  */
304
- Actions?: React.ComponentType<any>[];
308
+ Actions?: ComponentRef<CollectionActionsProps>[];
305
309
  }
306
310
  /**
307
311
  * A collection backed by PostgreSQL (or any SQL database).
@@ -482,6 +486,21 @@ export interface CollectionActionsProps<M extends Record<string, unknown> = Reco
482
486
  * undefined means the count is still loading.
483
487
  */
484
488
  collectionEntitiesCount?: number;
489
+ /**
490
+ * Programmatically open the new-document form for this collection,
491
+ * optionally pre-populating it with initial field values.
492
+ * The form opens in the same mode configured for the collection
493
+ * (side panel, full screen, or split).
494
+ *
495
+ * This is the primary hook for workflows that need to create a document
496
+ * from external data — e.g. fetching content from a URL, importing from
497
+ * a third-party API, or duplicating from another system.
498
+ *
499
+ * @example
500
+ * // Inside a custom CollectionAction component:
501
+ * openNewDocument({ title: "Fetched title", body: "..." });
502
+ */
503
+ openNewDocument: (defaultValues?: Record<string, unknown>) => void;
485
504
  }
486
505
  /**
487
506
  * Use this controller to retrieve the selected entities or modify them in
@@ -0,0 +1,47 @@
1
+ import type React from "react";
2
+ /**
3
+ * Internal marker for a lazily-loaded component reference.
4
+ * Created by the Vite transform plugin when converting string paths
5
+ * to deferred `import()` calls. Users should NOT create these manually.
6
+ *
7
+ * @internal
8
+ */
9
+ export interface LazyComponentRef<P = unknown> {
10
+ readonly __rebaseLazy: true;
11
+ readonly load: () => Promise<{
12
+ default: React.ComponentType<P>;
13
+ }>;
14
+ }
15
+ /**
16
+ * A reference to a React component that can be provided in three forms:
17
+ *
18
+ * 1. **String path** (recommended for collection configs):
19
+ * ```ts
20
+ * Field: "../../frontend/src/components/MyField"
21
+ * ```
22
+ * The Vite plugin transforms this into a `LazyComponentRef` at build time.
23
+ * On the backend, the string stays inert and is never evaluated.
24
+ *
25
+ * 2. **Lazy import function**:
26
+ * ```ts
27
+ * Field: () => import("../../frontend/src/components/MyField")
28
+ * ```
29
+ * Standard ES dynamic import. Backend never calls the function.
30
+ *
31
+ * 3. **Direct component reference** (use only in frontend-only code):
32
+ * ```ts
33
+ * Field: MyFieldComponent
34
+ * ```
35
+ * Importing a component at the top level will pull React into the
36
+ * backend runtime — only safe in code that the backend never imports.
37
+ *
38
+ * @group Types
39
+ */
40
+ export type ComponentRef<P = unknown> = React.ComponentType<P> | LazyComponentRef<P> | (() => Promise<{
41
+ default: React.ComponentType<P>;
42
+ }>) | string;
43
+ /**
44
+ * Type guard: checks if a value is a `LazyComponentRef` produced by the
45
+ * Vite transform plugin.
46
+ */
47
+ export declare function isLazyComponentRef<P = unknown>(ref: unknown): ref is LazyComponentRef<P>;
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import type { Entity, EntityValues } from "./entities";
3
3
  import type { EntityCollection } from "./collections";
4
4
  import type { FormexController } from "./formex";
5
+ import type { ComponentRef } from "./component_ref";
5
6
  /**
6
7
  * Context passed to custom fields and entity views.
7
8
  * @group Form custom fields
@@ -46,7 +47,7 @@ export type EntityCustomView<M extends Record<string, unknown> = Record<string,
46
47
  name: string;
47
48
  tabComponent?: React.ReactNode;
48
49
  includeActions?: boolean | "bottom";
49
- Builder?: React.ComponentType<EntityCustomViewParams<M>>;
50
+ Builder?: ComponentRef<EntityCustomViewParams<M>>;
50
51
  position?: "start" | "end";
51
52
  };
52
53
  export interface EntityCustomViewParams<M extends Record<string, unknown> = Record<string, unknown>> {
@@ -23,3 +23,4 @@ export * from "./entity_views";
23
23
  export * from "./data_source";
24
24
  export * from "./cron";
25
25
  export * from "./backend_hooks";
26
+ export * from "./component_ref";
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type { ComponentRef } from "./component_ref";
2
2
  import type { EntityReference, EntityRelation, EntityValues, GeoPoint, Entity } from "./entities";
3
3
  import type { Relation, JoinStep, OnAction } from "./relations";
4
4
  import type { EntityCollection, FilterValues } from "./collections";
@@ -104,8 +104,8 @@ export interface BaseUIConfig<CustomProps = unknown> {
104
104
  disabled?: boolean | PropertyDisabledConfig;
105
105
  widthPercentage?: number;
106
106
  customProps?: CustomProps;
107
- Field?: React.ComponentType<any>;
108
- Preview?: React.ComponentType<any>;
107
+ Field?: ComponentRef<any>;
108
+ Preview?: ComponentRef<any>;
109
109
  }
110
110
  export interface BaseProperty<CustomProps = unknown> {
111
111
  ui?: BaseUIConfig<CustomProps>;
@@ -124,6 +124,18 @@ export interface BaseProperty<CustomProps = unknown> {
124
124
  * overwritten by the current property config.
125
125
  */
126
126
  propertyConfig?: string;
127
+ /**
128
+ * Explicit database column name. When set, this value is used as-is
129
+ * for the SQL column name, bypassing any snake_case conversion of
130
+ * the property key.
131
+ *
132
+ * This is automatically populated by `rebase schema introspect`
133
+ * to guarantee an exact match with the live database schema.
134
+ *
135
+ * For manually-authored collections you can omit this — the framework
136
+ * will derive the column name from the property key via `toSnakeCase()`.
137
+ */
138
+ columnName?: string;
127
139
  /**
128
140
  * Rules for validating this property
129
141
  */
@@ -51,6 +51,8 @@ export interface RebaseTranslations {
51
51
  all_entries_loaded: string;
52
52
  create_your_first_entry: string;
53
53
  no_results_filter_sort: string;
54
+ /** Shown when a text search yields no results. Supports `{{search}}` interpolation. */
55
+ no_results_search?: string;
54
56
  add: string;
55
57
  remove: string;
56
58
  copy_id: string;
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Evan Wallace
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ # esbuild
2
+
3
+ This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details.
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
25
+
26
+ // lib/npm/node-platform.ts
27
+ var fs = require("fs");
28
+ var os = require("os");
29
+ var path = require("path");
30
+ var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
31
+ var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
32
+ var packageDarwin_arm64 = "@esbuild/darwin-arm64";
33
+ var packageDarwin_x64 = "@esbuild/darwin-x64";
34
+ var knownWindowsPackages = {
35
+ "win32 arm64 LE": "@esbuild/win32-arm64",
36
+ "win32 ia32 LE": "@esbuild/win32-ia32",
37
+ "win32 x64 LE": "@esbuild/win32-x64"
38
+ };
39
+ var knownUnixlikePackages = {
40
+ "aix ppc64 BE": "@esbuild/aix-ppc64",
41
+ "android arm64 LE": "@esbuild/android-arm64",
42
+ "darwin arm64 LE": "@esbuild/darwin-arm64",
43
+ "darwin x64 LE": "@esbuild/darwin-x64",
44
+ "freebsd arm64 LE": "@esbuild/freebsd-arm64",
45
+ "freebsd x64 LE": "@esbuild/freebsd-x64",
46
+ "linux arm LE": "@esbuild/linux-arm",
47
+ "linux arm64 LE": "@esbuild/linux-arm64",
48
+ "linux ia32 LE": "@esbuild/linux-ia32",
49
+ "linux mips64el LE": "@esbuild/linux-mips64el",
50
+ "linux ppc64 LE": "@esbuild/linux-ppc64",
51
+ "linux riscv64 LE": "@esbuild/linux-riscv64",
52
+ "linux s390x BE": "@esbuild/linux-s390x",
53
+ "linux x64 LE": "@esbuild/linux-x64",
54
+ "linux loong64 LE": "@esbuild/linux-loong64",
55
+ "netbsd x64 LE": "@esbuild/netbsd-x64",
56
+ "openbsd x64 LE": "@esbuild/openbsd-x64",
57
+ "sunos x64 LE": "@esbuild/sunos-x64"
58
+ };
59
+ var knownWebAssemblyFallbackPackages = {
60
+ "android arm LE": "@esbuild/android-arm",
61
+ "android x64 LE": "@esbuild/android-x64"
62
+ };
63
+ function pkgAndSubpathForCurrentPlatform() {
64
+ let pkg;
65
+ let subpath;
66
+ let isWASM2 = false;
67
+ let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
68
+ if (platformKey in knownWindowsPackages) {
69
+ pkg = knownWindowsPackages[platformKey];
70
+ subpath = "esbuild.exe";
71
+ } else if (platformKey in knownUnixlikePackages) {
72
+ pkg = knownUnixlikePackages[platformKey];
73
+ subpath = "bin/esbuild";
74
+ } else if (platformKey in knownWebAssemblyFallbackPackages) {
75
+ pkg = knownWebAssemblyFallbackPackages[platformKey];
76
+ subpath = "bin/esbuild";
77
+ isWASM2 = true;
78
+ } else {
79
+ throw new Error(`Unsupported platform: ${platformKey}`);
80
+ }
81
+ return { pkg, subpath, isWASM: isWASM2 };
82
+ }
83
+ function pkgForSomeOtherPlatform() {
84
+ const libMainJS = require.resolve("esbuild");
85
+ const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
86
+ if (path.basename(nodeModulesDirectory) === "node_modules") {
87
+ for (const unixKey in knownUnixlikePackages) {
88
+ try {
89
+ const pkg = knownUnixlikePackages[unixKey];
90
+ if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
91
+ } catch {
92
+ }
93
+ }
94
+ for (const windowsKey in knownWindowsPackages) {
95
+ try {
96
+ const pkg = knownWindowsPackages[windowsKey];
97
+ if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
98
+ } catch {
99
+ }
100
+ }
101
+ }
102
+ return null;
103
+ }
104
+ function downloadedBinPath(pkg, subpath) {
105
+ const esbuildLibDir = path.dirname(require.resolve("esbuild"));
106
+ return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
107
+ }
108
+ function generateBinPath() {
109
+ if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
110
+ if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
111
+ console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
112
+ } else {
113
+ return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
114
+ }
115
+ }
116
+ const { pkg, subpath, isWASM: isWASM2 } = pkgAndSubpathForCurrentPlatform();
117
+ let binPath2;
118
+ try {
119
+ binPath2 = require.resolve(`${pkg}/${subpath}`);
120
+ } catch (e) {
121
+ binPath2 = downloadedBinPath(pkg, subpath);
122
+ if (!fs.existsSync(binPath2)) {
123
+ try {
124
+ require.resolve(pkg);
125
+ } catch {
126
+ const otherPkg = pkgForSomeOtherPlatform();
127
+ if (otherPkg) {
128
+ let suggestions = `
129
+ Specifically the "${otherPkg}" package is present but this platform
130
+ needs the "${pkg}" package instead. People often get into this
131
+ situation by installing esbuild on Windows or macOS and copying "node_modules"
132
+ into a Docker image that runs Linux, or by copying "node_modules" between
133
+ Windows and WSL environments.
134
+
135
+ If you are installing with npm, you can try not copying the "node_modules"
136
+ directory when you copy the files over, and running "npm ci" or "npm install"
137
+ on the destination platform after the copy. Or you could consider using yarn
138
+ instead of npm which has built-in support for installing a package on multiple
139
+ platforms simultaneously.
140
+
141
+ If you are installing with yarn, you can try listing both this platform and the
142
+ other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
143
+ feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
144
+ Keep in mind that this means multiple copies of esbuild will be present.
145
+ `;
146
+ if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) {
147
+ suggestions = `
148
+ Specifically the "${otherPkg}" package is present but this platform
149
+ needs the "${pkg}" package instead. People often get into this
150
+ situation by installing esbuild with npm running inside of Rosetta 2 and then
151
+ trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
152
+ 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
153
+
154
+ If you are installing with npm, you can try ensuring that both npm and node are
155
+ not running under Rosetta 2 and then reinstalling esbuild. This likely involves
156
+ changing how you installed npm and/or node. For example, installing node with
157
+ the universal installer here should work: https://nodejs.org/en/download/. Or
158
+ you could consider using yarn instead of npm which has built-in support for
159
+ installing a package on multiple platforms simultaneously.
160
+
161
+ If you are installing with yarn, you can try listing both "arm64" and "x64"
162
+ in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
163
+ https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
164
+ Keep in mind that this means multiple copies of esbuild will be present.
165
+ `;
166
+ }
167
+ throw new Error(`
168
+ You installed esbuild for another platform than the one you're currently using.
169
+ This won't work because esbuild is written with native code and needs to
170
+ install a platform-specific binary executable.
171
+ ${suggestions}
172
+ Another alternative is to use the "esbuild-wasm" package instead, which works
173
+ the same way on all platforms. But it comes with a heavy performance cost and
174
+ can sometimes be 10x slower than the "esbuild" package, so you may also not
175
+ want to do that.
176
+ `);
177
+ }
178
+ throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
179
+
180
+ If you are installing esbuild with npm, make sure that you don't specify the
181
+ "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
182
+ of "package.json" is used by esbuild to install the correct binary executable
183
+ for your current platform.`);
184
+ }
185
+ throw e;
186
+ }
187
+ }
188
+ if (/\.zip\//.test(binPath2)) {
189
+ let pnpapi;
190
+ try {
191
+ pnpapi = require("pnpapi");
192
+ } catch (e) {
193
+ }
194
+ if (pnpapi) {
195
+ const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
196
+ const binTargetPath = path.join(
197
+ root,
198
+ "node_modules",
199
+ ".cache",
200
+ "esbuild",
201
+ `pnpapi-${pkg.replace("/", "-")}-${"0.21.5"}-${path.basename(subpath)}`
202
+ );
203
+ if (!fs.existsSync(binTargetPath)) {
204
+ fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
205
+ fs.copyFileSync(binPath2, binTargetPath);
206
+ fs.chmodSync(binTargetPath, 493);
207
+ }
208
+ return { binPath: binTargetPath, isWASM: isWASM2 };
209
+ }
210
+ }
211
+ return { binPath: binPath2, isWASM: isWASM2 };
212
+ }
213
+
214
+ // lib/npm/node-shim.ts
215
+ var { binPath, isWASM } = generateBinPath();
216
+ if (isWASM) {
217
+ require("child_process").execFileSync("node", [binPath].concat(process.argv.slice(2)), { stdio: "inherit" });
218
+ } else {
219
+ require("child_process").execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
220
+ }