1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2024-11-28 10:03:42 +02:00

update tygoja and the generated jsvm typings

This commit is contained in:
Gani Georgiev 2023-09-27 18:53:32 +03:00
parent 469769d270
commit fadd12cd22
5 changed files with 3295 additions and 3219 deletions

View File

@ -2,6 +2,8 @@
- Fixed empty thumbs directories not getting deleted on Windows after deleting a record img file ([#3382](https://github.com/pocketbase/pocketbase/issues/3382)).
- Updated the generated JSVM typings to silent the TS warnings when trying to access a field/method in a Go->TS interface.
## v0.18.8

2
go.mod
View File

@ -18,7 +18,7 @@ require (
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61
github.com/mattn/go-sqlite3 v1.14.17
github.com/pocketbase/dbx v1.10.1
github.com/pocketbase/tygoja v0.0.0-20230920202922-6d9f9488868c
github.com/pocketbase/tygoja v0.0.0-20230927153855-adeeda907bc8
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
gocloud.dev v0.34.0

4
go.sum
View File

@ -186,8 +186,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pocketbase/dbx v1.10.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA=
github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/tygoja v0.0.0-20230920202922-6d9f9488868c h1:VnvV4DsPKiKOgJm3tqOiqMxmS0ghU+Bb355jFR5f3h8=
github.com/pocketbase/tygoja v0.0.0-20230920202922-6d9f9488868c/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI=
github.com/pocketbase/tygoja v0.0.0-20230927153855-adeeda907bc8 h1:52UxdJXNrH/PX+HUObEnfn7Z28m7pFXTq8K5156oJiU=
github.com/pocketbase/tygoja v0.0.0-20230927153855-adeeda907bc8/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=

File diff suppressed because it is too large Load Diff

View File

@ -144,8 +144,19 @@ declare function routerPre(...middlewares: Array<string|echo.MiddlewareFunc>): v
*/
declare var __hooks: string
// skip on* hook methods as they are registered via the global on* method
type appWithoutHooks = Omit<pocketbase.PocketBase, ` + "`on${string}`" + `>
// Utility type to exclude the on* hook methods from a type
// (hooks are separately generated as global methods).
//
// See https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#key-remapping-via-as
type excludeHooks<Type> = {
[Property in keyof Type as Exclude<Property, ` + "`on${string}`" + `>]: Type[Property]
};
// core.App without the on* hook methods
type CoreApp = excludeHooks<ORIGINAL_CORE_APP>
// pocketbase.PocketBase without the on* hook methods
type PocketBase = excludeHooks<ORIGINAL_POCKETBASE>
/**
* ` + "`$app`" + ` is the current running PocketBase instance that is globally
@ -156,7 +167,7 @@ type appWithoutHooks = Omit<pocketbase.PocketBase, ` + "`on${string}`" + `>
* @namespace
* @group PocketBase
*/
declare var $app: appWithoutHooks
declare var $app: PocketBase
/**
* ` + "`$template`" + ` is a global helper to load and cache HTML templates on the fly.
@ -607,7 +618,7 @@ interface AdminLoginForm extends forms.AdminLogin{} // merge
* @group PocketBase
*/
declare class AdminLoginForm implements forms.AdminLogin {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface AdminPasswordResetConfirmForm extends forms.AdminPasswordResetConfirm{} // merge
@ -616,7 +627,7 @@ interface AdminPasswordResetConfirmForm extends forms.AdminPasswordResetConfirm{
* @group PocketBase
*/
declare class AdminPasswordResetConfirmForm implements forms.AdminPasswordResetConfirm {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface AdminPasswordResetRequestForm extends forms.AdminPasswordResetRequest{} // merge
@ -625,7 +636,7 @@ interface AdminPasswordResetRequestForm extends forms.AdminPasswordResetRequest{
* @group PocketBase
*/
declare class AdminPasswordResetRequestForm implements forms.AdminPasswordResetRequest {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface AdminUpsertForm extends forms.AdminUpsert{} // merge
@ -634,7 +645,7 @@ interface AdminUpsertForm extends forms.AdminUpsert{} // merge
* @group PocketBase
*/
declare class AdminUpsertForm implements forms.AdminUpsert {
constructor(app: core.App, admin: models.Admin)
constructor(app: CoreApp, admin: models.Admin)
}
interface AppleClientSecretCreateForm extends forms.AppleClientSecretCreate{} // merge
@ -643,7 +654,7 @@ interface AppleClientSecretCreateForm extends forms.AppleClientSecretCreate{} //
* @group PocketBase
*/
declare class AppleClientSecretCreateForm implements forms.AppleClientSecretCreate {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface CollectionUpsertForm extends forms.CollectionUpsert{} // merge
@ -652,7 +663,7 @@ interface CollectionUpsertForm extends forms.CollectionUpsert{} // merge
* @group PocketBase
*/
declare class CollectionUpsertForm implements forms.CollectionUpsert {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface CollectionsImportForm extends forms.CollectionsImport{} // merge
@ -661,7 +672,7 @@ interface CollectionsImportForm extends forms.CollectionsImport{} // merge
* @group PocketBase
*/
declare class CollectionsImportForm implements forms.CollectionsImport {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface RealtimeSubscribeForm extends forms.RealtimeSubscribe{} // merge
@ -677,7 +688,7 @@ interface RecordEmailChangeConfirmForm extends forms.RecordEmailChangeConfirm{}
* @group PocketBase
*/
declare class RecordEmailChangeConfirmForm implements forms.RecordEmailChangeConfirm {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface RecordEmailChangeRequestForm extends forms.RecordEmailChangeRequest{} // merge
@ -686,7 +697,7 @@ interface RecordEmailChangeRequestForm extends forms.RecordEmailChangeRequest{}
* @group PocketBase
*/
declare class RecordEmailChangeRequestForm implements forms.RecordEmailChangeRequest {
constructor(app: core.App, record: models.Record)
constructor(app: CoreApp, record: models.Record)
}
interface RecordOAuth2LoginForm extends forms.RecordOAuth2Login{} // merge
@ -695,7 +706,7 @@ interface RecordOAuth2LoginForm extends forms.RecordOAuth2Login{} // merge
* @group PocketBase
*/
declare class RecordOAuth2LoginForm implements forms.RecordOAuth2Login {
constructor(app: core.App, collection: models.Collection, optAuthRecord?: models.Record)
constructor(app: CoreApp, collection: models.Collection, optAuthRecord?: models.Record)
}
interface RecordPasswordLoginForm extends forms.RecordPasswordLogin{} // merge
@ -704,7 +715,7 @@ interface RecordPasswordLoginForm extends forms.RecordPasswordLogin{} // merge
* @group PocketBase
*/
declare class RecordPasswordLoginForm implements forms.RecordPasswordLogin {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface RecordPasswordResetConfirmForm extends forms.RecordPasswordResetConfirm{} // merge
@ -713,7 +724,7 @@ interface RecordPasswordResetConfirmForm extends forms.RecordPasswordResetConfir
* @group PocketBase
*/
declare class RecordPasswordResetConfirmForm implements forms.RecordPasswordResetConfirm {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface RecordPasswordResetRequestForm extends forms.RecordPasswordResetRequest{} // merge
@ -722,7 +733,7 @@ interface RecordPasswordResetRequestForm extends forms.RecordPasswordResetReques
* @group PocketBase
*/
declare class RecordPasswordResetRequestForm implements forms.RecordPasswordResetRequest {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface RecordUpsertForm extends forms.RecordUpsert{} // merge
@ -731,7 +742,7 @@ interface RecordUpsertForm extends forms.RecordUpsert{} // merge
* @group PocketBase
*/
declare class RecordUpsertForm implements forms.RecordUpsert {
constructor(app: core.App, record: models.Record)
constructor(app: CoreApp, record: models.Record)
}
interface RecordVerificationConfirmForm extends forms.RecordVerificationConfirm{} // merge
@ -740,7 +751,7 @@ interface RecordVerificationConfirmForm extends forms.RecordVerificationConfirm{
* @group PocketBase
*/
declare class RecordVerificationConfirmForm implements forms.RecordVerificationConfirm {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface RecordVerificationRequestForm extends forms.RecordVerificationRequest{} // merge
@ -749,7 +760,7 @@ interface RecordVerificationRequestForm extends forms.RecordVerificationRequest{
* @group PocketBase
*/
declare class RecordVerificationRequestForm implements forms.RecordVerificationRequest {
constructor(app: core.App, collection: models.Collection)
constructor(app: CoreApp, collection: models.Collection)
}
interface SettingsUpsertForm extends forms.SettingsUpsert{} // merge
@ -758,7 +769,7 @@ interface SettingsUpsertForm extends forms.SettingsUpsert{} // merge
* @group PocketBase
*/
declare class SettingsUpsertForm implements forms.SettingsUpsert {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface TestEmailSendForm extends forms.TestEmailSend{} // merge
@ -767,7 +778,7 @@ interface TestEmailSendForm extends forms.TestEmailSend{} // merge
* @group PocketBase
*/
declare class TestEmailSendForm implements forms.TestEmailSend {
constructor(app: core.App)
constructor(app: CoreApp)
}
interface TestS3FilesystemForm extends forms.TestS3Filesystem{} // merge
@ -776,7 +787,7 @@ interface TestS3FilesystemForm extends forms.TestS3Filesystem{} // merge
* @group PocketBase
*/
declare class TestS3FilesystemForm implements forms.TestS3Filesystem {
constructor(app: core.App)
constructor(app: CoreApp)
}
// -------------------------------------------------------------------
@ -981,6 +992,12 @@ func main() {
log.Fatal("Failed to get the current docs directory")
}
// replace the original app interfaces with their non-"on*"" hooks equivalents
result = strings.ReplaceAll(result, "core.App", "CoreApp")
result = strings.ReplaceAll(result, "pocketbase.PocketBase", "PocketBase")
result = strings.ReplaceAll(result, "ORIGINAL_CORE_APP", "core.App")
result = strings.ReplaceAll(result, "ORIGINAL_POCKETBASE", "pocketbase.PocketBase")
parentDir := filepath.Dir(filename)
typesFile := filepath.Join(parentDir, "generated", "types.d.ts")