@primate/core 0.4.6 → 0.6.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.
- package/lib/private/App.d.ts +771 -6
- package/lib/private/App.js +49 -16
- package/lib/private/Binder.d.ts +2 -2
- package/lib/private/Flags.d.ts +8 -4
- package/lib/private/Module.d.ts +4 -16
- package/lib/private/Module.js +1 -17
- package/lib/private/app/EnvSchema.d.ts +5 -0
- package/lib/private/app/EnvSchema.js +2 -0
- package/lib/private/app/Facade.browser.d.ts +11 -0
- package/lib/private/app/Facade.browser.js +19 -0
- package/lib/private/app/Facade.d.ts +811 -0
- package/lib/private/app/Facade.js +56 -0
- package/lib/private/asset/Asset.d.ts +1 -1
- package/lib/private/build/App.d.ts +2 -2
- package/lib/private/build/App.js +0 -2
- package/lib/private/build/client/index.js +19 -10
- package/lib/private/build/client/plugin/app-request.d.ts +4 -0
- package/lib/private/build/client/plugin/app-request.js +19 -0
- package/lib/private/build/client/plugin/view.d.ts +4 -0
- package/lib/private/build/client/plugin/view.js +13 -0
- package/lib/private/build/hook.d.ts +1 -2
- package/lib/private/build/hook.js +25 -19
- package/lib/private/build/index.d.ts +2 -1
- package/lib/private/build/index.js +27 -27
- package/lib/private/build/presets.d.ts +10 -0
- package/lib/private/build/presets.js +39 -0
- package/lib/private/build/server/index.js +10 -14
- package/lib/private/build/server/plugin/app-request.d.ts +4 -0
- package/lib/private/build/server/plugin/app-request.js +19 -0
- package/lib/private/build/server/plugin/assets.js +9 -7
- package/lib/private/build/server/plugin/config.js +11 -4
- package/lib/private/build/server/plugin/frontend.js +4 -2
- package/lib/private/build/server/plugin/live-reload.d.ts +4 -0
- package/lib/private/build/server/plugin/{hot-reload.js → live-reload.js} +12 -12
- package/lib/private/build/server/plugin/native-addons.js +10 -11
- package/lib/private/build/server/plugin/node-imports.js +2 -2
- package/lib/private/build/server/plugin/route.js +4 -4
- package/lib/private/build/server/plugin/store.js +11 -33
- package/lib/private/build/server/plugin/stores.js +12 -9
- package/lib/private/build/server/plugin/view.js +5 -5
- package/lib/private/build/server/plugin/views.js +4 -4
- package/lib/private/build/server/plugin/virtual-pages.js +8 -8
- package/lib/private/build/server/plugin/virtual-routes.js +8 -13
- package/lib/private/build/server/plugin/wasm.js +2 -3
- package/lib/private/build/shared/plugin/app-request.d.ts +4 -0
- package/lib/private/build/shared/plugin/app-request.js +19 -0
- package/lib/private/bye.js +2 -3
- package/lib/private/client/Data.d.ts +3 -2
- package/lib/private/client/Render.d.ts +8 -0
- package/lib/private/{frontend → client}/ServerData.d.ts +1 -1
- package/lib/private/client/ServerView.d.ts +4 -0
- package/lib/private/client/ValidateInit.d.ts +1 -3
- package/lib/private/client/ValidationError.d.ts +1 -1
- package/lib/private/{frontend → client}/View.d.ts +1 -1
- package/lib/private/{frontend → client}/ViewOptions.d.ts +1 -1
- package/lib/private/{frontend → client}/ViewResponse.d.ts +2 -2
- package/lib/private/client/app.js +3 -3
- package/lib/private/client/boot.d.ts +5 -0
- package/lib/private/client/boot.js +64 -0
- package/lib/private/client/create-form.d.ts +32 -0
- package/lib/private/client/create-form.js +123 -0
- package/lib/private/client/extract-issues.d.ts +4 -0
- package/lib/private/client/extract-issues.js +21 -0
- package/lib/private/client/http.d.ts +13 -0
- package/lib/private/client/http.js +57 -0
- package/lib/private/client/index.d.ts +23 -0
- package/lib/private/client/index.js +16 -0
- package/lib/private/client/navigate.d.ts +13 -0
- package/lib/private/client/navigate.js +67 -0
- package/lib/private/client/root.d.ts +9 -0
- package/lib/private/client/root.js +11 -0
- package/lib/private/client/submit.d.ts +2 -0
- package/lib/private/client/submit.js +41 -0
- package/lib/private/client/{toValidated.d.ts → to-validated.d.ts} +2 -4
- package/lib/private/client/{toValidated.js → to-validated.js} +1 -1
- package/lib/private/client/validate-field.d.ts +3 -0
- package/lib/private/client/validate-field.js +41 -0
- package/lib/private/config/index.d.ts +7 -21
- package/lib/private/config/index.js +4 -1
- package/lib/private/config/schema.d.ts +82 -22
- package/lib/private/config/schema.js +25 -7
- package/lib/private/cookie.d.ts +12 -6
- package/lib/private/cookie.js +10 -14
- package/lib/private/db/As.d.ts +10 -0
- package/lib/private/db/DB.d.ts +49 -0
- package/lib/private/db/DB.js +3 -0
- package/lib/private/db/DataDict.d.ts +5 -0
- package/lib/private/db/DataKey.d.ts +4 -0
- package/lib/private/db/DataValue.d.ts +17 -0
- package/lib/private/db/MemoryDB.d.ts +33 -0
- package/lib/private/db/MemoryDB.js +335 -0
- package/lib/private/db/PK.d.ts +3 -0
- package/lib/private/db/PK.js +2 -0
- package/lib/private/{database → db}/Query.d.ts +2 -2
- package/lib/private/{database → db}/QueryBuilder.d.ts +2 -3
- package/lib/private/db/ReadArgs.d.ts +9 -0
- package/lib/private/db/ReadArgs.js +2 -0
- package/lib/private/db/ReadRelationsArgs.d.ts +6 -0
- package/lib/private/db/ReadRelationsArgs.js +2 -0
- package/lib/private/{database → db}/Schema.d.ts +1 -2
- package/lib/private/db/Sort.d.ts +4 -0
- package/lib/private/{database → db}/TypeMap.d.ts +2 -3
- package/lib/private/{database → db}/Types.d.ts +1 -1
- package/lib/private/db/With.d.ts +16 -0
- package/lib/private/db/With.js +2 -0
- package/lib/private/db/common.d.ts +25 -0
- package/lib/private/db/common.js +67 -0
- package/lib/private/db/errors.d.ts +104 -0
- package/lib/private/db/errors.js +237 -0
- package/lib/private/db/migrate/apply.d.ts +2 -0
- package/lib/private/db/migrate/apply.js +32 -0
- package/lib/private/db/migrate/bundle.d.ts +3 -0
- package/lib/private/db/migrate/bundle.js +22 -0
- package/lib/private/db/migrate/create.d.ts +2 -0
- package/lib/private/db/migrate/create.js +154 -0
- package/lib/private/db/migrate/index.d.ts +10 -0
- package/lib/private/db/migrate/index.js +6 -0
- package/lib/private/db/migrate/status.d.ts +2 -0
- package/lib/private/db/migrate/status.js +38 -0
- package/lib/private/db/migrate/store.d.ts +5 -0
- package/lib/private/db/migrate/store.js +33 -0
- package/lib/private/db/sql.d.ts +28 -0
- package/lib/private/db/sql.js +177 -0
- package/lib/private/db/storage.d.ts +3 -0
- package/lib/private/db/storage.js +3 -0
- package/lib/private/db/symbol.js +2 -0
- package/lib/private/db/test.d.ts +4 -0
- package/lib/private/db/test.js +1750 -0
- package/lib/private/errors.d.ts +88 -0
- package/lib/private/errors.js +211 -0
- package/lib/private/frontend.d.ts +72 -0
- package/lib/private/frontend.js +245 -0
- package/lib/private/hash.js +0 -1
- package/lib/private/i18n/Catalog.d.ts +5 -2
- package/lib/private/i18n/Formatter.js +21 -9
- package/lib/private/i18n/errors.d.ts +16 -0
- package/lib/private/i18n/errors.js +27 -0
- package/lib/private/i18n/format.d.ts +4 -0
- package/lib/private/i18n/format.js +95 -0
- package/lib/private/i18n/index/client.d.ts +9 -0
- package/lib/private/i18n/index/client.js +152 -0
- package/lib/private/i18n/index/server.d.ts +9 -0
- package/lib/private/i18n/index/server.js +57 -0
- package/lib/private/i18n/index/types.d.ts +33 -0
- package/lib/private/i18n/index/types.js +2 -0
- package/lib/private/i18n/locale.d.ts +9 -3
- package/lib/private/i18n/module.d.ts +3 -0
- package/lib/private/i18n/module.js +115 -0
- package/lib/private/i18n/ordinals.d.ts +1 -1
- package/lib/private/i18n/resolve.d.ts +7 -0
- package/lib/private/i18n/resolve.js +30 -0
- package/lib/private/i18n/schema.d.ts +10 -5
- package/lib/private/i18n/schema.js +6 -10
- package/lib/private/i18n/storage.d.ts +3 -0
- package/lib/private/i18n/storage.js +5 -0
- package/lib/private/i18n/validate.d.ts +2 -0
- package/lib/private/i18n/validate.js +19 -0
- package/lib/private/index.d.ts +14 -0
- package/lib/private/index.js +2 -0
- package/lib/private/log.d.ts +1 -0
- package/lib/private/log.js +15 -14
- package/lib/private/module/Hook.d.ts +1 -1
- package/lib/private/module/Next.d.ts +1 -1
- package/lib/private/module/Setup.d.ts +21 -0
- package/lib/private/module/Setup.js +2 -0
- package/lib/private/module/create.d.ts +16 -0
- package/lib/private/module/create.js +28 -0
- package/lib/private/orm/ExtractSchema.d.ts +9 -0
- package/lib/private/orm/ExtractSchema.js +2 -0
- package/lib/private/orm/ForeignKey.d.ts +14 -0
- package/lib/private/orm/ForeignKey.js +25 -0
- package/lib/private/orm/PrimaryKey.d.ts +17 -0
- package/lib/private/orm/PrimaryKey.js +38 -0
- package/lib/private/orm/StoreInput.d.ts +10 -0
- package/lib/private/orm/StoreInput.js +2 -0
- package/lib/private/orm/key.d.ts +8 -0
- package/lib/private/orm/key.js +8 -0
- package/lib/private/orm/parse.d.ts +13 -0
- package/lib/private/orm/parse.js +29 -0
- package/lib/private/orm/relation.d.ts +43 -0
- package/lib/private/orm/relation.js +26 -0
- package/lib/private/orm/store.d.ts +187 -0
- package/lib/private/orm/store.js +542 -0
- package/lib/private/paths.d.ts +2 -2
- package/lib/private/paths.js +3 -3
- package/lib/private/request/RequestBag.d.ts +5 -1
- package/lib/private/request/RequestBag.js +16 -9
- package/lib/private/request/RequestBody.d.ts +6 -11
- package/lib/private/request/RequestBody.js +51 -59
- package/lib/private/request/RequestContext.d.ts +12 -0
- package/lib/private/request/RequestContext.js +31 -0
- package/lib/private/request/RequestFacade.d.ts +11 -6
- package/lib/private/request/RequestPublic.d.ts +9 -0
- package/lib/private/request/RequestPublic.js +2 -0
- package/lib/private/request/RequestView.d.ts +11 -0
- package/lib/private/request/RequestView.js +3 -0
- package/lib/private/request/handle.d.ts +4 -0
- package/lib/private/request/handle.js +18 -0
- package/lib/private/request/parse.d.ts +2 -2
- package/lib/private/request/parse.js +55 -16
- package/lib/private/request/route.js +37 -22
- package/lib/private/request/router.d.ts +1 -1
- package/lib/private/request/router.js +22 -50
- package/lib/private/{database/symbol/wrap.d.ts → request/sContext.d.ts} +1 -1
- package/lib/private/request/sContext.js +2 -0
- package/lib/private/request/storage.d.ts +4 -0
- package/lib/private/request/storage.js +5 -0
- package/lib/private/response/ResponseFunction.d.ts +2 -3
- package/lib/private/response/ResponseLike.d.ts +1 -1
- package/lib/private/response/binary.d.ts +1 -1
- package/lib/private/response/binary.js +4 -3
- package/lib/private/response/error.d.ts +1 -1
- package/lib/private/response/error.js +1 -1
- package/lib/private/response/json.d.ts +1 -1
- package/lib/private/response/json.js +2 -2
- package/lib/private/response/redirect.d.ts +5 -5
- package/lib/private/response/redirect.js +9 -10
- package/lib/private/response/respond.js +16 -17
- package/lib/private/response/sse.d.ts +1 -1
- package/lib/private/response/sse.js +2 -2
- package/lib/private/response/text.d.ts +1 -1
- package/lib/private/response/text.js +3 -3
- package/lib/private/response/view.d.ts +3 -3
- package/lib/private/response/view.js +7 -14
- package/lib/private/response/ws.d.ts +1 -1
- package/lib/private/response.d.ts +1 -1
- package/lib/private/route/Handler.d.ts +1 -1
- package/lib/private/route/hook.d.ts +6 -0
- package/lib/private/route/hook.js +5 -0
- package/lib/private/route/router.d.ts +6 -2
- package/lib/private/route/router.js +32 -18
- package/lib/private/route/wrap.js +2 -2
- package/lib/private/serve/App.d.ts +11 -25
- package/lib/private/serve/App.js +138 -120
- package/lib/private/serve/Init.d.ts +5 -5
- package/lib/private/serve/dev-module.d.ts +2 -0
- package/lib/private/serve/dev-module.js +34 -0
- package/lib/private/serve/hook.d.ts +1 -2
- package/lib/private/serve/hook.js +2 -9
- package/lib/private/serve/index.d.ts +1 -1
- package/lib/private/serve/index.js +36 -2
- package/lib/private/server/TAG.d.ts +3 -0
- package/lib/private/server/TAG.js +2 -0
- package/lib/private/server/index.d.ts +5 -0
- package/lib/private/server/index.js +6 -0
- package/lib/private/session/Data.d.ts +1 -2
- package/lib/private/session/SessionHandle.d.ts +1 -1
- package/lib/private/session/SessionHandle.js +11 -9
- package/lib/private/session/index.d.ts +3 -4
- package/lib/private/session/module.d.ts +3 -0
- package/lib/private/session/module.js +114 -0
- package/lib/private/session/schema.d.ts +17 -9
- package/lib/private/session/schema.js +11 -6
- package/lib/private/session/storage.d.ts +1 -2
- package/lib/private/session/storage.js +2 -2
- package/lib/private/tags.js +2 -2
- package/lib/private/target/Manager.js +6 -12
- package/lib/private/target/Target.d.ts +1 -1
- package/lib/public/AppFacade.d.ts +2 -0
- package/lib/public/AppFacade.js +2 -0
- package/lib/public/build/presets.d.ts +2 -0
- package/lib/public/build/presets.js +2 -0
- package/lib/public/build/transform.d.ts +2 -0
- package/lib/public/build/transform.js +2 -0
- package/lib/public/client.d.ts +3 -0
- package/lib/public/client.js +2 -0
- package/lib/public/db/MemoryDB.d.ts +2 -0
- package/lib/public/db/MemoryDB.js +2 -0
- package/lib/public/db/errors.d.ts +2 -0
- package/lib/public/db/errors.js +2 -0
- package/lib/public/db/migrate.d.ts +2 -0
- package/lib/public/db/migrate.js +2 -0
- package/lib/public/db/sql.d.ts +2 -0
- package/lib/public/db/sql.js +2 -0
- package/lib/public/db/test.d.ts +2 -0
- package/lib/public/db/test.js +2 -0
- package/lib/public/db.d.ts +12 -0
- package/lib/public/db.js +2 -0
- package/lib/public/frontend.d.ts +3 -0
- package/lib/public/frontend.js +2 -0
- package/lib/public/index.d.ts +2 -0
- package/lib/public/index.js +2 -0
- package/lib/public/orm/key.d.ts +2 -0
- package/lib/public/orm/key.js +2 -0
- package/lib/public/orm/relation.d.ts +2 -0
- package/lib/public/orm/relation.js +2 -0
- package/lib/public/orm/store.d.ts +2 -0
- package/lib/public/orm/store.js +2 -0
- package/lib/public/request/server.d.ts +5 -0
- package/lib/public/request/server.js +7 -0
- package/lib/public/response.d.ts +22 -0
- package/lib/public/response.js +19 -0
- package/lib/public/route/hook.d.ts +2 -0
- package/lib/public/route/hook.js +2 -0
- package/lib/public/server.d.ts +3 -0
- package/lib/public/server.js +2 -0
- package/package.json +40 -30
- package/lib/private/AppError.d.ts +0 -4
- package/lib/private/AppError.js +0 -8
- package/lib/private/backend/Module.d.ts +0 -18
- package/lib/private/backend/Module.js +0 -22
- package/lib/private/backend/TAG.d.ts +0 -3
- package/lib/private/backend/TAG.js +0 -2
- package/lib/private/build/client/reload.d.ts +0 -7
- package/lib/private/build/client/reload.js +0 -6
- package/lib/private/build/server/plugin/database-default.d.ts +0 -4
- package/lib/private/build/server/plugin/database-default.js +0 -48
- package/lib/private/build/server/plugin/hot-reload.d.ts +0 -4
- package/lib/private/build/server/plugin/store-wrap.d.ts +0 -4
- package/lib/private/build/server/plugin/store-wrap.js +0 -33
- package/lib/private/client/spa/index.d.ts +0 -6
- package/lib/private/client/spa/index.js +0 -201
- package/lib/private/client/validate.d.ts +0 -3
- package/lib/private/client/validate.js +0 -54
- package/lib/private/database/As.d.ts +0 -7
- package/lib/private/database/Binds.d.ts +0 -4
- package/lib/private/database/Binds.js +0 -2
- package/lib/private/database/Changes.d.ts +0 -11
- package/lib/private/database/Changes.js +0 -2
- package/lib/private/database/ColumnTypes.d.ts +0 -11
- package/lib/private/database/ColumnTypes.js +0 -2
- package/lib/private/database/DataDict.d.ts +0 -5
- package/lib/private/database/DataKey.d.ts +0 -4
- package/lib/private/database/DataValue.d.ts +0 -5
- package/lib/private/database/Database.d.ts +0 -56
- package/lib/private/database/Database.js +0 -153
- package/lib/private/database/InMemoryDatabase.d.ts +0 -37
- package/lib/private/database/InMemoryDatabase.js +0 -181
- package/lib/private/database/Sort.d.ts +0 -4
- package/lib/private/database/Store.d.ts +0 -172
- package/lib/private/database/Store.js +0 -261
- package/lib/private/database/storage.d.ts +0 -4
- package/lib/private/database/storage.js +0 -3
- package/lib/private/database/symbol/wrap.js +0 -2
- package/lib/private/database/symbol.js +0 -2
- package/lib/private/database/test.d.ts +0 -4
- package/lib/private/database/test.js +0 -678
- package/lib/private/database/wrap.d.ts +0 -5
- package/lib/private/database/wrap.js +0 -5
- package/lib/private/fail.d.ts +0 -3
- package/lib/private/fail.js +0 -5
- package/lib/private/frontend/Module.d.ts +0 -62
- package/lib/private/frontend/Module.js +0 -250
- package/lib/private/frontend/Render.d.ts +0 -9
- package/lib/private/frontend/ServerView.d.ts +0 -5
- package/lib/private/i18n/Module.d.ts +0 -16
- package/lib/private/i18n/Module.js +0 -122
- package/lib/private/i18n/index.d.ts +0 -28
- package/lib/private/i18n/index.js +0 -236
- package/lib/private/module/BuildHook.d.ts +0 -5
- package/lib/private/module/BuildHook.js +0 -2
- package/lib/private/module/NextBuild.d.ts +0 -5
- package/lib/private/module/NextBuild.js +0 -2
- package/lib/private/module/NextServe.d.ts +0 -5
- package/lib/private/module/NextServe.js +0 -2
- package/lib/private/reducer.d.ts +0 -24
- package/lib/private/reducer.js +0 -10
- package/lib/private/route/guard.d.ts +0 -4
- package/lib/private/route/guard.js +0 -22
- package/lib/private/serve/module/Dev.d.ts +0 -11
- package/lib/private/serve/module/Dev.js +0 -28
- package/lib/private/serve/module/Handle.d.ts +0 -10
- package/lib/private/serve/module/Handle.js +0 -15
- package/lib/private/session/SessionModule.d.ts +0 -14
- package/lib/private/session/SessionModule.js +0 -122
- package/lib/private/wasm/API.d.ts +0 -7
- package/lib/private/wasm/API.js +0 -2
- package/lib/private/wasm/BufferViewSource.d.ts +0 -4
- package/lib/private/wasm/BufferViewSource.js +0 -2
- package/lib/private/wasm/Exports.d.ts +0 -23
- package/lib/private/wasm/Exports.js +0 -2
- package/lib/private/wasm/I32.d.ts +0 -5
- package/lib/private/wasm/I32.js +0 -2
- package/lib/private/wasm/I32_SIZE.d.ts +0 -3
- package/lib/private/wasm/I32_SIZE.js +0 -2
- package/lib/private/wasm/Instantiation.d.ts +0 -12
- package/lib/private/wasm/Instantiation.js +0 -2
- package/lib/private/wasm/Tagged.d.ts +0 -7
- package/lib/private/wasm/Tagged.js +0 -2
- package/lib/private/wasm/buffersize.d.ts +0 -2
- package/lib/private/wasm/buffersize.js +0 -5
- package/lib/private/wasm/decode-bytes.d.ts +0 -3
- package/lib/private/wasm/decode-bytes.js +0 -5
- package/lib/private/wasm/decode-json.d.ts +0 -7
- package/lib/private/wasm/decode-json.js +0 -11
- package/lib/private/wasm/decode-option.d.ts +0 -5
- package/lib/private/wasm/decode-option.js +0 -10
- package/lib/private/wasm/decode-response.d.ts +0 -19
- package/lib/private/wasm/decode-response.js +0 -90
- package/lib/private/wasm/decode-string.d.ts +0 -3
- package/lib/private/wasm/decode-string.js +0 -5
- package/lib/private/wasm/decode-websocket-close.d.ts +0 -5
- package/lib/private/wasm/decode-websocket-close.js +0 -6
- package/lib/private/wasm/decode-websocket-send.d.ts +0 -6
- package/lib/private/wasm/decode-websocket-send.js +0 -19
- package/lib/private/wasm/encode-buffer.d.ts +0 -3
- package/lib/private/wasm/encode-buffer.js +0 -6
- package/lib/private/wasm/encode-request.d.ts +0 -9
- package/lib/private/wasm/encode-request.js +0 -195
- package/lib/private/wasm/encode-session.d.ts +0 -3
- package/lib/private/wasm/encode-session.js +0 -25
- package/lib/private/wasm/encode-string-map.d.ts +0 -5
- package/lib/private/wasm/encode-string-map.js +0 -14
- package/lib/private/wasm/encode-string.d.ts +0 -13
- package/lib/private/wasm/encode-string.js +0 -17
- package/lib/private/wasm/encode-url.d.ts +0 -11
- package/lib/private/wasm/encode-url.js +0 -14
- package/lib/private/wasm/encode-websocket-close.d.ts +0 -2
- package/lib/private/wasm/encode-websocket-close.js +0 -7
- package/lib/private/wasm/encode-websocket-message.d.ts +0 -4
- package/lib/private/wasm/encode-websocket-message.js +0 -30
- package/lib/private/wasm/encode-websocket-open.d.ts +0 -2
- package/lib/private/wasm/encode-websocket-open.js +0 -7
- package/lib/private/wasm/filesize.d.ts +0 -2
- package/lib/private/wasm/filesize.js +0 -8
- package/lib/private/wasm/instantiate.d.ts +0 -37
- package/lib/private/wasm/instantiate.js +0 -408
- package/lib/private/wasm/open-websocket.d.ts +0 -4
- package/lib/private/wasm/open-websocket.js +0 -26
- package/lib/private/wasm/stringsize.d.ts +0 -3
- package/lib/private/wasm/stringsize.js +0 -5
- package/lib/private/wasm/urlsize.d.ts +0 -2
- package/lib/private/wasm/urlsize.js +0 -5
- package/lib/public/App.d.ts +0 -2
- package/lib/public/App.js +0 -2
- package/lib/public/AppError.d.ts +0 -2
- package/lib/public/AppError.js +0 -2
- package/lib/public/BuildApp.d.ts +0 -2
- package/lib/public/BuildApp.js +0 -2
- package/lib/public/BuildHook.d.ts +0 -2
- package/lib/public/BuildHook.js +0 -2
- package/lib/public/Database.d.ts +0 -2
- package/lib/public/Database.js +0 -2
- package/lib/public/Mode.d.ts +0 -2
- package/lib/public/Mode.js +0 -2
- package/lib/public/Module.d.ts +0 -2
- package/lib/public/Module.js +0 -2
- package/lib/public/Next.d.ts +0 -2
- package/lib/public/Next.js +0 -2
- package/lib/public/NextBuild.d.ts +0 -2
- package/lib/public/NextBuild.js +0 -2
- package/lib/public/NextHandle.d.ts +0 -2
- package/lib/public/NextHandle.js +0 -2
- package/lib/public/NextRoute.d.ts +0 -3
- package/lib/public/NextRoute.js +0 -2
- package/lib/public/NextServe.d.ts +0 -2
- package/lib/public/NextServe.js +0 -2
- package/lib/public/ServeApp.d.ts +0 -2
- package/lib/public/ServeApp.js +0 -2
- package/lib/public/Target.d.ts +0 -2
- package/lib/public/Target.js +0 -2
- package/lib/public/backend/Module.d.ts +0 -2
- package/lib/public/backend/Module.js +0 -2
- package/lib/public/backend/TAG.d.ts +0 -2
- package/lib/public/backend/TAG.js +0 -2
- package/lib/public/client/Data.d.ts +0 -2
- package/lib/public/client/Data.js +0 -2
- package/lib/public/client/ValidateInit.d.ts +0 -2
- package/lib/public/client/ValidateInit.js +0 -2
- package/lib/public/client/ValidateUpdater.d.ts +0 -2
- package/lib/public/client/ValidateUpdater.js +0 -2
- package/lib/public/client/ValidationError.d.ts +0 -2
- package/lib/public/client/ValidationError.js +0 -2
- package/lib/public/client/spa.d.ts +0 -2
- package/lib/public/client/spa.js +0 -2
- package/lib/public/client/toValidated.d.ts +0 -2
- package/lib/public/client/toValidated.js +0 -2
- package/lib/public/client/validate.d.ts +0 -2
- package/lib/public/client/validate.js +0 -2
- package/lib/public/database/As.d.ts +0 -2
- package/lib/public/database/As.js +0 -2
- package/lib/public/database/DataDict.d.ts +0 -2
- package/lib/public/database/DataDict.js +0 -2
- package/lib/public/database/InMemoryDatabase.d.ts +0 -2
- package/lib/public/database/InMemoryDatabase.js +0 -2
- package/lib/public/database/Sort.d.ts +0 -2
- package/lib/public/database/Sort.js +0 -2
- package/lib/public/database/Store.d.ts +0 -2
- package/lib/public/database/Store.js +0 -2
- package/lib/public/database/TypeMap.d.ts +0 -2
- package/lib/public/database/TypeMap.js +0 -2
- package/lib/public/database/Types.d.ts +0 -2
- package/lib/public/database/Types.js +0 -2
- package/lib/public/database/test.d.ts +0 -2
- package/lib/public/database/test.js +0 -2
- package/lib/public/database/wrap.d.ts +0 -2
- package/lib/public/database/wrap.js +0 -2
- package/lib/public/fail.d.ts +0 -2
- package/lib/public/fail.js +0 -2
- package/lib/public/frontend/Module.d.ts +0 -2
- package/lib/public/frontend/Module.js +0 -2
- package/lib/public/frontend/Publish.d.ts +0 -2
- package/lib/public/frontend/Publish.js +0 -2
- package/lib/public/frontend/Render.d.ts +0 -2
- package/lib/public/frontend/Render.js +0 -2
- package/lib/public/frontend/ViewResponse.d.ts +0 -2
- package/lib/public/frontend/ViewResponse.js +0 -2
- package/lib/public/request/RequestBody.d.ts +0 -2
- package/lib/public/request/RequestBody.js +0 -2
- package/lib/public/request/RequestFacade.d.ts +0 -2
- package/lib/public/request/RequestFacade.js +0 -2
- package/lib/public/request/Verb.d.ts +0 -2
- package/lib/public/request/Verb.js +0 -2
- package/lib/public/response/ResponseFunction.d.ts +0 -2
- package/lib/public/response/ResponseFunction.js +0 -2
- package/lib/public/response/ResponseLike.d.ts +0 -2
- package/lib/public/response/ResponseLike.js +0 -2
- package/lib/public/response/binary.d.ts +0 -2
- package/lib/public/response/binary.js +0 -2
- package/lib/public/response/error.d.ts +0 -2
- package/lib/public/response/error.js +0 -2
- package/lib/public/response/json.d.ts +0 -2
- package/lib/public/response/json.js +0 -2
- package/lib/public/response/redirect.d.ts +0 -2
- package/lib/public/response/redirect.js +0 -2
- package/lib/public/response/sse.d.ts +0 -2
- package/lib/public/response/sse.js +0 -2
- package/lib/public/response/text.d.ts +0 -2
- package/lib/public/response/text.js +0 -2
- package/lib/public/response/view.d.ts +0 -2
- package/lib/public/response/view.js +0 -2
- package/lib/public/response/ws.d.ts +0 -2
- package/lib/public/response/ws.js +0 -2
- package/lib/public/wasm/decode-json.d.ts +0 -5
- package/lib/public/wasm/decode-json.js +0 -3
- package/lib/public/wasm/decode-response.d.ts +0 -3
- package/lib/public/wasm/decode-response.js +0 -3
- package/lib/public/wasm/encode-request.d.ts +0 -3
- package/lib/public/wasm/encode-request.js +0 -3
- package/lib/public/wasm/encode-session.d.ts +0 -3
- package/lib/public/wasm/encode-session.js +0 -3
- package/lib/public/wasm/instantiate.d.ts +0 -4
- package/lib/public/wasm/instantiate.js +0 -3
- /package/lib/private/{frontend → client}/Publish.d.ts +0 -0
- /package/lib/private/{frontend → client}/Publish.js +0 -0
- /package/lib/private/{frontend → client}/Render.js +0 -0
- /package/lib/private/{frontend → client}/ServerData.js +0 -0
- /package/lib/private/{frontend → client}/ServerView.js +0 -0
- /package/lib/private/{frontend → client}/View.js +0 -0
- /package/lib/private/{frontend → client}/ViewOptions.js +0 -0
- /package/lib/private/{frontend → client}/ViewResponse.js +0 -0
- /package/lib/private/client/{spa/storage.d.ts → storage.d.ts} +0 -0
- /package/lib/private/client/{spa/storage.js → storage.js} +0 -0
- /package/lib/private/{database → db}/As.js +0 -0
- /package/lib/private/{database → db}/DataDict.js +0 -0
- /package/lib/private/{database → db}/DataKey.js +0 -0
- /package/lib/private/{database → db}/DataValue.js +0 -0
- /package/lib/private/{database → db}/Query.js +0 -0
- /package/lib/private/{database → db}/QueryBuilder.js +0 -0
- /package/lib/private/{database → db}/Schema.js +0 -0
- /package/lib/private/{database → db}/Sort.js +0 -0
- /package/lib/private/{database → db}/TypeMap.js +0 -0
- /package/lib/private/{database → db}/Types.js +0 -0
- /package/lib/private/{database → db}/primary.d.ts +0 -0
- /package/lib/private/{database → db}/primary.js +0 -0
- /package/lib/private/{database → db}/symbol.d.ts +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type ForeignKey from "#orm/ForeignKey";
|
|
2
|
+
import type { AllowedFKType } from "#orm/ForeignKey";
|
|
3
|
+
import type PrimaryKey from "#orm/PrimaryKey";
|
|
4
|
+
import type { AllowedPKType } from "#orm/PrimaryKey";
|
|
5
|
+
import type { Dict } from "@rcompat/type";
|
|
6
|
+
import type { DataKey, Storable } from "pema";
|
|
7
|
+
type StoreField = Storable<DataKey> | PrimaryKey<AllowedPKType> | ForeignKey<AllowedFKType>;
|
|
8
|
+
type StoreInput = Dict<StoreField>;
|
|
9
|
+
export type { StoreInput as default };
|
|
10
|
+
//# sourceMappingURL=StoreInput.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type PK from "#db/PK";
|
|
2
|
+
import ForeignKey from "#orm/ForeignKey";
|
|
3
|
+
import type { AllowedFKType } from "#orm/ForeignKey";
|
|
4
|
+
import type StoreInput from "#orm/StoreInput";
|
|
5
|
+
import type { Dict } from "@rcompat/type";
|
|
6
|
+
import type { Storable } from "pema";
|
|
7
|
+
export default function parse(input: StoreInput): {
|
|
8
|
+
pk: PK;
|
|
9
|
+
generate_pk: boolean;
|
|
10
|
+
fks: Map<string, ForeignKey<AllowedFKType>>;
|
|
11
|
+
schema: Dict<Storable<keyof import("pema").DataType, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import E from "#db/errors";
|
|
2
|
+
import ForeignKey from "#orm/ForeignKey";
|
|
3
|
+
import PrimaryKey from "#orm/PrimaryKey";
|
|
4
|
+
const is_pk = (x) => x instanceof PrimaryKey;
|
|
5
|
+
const is_fk = (x) => x instanceof ForeignKey;
|
|
6
|
+
export default function parse(input) {
|
|
7
|
+
let pk = null;
|
|
8
|
+
let generate_pk = true;
|
|
9
|
+
const fks = new Map();
|
|
10
|
+
const schema = {};
|
|
11
|
+
for (const [key, value] of Object.entries(input)) {
|
|
12
|
+
if (is_pk(value)) {
|
|
13
|
+
if (pk !== null)
|
|
14
|
+
throw E.pk_multiple_pks(pk, key);
|
|
15
|
+
pk = key;
|
|
16
|
+
generate_pk = value.generate;
|
|
17
|
+
schema[key] = value.type;
|
|
18
|
+
}
|
|
19
|
+
else if (is_fk(value)) {
|
|
20
|
+
fks.set(key, value);
|
|
21
|
+
schema[key] = value.type;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
schema[key] = value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return { pk, generate_pk, fks, schema };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Store } from "#orm/store";
|
|
2
|
+
import type StoreInput from "#orm/StoreInput";
|
|
3
|
+
/**
|
|
4
|
+
* extracts schema type from either a schema or a Store.
|
|
5
|
+
*/
|
|
6
|
+
type SchemaOf<T> = T extends Store<infer S, any> ? S : T;
|
|
7
|
+
/**
|
|
8
|
+
* One relation (singular) - returns single record or null
|
|
9
|
+
*
|
|
10
|
+
* Normal: FK is on the OTHER table, pointing to this table's PK.
|
|
11
|
+
* Author has one Profile -> Profile has author_id
|
|
12
|
+
*
|
|
13
|
+
* Reverse: FK is on THIS table, pointing to other table's PK.
|
|
14
|
+
* Profile belongs to Author -> Profile has author_id
|
|
15
|
+
*/
|
|
16
|
+
export type OneRelation<T extends StoreInput, FK extends string> = {
|
|
17
|
+
type: "one";
|
|
18
|
+
schema: T;
|
|
19
|
+
fk: FK;
|
|
20
|
+
reverse: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Many relation (plural) - returns array of records
|
|
24
|
+
*
|
|
25
|
+
* FK is always on the OTHER table, pointing to this table's PK.
|
|
26
|
+
* Example: Author has many Articles → Article has author_id
|
|
27
|
+
*/
|
|
28
|
+
export type ManyRelation<T extends StoreInput, FK extends string> = {
|
|
29
|
+
type: "many";
|
|
30
|
+
schema: T;
|
|
31
|
+
fk: FK;
|
|
32
|
+
};
|
|
33
|
+
export type Relation = OneRelation<any, string> | ManyRelation<any, string>;
|
|
34
|
+
declare function one<T extends StoreInput | Store<StoreInput, any>, FK extends string>(input: T, fk: FK, options?: {
|
|
35
|
+
reverse?: boolean;
|
|
36
|
+
}): OneRelation<SchemaOf<T>, FK>;
|
|
37
|
+
declare function many<T extends StoreInput | Store<StoreInput, any>, FK extends string>(input: T, fk: FK): ManyRelation<SchemaOf<T>, FK>;
|
|
38
|
+
declare const _default: {
|
|
39
|
+
one: typeof one;
|
|
40
|
+
many: typeof many;
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
|
43
|
+
//# sourceMappingURL=relation.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import is from "@rcompat/is";
|
|
2
|
+
function is_store(value) {
|
|
3
|
+
return is.dict(value) && "schema" in value && is.function(value.get);
|
|
4
|
+
}
|
|
5
|
+
function extract_schema(schema_or_store) {
|
|
6
|
+
return (is_store(schema_or_store)
|
|
7
|
+
? schema_or_store.schema
|
|
8
|
+
: schema_or_store);
|
|
9
|
+
}
|
|
10
|
+
function one(input, fk, options) {
|
|
11
|
+
return {
|
|
12
|
+
type: "one",
|
|
13
|
+
schema: extract_schema(input),
|
|
14
|
+
fk,
|
|
15
|
+
reverse: options?.reverse ?? false,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function many(input, fk) {
|
|
19
|
+
return {
|
|
20
|
+
type: "many",
|
|
21
|
+
schema: extract_schema(input),
|
|
22
|
+
fk,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export default { one, many };
|
|
26
|
+
//# sourceMappingURL=relation.js.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type DB from "#db/DB";
|
|
2
|
+
import type PK from "#db/PK";
|
|
3
|
+
import type Types from "#db/Types";
|
|
4
|
+
import type ExtractSchema from "#orm/ExtractSchema";
|
|
5
|
+
import type PrimaryKey from "#orm/PrimaryKey";
|
|
6
|
+
import type { ManyRelation, OneRelation, Relation } from "#orm/relation";
|
|
7
|
+
import type StoreInput from "#orm/StoreInput";
|
|
8
|
+
import type { Dict, EmptyObject, Serializable } from "@rcompat/type";
|
|
9
|
+
import type { DefaultType, InferStore, Storable } from "pema";
|
|
10
|
+
import StoreType from "pema/StoreType";
|
|
11
|
+
type X<T> = {
|
|
12
|
+
[K in keyof T]: T[K];
|
|
13
|
+
} & {};
|
|
14
|
+
type OrNull<T> = {
|
|
15
|
+
[P in keyof T]?: null | T[P];
|
|
16
|
+
};
|
|
17
|
+
type StringOperators = {
|
|
18
|
+
$like?: string;
|
|
19
|
+
$ilike?: string;
|
|
20
|
+
};
|
|
21
|
+
type NumberOperators = {
|
|
22
|
+
$gt?: number;
|
|
23
|
+
$gte?: number;
|
|
24
|
+
$lt?: number;
|
|
25
|
+
$lte?: number;
|
|
26
|
+
$ne?: number;
|
|
27
|
+
};
|
|
28
|
+
type BigIntOperators = {
|
|
29
|
+
$gt?: bigint;
|
|
30
|
+
$gte?: bigint;
|
|
31
|
+
$lt?: bigint;
|
|
32
|
+
$lte?: bigint;
|
|
33
|
+
$ne?: bigint;
|
|
34
|
+
};
|
|
35
|
+
type DateOperators = {
|
|
36
|
+
$before?: Date;
|
|
37
|
+
$after?: Date;
|
|
38
|
+
$ne?: Date;
|
|
39
|
+
};
|
|
40
|
+
type QueryOperators<T> = T extends string ? (T | StringOperators | null) : T extends number ? (T | NumberOperators | null) : T extends bigint ? (T | BigIntOperators | null) : T extends Date ? (T | DateOperators | null) : (T | null);
|
|
41
|
+
type InferRecord<T extends StoreInput> = InferStore<ExtractSchema<T>>;
|
|
42
|
+
type Schema<T extends StoreInput> = X<InferRecord<T>>;
|
|
43
|
+
type Where<T extends StoreInput> = X<{
|
|
44
|
+
[K in keyof Schema<T>]?: QueryOperators<Schema<T>[K]>;
|
|
45
|
+
}>;
|
|
46
|
+
type $Set<T extends StoreInput> = X<OrNull<InferStore<ExtractSchema<T>>>>;
|
|
47
|
+
type SelectKey<T> = Extract<keyof T, string>;
|
|
48
|
+
type Select<T> = readonly SelectKey<T>[];
|
|
49
|
+
type Sort<T> = Partial<Record<SelectKey<T>, "asc" | "desc">>;
|
|
50
|
+
type Projected<T, S extends Select<T> | undefined> = S extends readonly (keyof T)[] ? X<Pick<T, S[number]>> : T;
|
|
51
|
+
type DefaultFields<T extends StoreInput> = {
|
|
52
|
+
[K in keyof InferRecord<T>]: T[K] extends DefaultType<any, any> ? K : never;
|
|
53
|
+
}[keyof InferRecord<T>];
|
|
54
|
+
type Insertable<T extends StoreInput> = Omit<InferRecord<T>, PrimaryKeyField<T> | DefaultFields<T>> & Partial<Pick<InferRecord<T>, PrimaryKeyField<T> | DefaultFields<T>>>;
|
|
55
|
+
type PrimaryKeyField<T extends StoreInput> = {
|
|
56
|
+
[K in keyof T]: T[K] extends PrimaryKey<any> ? K : never;
|
|
57
|
+
}[keyof T] & keyof InferRecord<T>;
|
|
58
|
+
declare const NUMBER_KEYS: readonly ["u8", "u16", "u32", "i8", "i16", "i32", "f32", "f64"];
|
|
59
|
+
declare const BIGINT_KEYS: readonly ["u64", "u128", "i64", "i128"];
|
|
60
|
+
type NumberKey = typeof NUMBER_KEYS[number];
|
|
61
|
+
type BigIntKey = typeof BIGINT_KEYS[number];
|
|
62
|
+
type PKV<T extends StoreInput> = T[PrimaryKeyField<T>] extends PrimaryKey<infer P> ? P extends Storable<infer D> ? D extends "uuid" | "uuid_v4" | "uuid_v7" ? string : D extends NumberKey ? number : D extends BigIntKey ? bigint : string | number | bigint : string | number | bigint : string | number | bigint;
|
|
63
|
+
type WithQuery<T extends StoreInput> = true | {
|
|
64
|
+
where?: Where<T>;
|
|
65
|
+
select?: Select<Schema<T>>;
|
|
66
|
+
sort?: Sort<Schema<T>>;
|
|
67
|
+
limit?: number;
|
|
68
|
+
};
|
|
69
|
+
type With<R extends Dict<Relation>> = {
|
|
70
|
+
[K in keyof R]?: R[K] extends OneRelation<infer S, string> ? WithQuery<S> : R[K] extends ManyRelation<infer S, string> ? WithQuery<S> : never;
|
|
71
|
+
};
|
|
72
|
+
type RelationResult<Rel, Q> = Rel extends OneRelation<infer S, string> ? Q extends {
|
|
73
|
+
select: infer Sel;
|
|
74
|
+
} ? Sel extends Select<Schema<S>> ? Projected<Schema<S>, Sel> | null : Schema<S> | null : Schema<S> | null : Rel extends ManyRelation<infer S, string> ? Q extends {
|
|
75
|
+
select: infer Sel;
|
|
76
|
+
} ? Sel extends Select<Schema<S>> ? Projected<Schema<S>, Sel>[] : Schema<S>[] : Schema<S>[] : never;
|
|
77
|
+
type WithRelations<Base, Relations extends Dict<Relation>, W extends With<Relations> | undefined> = W extends object ? X<Base & {
|
|
78
|
+
[K in keyof W & keyof Relations]: RelationResult<Relations[K], W[K]>;
|
|
79
|
+
}> : Base;
|
|
80
|
+
type Init<S extends StoreInput, R extends Dict<Relation>> = {
|
|
81
|
+
name: string;
|
|
82
|
+
db: DB;
|
|
83
|
+
schema: S;
|
|
84
|
+
relations?: R;
|
|
85
|
+
migrate?: boolean;
|
|
86
|
+
extend?: Dict;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Database-backed store.
|
|
90
|
+
*
|
|
91
|
+
* A `Store` exposes a typed, validated interface over a relational or
|
|
92
|
+
* document database table/collection. It pairs a Pema schema with a uniform
|
|
93
|
+
* CRUD/query API.
|
|
94
|
+
*/
|
|
95
|
+
export declare class Store<T extends StoreInput, R extends Dict<Relation> = EmptyObject> implements Serializable {
|
|
96
|
+
#private;
|
|
97
|
+
readonly Schema: Schema<T>;
|
|
98
|
+
constructor(init: Init<T, R>);
|
|
99
|
+
get table(): {
|
|
100
|
+
create: () => import("@rcompat/type").MaybePromise<void>;
|
|
101
|
+
delete: () => import("@rcompat/type").MaybePromise<void>;
|
|
102
|
+
};
|
|
103
|
+
get infer(): InferRecord<T>;
|
|
104
|
+
get schema(): Dict<Storable<keyof import("pema").DataType, unknown>>;
|
|
105
|
+
get type(): StoreType<ExtractSchema<T>>;
|
|
106
|
+
get migrate(): boolean;
|
|
107
|
+
get name(): string;
|
|
108
|
+
get pk(): PK;
|
|
109
|
+
get db(): DB;
|
|
110
|
+
get types(): Types;
|
|
111
|
+
/**
|
|
112
|
+
* Count records
|
|
113
|
+
*/
|
|
114
|
+
count(options?: {
|
|
115
|
+
where?: Where<T>;
|
|
116
|
+
}): Promise<number>;
|
|
117
|
+
/**
|
|
118
|
+
* Check whether a record with the given primary key exists.
|
|
119
|
+
*/
|
|
120
|
+
has(pkv: PKV<T>): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Get a record by primary key.
|
|
123
|
+
*
|
|
124
|
+
* - Without options: returns the full base record.
|
|
125
|
+
* - With `select`: returns a projected record.
|
|
126
|
+
* - With `with`: augments the record with relations.
|
|
127
|
+
*/
|
|
128
|
+
get(pkv: PKV<T>): Promise<Schema<T>>;
|
|
129
|
+
get<const S extends Select<Schema<T>> | undefined = undefined, const W extends With<R> | undefined = undefined>(pkv: PKV<T>, options: {
|
|
130
|
+
select?: S;
|
|
131
|
+
with?: W;
|
|
132
|
+
}): Promise<WithRelations<Projected<Schema<T>, S>, R, W>>;
|
|
133
|
+
/**
|
|
134
|
+
* Try to get a record by primary key.
|
|
135
|
+
*/
|
|
136
|
+
try(pkv: PKV<T>): Promise<Schema<T> | undefined>;
|
|
137
|
+
try<const S extends Select<Schema<T>> | undefined = undefined, const W extends With<R> | undefined = undefined>(pkv: PKV<T>, options: {
|
|
138
|
+
select?: S;
|
|
139
|
+
with?: W;
|
|
140
|
+
}): Promise<WithRelations<Projected<Schema<T>, S>, R, W> | undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* Insert a single record.
|
|
143
|
+
*/
|
|
144
|
+
insert(record: Insertable<T>): Promise<Schema<T>>;
|
|
145
|
+
/**
|
|
146
|
+
* Update a single record by primary key.
|
|
147
|
+
*/
|
|
148
|
+
update(pkv: PKV<T>, options: {
|
|
149
|
+
set: $Set<T>;
|
|
150
|
+
}): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Update multiple records (requires non-empty where).
|
|
153
|
+
*/
|
|
154
|
+
update(options: {
|
|
155
|
+
where?: Where<T>;
|
|
156
|
+
set: $Set<T>;
|
|
157
|
+
}): Promise<number>;
|
|
158
|
+
/**
|
|
159
|
+
* Delete a single record by primary key.
|
|
160
|
+
*/
|
|
161
|
+
delete(pkv: PKV<T>): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Delete multiple records (requires non-empty where).
|
|
164
|
+
*/
|
|
165
|
+
delete(options: {
|
|
166
|
+
where: Where<T>;
|
|
167
|
+
}): Promise<number>;
|
|
168
|
+
/**
|
|
169
|
+
* Find matching records
|
|
170
|
+
*
|
|
171
|
+
*/
|
|
172
|
+
find<const S extends Select<Schema<T>> | undefined = undefined, const W extends With<R> | undefined = undefined>(options?: {
|
|
173
|
+
where?: Where<T>;
|
|
174
|
+
select?: S;
|
|
175
|
+
sort?: Sort<Schema<T>>;
|
|
176
|
+
limit?: number;
|
|
177
|
+
with?: W;
|
|
178
|
+
}): Promise<WithRelations<Projected<Schema<T>, S>, R, W>[]>;
|
|
179
|
+
toJSON(): {
|
|
180
|
+
type: "object";
|
|
181
|
+
properties: Dict<import("pema").Serialized>;
|
|
182
|
+
};
|
|
183
|
+
extend<A extends Dict>(extensor: (This: this) => A): this & A;
|
|
184
|
+
}
|
|
185
|
+
declare function store<T extends StoreInput, R extends Dict<Relation> = EmptyObject>(init: Init<T, R>): Store<T, R>;
|
|
186
|
+
export default store;
|
|
187
|
+
//# sourceMappingURL=store.d.ts.map
|