payload 3.0.0-beta.37 → 3.0.0-beta.39
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/auth.d.ts +6 -0
- package/auth.js +6 -0
- package/components.d.ts +14 -0
- package/components.js +71 -0
- package/config.d.ts +14 -0
- package/config.js +14 -0
- package/database.d.ts +23 -0
- package/database.js +22 -0
- package/dist/admin/LanguageOptions.d.ts +5 -0
- package/dist/admin/LanguageOptions.d.ts.map +1 -0
- package/dist/admin/LanguageOptions.js +3 -0
- package/dist/admin/LanguageOptions.js.map +1 -0
- package/dist/admin/types.d.ts +1 -0
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/types.d.ts +2 -0
- package/dist/admin/views/types.d.ts.map +1 -1
- package/dist/admin/views/types.js.map +1 -1
- package/dist/auth/strategies/local/register.js +1 -1
- package/dist/auth/strategies/local/register.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js +1 -0
- package/dist/collections/operations/restoreVersion.js.map +1 -1
- package/dist/database/migrations/getPredefinedMigration.d.ts +12 -0
- package/dist/database/migrations/getPredefinedMigration.d.ts.map +1 -0
- package/dist/database/migrations/getPredefinedMigration.js +41 -0
- package/dist/database/migrations/getPredefinedMigration.js.map +1 -0
- package/dist/database/types.d.ts +5 -0
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js.map +1 -1
- package/dist/exports/database.d.ts +2 -1
- package/dist/exports/database.d.ts.map +1 -1
- package/dist/exports/database.js +1 -0
- package/dist/exports/database.js.map +1 -1
- package/dist/fields/config/client.d.ts +0 -1
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/schema.d.ts.map +1 -1
- package/dist/fields/config/schema.js +1 -0
- package/dist/fields/config/schema.js.map +1 -1
- package/dist/fields/config/types.d.ts +0 -5
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/getDefaultValue.js.map +1 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +2 -2
- package/dist/fields/validations.js.map +1 -1
- package/dist/versions/saveVersion.d.ts.map +1 -1
- package/dist/versions/saveVersion.js +1 -0
- package/dist/versions/saveVersion.js.map +1 -1
- package/errors.d.ts +2 -0
- package/errors.js +3 -0
- package/graphql.d.ts +3 -0
- package/graphql.js +27 -0
- package/operations.d.ts +30 -0
- package/operations.js +31 -0
- package/package.json +2 -2
- package/types.d.ts +17 -0
- package/types.js +5 -0
- package/utilities.d.ts +33 -0
- package/utilities.js +34 -0
- package/versions.d.ts +9 -0
- package/versions.js +9 -0
package/auth.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './dist/auth/index.js';
|
|
2
|
+
export { default as executeAccess } from './dist/auth/executeAccess.js';
|
|
3
|
+
export { getAccessResults } from './dist/auth/getAccessResults.js';
|
|
4
|
+
export { getAuthenticatedUser } from './dist/auth/getAuthenticatedUser.js';
|
|
5
|
+
export type { AuthStrategyFunction, AuthStrategyFunctionArgs, CollectionPermission, FieldPermissions, GlobalPermission, IncomingAuthType, Permission, Permissions, User, VerifyConfig, } from './dist/auth/types.js';
|
|
6
|
+
//# sourceMappingURL=auth.d.ts.map
|
package/auth.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './dist/auth/index.js';
|
|
2
|
+
export { default as executeAccess } from './dist/auth/executeAccess.js';
|
|
3
|
+
export { getAccessResults } from './dist/auth/getAccessResults.js';
|
|
4
|
+
export { getAuthenticatedUser } from './dist/auth/getAuthenticatedUser.js';
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=auth.js.map
|
package/components.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as Banner } from './dist/admin/components/elements/Banner';
|
|
2
|
+
export { default as Button } from './dist/admin/components/elements/Button';
|
|
3
|
+
export { ErrorPill } from './dist/admin/components/elements/ErrorPill';
|
|
4
|
+
export { default as Pill } from './dist/admin/components/elements/Pill';
|
|
5
|
+
export { default as Popup } from './dist/admin/components/elements/Popup';
|
|
6
|
+
export { ShimmerEffect } from './dist/admin/components/elements/ShimmerEffect';
|
|
7
|
+
export { default as Tooltip } from './dist/admin/components/elements/Tooltip';
|
|
8
|
+
export { default as Check } from './dist/admin/components/icons/Check';
|
|
9
|
+
export { default as Chevron } from './dist/admin/components/icons/Chevron';
|
|
10
|
+
export { default as Menu } from './dist/admin/components/icons/Menu';
|
|
11
|
+
export { default as Search } from './dist/admin/components/icons/Search';
|
|
12
|
+
export { default as X } from './dist/admin/components/icons/X';
|
|
13
|
+
export { default as MinimalTemplate } from './dist/admin/components/templates/Minimal';
|
|
14
|
+
//# sourceMappingURL=components.d.ts.map
|
package/components.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
Banner: function() {
|
|
13
|
+
return _Banner.default;
|
|
14
|
+
},
|
|
15
|
+
Button: function() {
|
|
16
|
+
return _Button.default;
|
|
17
|
+
},
|
|
18
|
+
Check: function() {
|
|
19
|
+
return _Check.default;
|
|
20
|
+
},
|
|
21
|
+
Chevron: function() {
|
|
22
|
+
return _Chevron.default;
|
|
23
|
+
},
|
|
24
|
+
ErrorPill: function() {
|
|
25
|
+
return _ErrorPill.ErrorPill;
|
|
26
|
+
},
|
|
27
|
+
Menu: function() {
|
|
28
|
+
return _Menu.default;
|
|
29
|
+
},
|
|
30
|
+
MinimalTemplate: function() {
|
|
31
|
+
return _Minimal.default;
|
|
32
|
+
},
|
|
33
|
+
Pill: function() {
|
|
34
|
+
return _Pill.default;
|
|
35
|
+
},
|
|
36
|
+
Popup: function() {
|
|
37
|
+
return _Popup.default;
|
|
38
|
+
},
|
|
39
|
+
Search: function() {
|
|
40
|
+
return _Search.default;
|
|
41
|
+
},
|
|
42
|
+
ShimmerEffect: function() {
|
|
43
|
+
return _ShimmerEffect.ShimmerEffect;
|
|
44
|
+
},
|
|
45
|
+
Tooltip: function() {
|
|
46
|
+
return _Tooltip.default;
|
|
47
|
+
},
|
|
48
|
+
X: function() {
|
|
49
|
+
return _X.default;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const _Banner = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/elements/Banner"));
|
|
53
|
+
const _Button = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/elements/Button"));
|
|
54
|
+
const _ErrorPill = require("./dist/admin/components/elements/ErrorPill");
|
|
55
|
+
const _Pill = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/elements/Pill"));
|
|
56
|
+
const _Popup = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/elements/Popup"));
|
|
57
|
+
const _ShimmerEffect = require("./dist/admin/components/elements/ShimmerEffect");
|
|
58
|
+
const _Tooltip = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/elements/Tooltip"));
|
|
59
|
+
const _Check = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/icons/Check"));
|
|
60
|
+
const _Chevron = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/icons/Chevron"));
|
|
61
|
+
const _Menu = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/icons/Menu"));
|
|
62
|
+
const _Search = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/icons/Search"));
|
|
63
|
+
const _X = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/icons/X"));
|
|
64
|
+
const _Minimal = /*#__PURE__*/ _interop_require_default(require("./dist/admin/components/templates/Minimal"));
|
|
65
|
+
function _interop_require_default(obj) {
|
|
66
|
+
return obj && obj.__esModule ? obj : {
|
|
67
|
+
default: obj
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRzL2NvbXBvbmVudHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBCYW5uZXIgfSBmcm9tICcuLi9hZG1pbi9jb21wb25lbnRzL2VsZW1lbnRzL0Jhbm5lcidcbmV4cG9ydCB7IGRlZmF1bHQgYXMgQnV0dG9uIH0gZnJvbSAnLi4vYWRtaW4vY29tcG9uZW50cy9lbGVtZW50cy9CdXR0b24nXG5cbmV4cG9ydCB7IEVycm9yUGlsbCB9IGZyb20gJy4uL2FkbWluL2NvbXBvbmVudHMvZWxlbWVudHMvRXJyb3JQaWxsJ1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBQaWxsIH0gZnJvbSAnLi4vYWRtaW4vY29tcG9uZW50cy9lbGVtZW50cy9QaWxsJ1xuXG5leHBvcnQgeyBkZWZhdWx0IGFzIFBvcHVwIH0gZnJvbSAnLi4vYWRtaW4vY29tcG9uZW50cy9lbGVtZW50cy9Qb3B1cCdcblxuZXhwb3J0IHsgU2hpbW1lckVmZmVjdCB9IGZyb20gJy4uL2FkbWluL2NvbXBvbmVudHMvZWxlbWVudHMvU2hpbW1lckVmZmVjdCdcbmV4cG9ydCB7IGRlZmF1bHQgYXMgVG9vbHRpcCB9IGZyb20gJy4uL2FkbWluL2NvbXBvbmVudHMvZWxlbWVudHMvVG9vbHRpcCdcbmV4cG9ydCB7IGRlZmF1bHQgYXMgQ2hlY2sgfSBmcm9tICcuLi9hZG1pbi9jb21wb25lbnRzL2ljb25zL0NoZWNrJ1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBDaGV2cm9uIH0gZnJvbSAn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ytEQWRhOytEQUNBOzJCQUVSOzZEQUNNOzhEQUVDOytCQUVIO2dFQUNLOzhEQUNGO2dFQUNFOzZEQUNIOytEQUNFOzBEQUNMO2dFQUNjIn0=
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { buildConfig } from './dist/config/build.js';
|
|
2
|
+
export * from './dist/config/types.js';
|
|
3
|
+
export type { FieldTypes } from './dist/admin/forms/FieldTypes.js';
|
|
4
|
+
export { createClientCollectionConfig } from './dist/collections/config/client.js';
|
|
5
|
+
export { defaults as collectionDefaults } from './dist/collections/config/defaults.js';
|
|
6
|
+
export { createClientConfig } from './dist/config/client.js';
|
|
7
|
+
export { defaults } from './dist/config/defaults.js';
|
|
8
|
+
export { sanitizeConfig } from './dist/config/sanitize.js';
|
|
9
|
+
export { baseBlockFields } from './dist/fields/baseFields/baseBlockFields.js';
|
|
10
|
+
export { baseIDField } from './dist/fields/baseFields/baseIDField.js';
|
|
11
|
+
export { createClientFieldConfig } from './dist/fields/config/client.js';
|
|
12
|
+
export { sanitizeFields } from './dist/fields/config/sanitize.js';
|
|
13
|
+
export { createClientGlobalConfig } from './dist/globals/config/client.js';
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
package/config.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { buildConfig } from './dist/config/build.js';
|
|
2
|
+
export * from './dist/config/types.js';
|
|
3
|
+
export { createClientCollectionConfig } from './dist/collections/config/client.js';
|
|
4
|
+
export { defaults as collectionDefaults } from './dist/collections/config/defaults.js';
|
|
5
|
+
export { createClientConfig } from './dist/config/client.js';
|
|
6
|
+
export { defaults } from './dist/config/defaults.js';
|
|
7
|
+
export { sanitizeConfig } from './dist/config/sanitize.js';
|
|
8
|
+
export { baseBlockFields } from './dist/fields/baseFields/baseBlockFields.js';
|
|
9
|
+
export { baseIDField } from './dist/fields/baseFields/baseIDField.js';
|
|
10
|
+
export { createClientFieldConfig } from './dist/fields/config/client.js';
|
|
11
|
+
export { sanitizeFields } from './dist/fields/config/sanitize.js';
|
|
12
|
+
export { createClientGlobalConfig } from './dist/globals/config/client.js';
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=config.js.map
|
package/database.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type { BaseDatabaseAdapter, BeginTransaction, CommitTransaction, Connect, Create, CreateArgs, CreateGlobal, CreateGlobalArgs, CreateGlobalVersion, CreateGlobalVersionArgs, CreateMigration, CreateVersion, CreateVersionArgs, DBIdentifierName, DatabaseAdapterResult as DatabaseAdapterObj, DeleteMany, DeleteManyArgs, DeleteOne, DeleteOneArgs, DeleteVersions, DeleteVersionsArgs, Destroy, Find, FindArgs, FindGlobal, FindGlobalArgs, FindGlobalVersions, FindGlobalVersionsArgs, FindOne, FindOneArgs, FindVersions, FindVersionsArgs, Init, Migration, MigrationData, PaginatedDocs, QueryDrafts, QueryDraftsArgs, RollbackTransaction, Transaction, TypeWithVersion, UpdateGlobal, UpdateGlobalArgs, UpdateGlobalVersion, UpdateGlobalVersionArgs, UpdateOne, UpdateOneArgs, UpdateVersion, UpdateVersionArgs, } from './dist/database/types.js';
|
|
2
|
+
export * from './dist/database/queryValidation/types.js';
|
|
3
|
+
export { combineQueries } from './dist/database/combineQueries.js';
|
|
4
|
+
export { createDatabaseAdapter } from './dist/database/createDatabaseAdapter.js';
|
|
5
|
+
export { default as flattenWhereToOperators } from './dist/database/flattenWhereToOperators.js';
|
|
6
|
+
export { getLocalizedPaths } from './dist/database/getLocalizedPaths.js';
|
|
7
|
+
export { createMigration } from './dist/database/migrations/createMigration.js';
|
|
8
|
+
export { getMigrations } from './dist/database/migrations/getMigrations.js';
|
|
9
|
+
export { migrate } from './dist/database/migrations/migrate.js';
|
|
10
|
+
export { migrateDown } from './dist/database/migrations/migrateDown.js';
|
|
11
|
+
export { migrateRefresh } from './dist/database/migrations/migrateRefresh.js';
|
|
12
|
+
export { migrateReset } from './dist/database/migrations/migrateReset.js';
|
|
13
|
+
export { migrateStatus } from './dist/database/migrations/migrateStatus.js';
|
|
14
|
+
export { migrationTemplate } from './dist/database/migrations/migrationTemplate.js';
|
|
15
|
+
export { migrationsCollection } from './dist/database/migrations/migrationsCollection.js';
|
|
16
|
+
export { readMigrationFiles } from './dist/database/migrations/readMigrationFiles.js';
|
|
17
|
+
export type { EntityPolicies, PathToQuery } from './dist/database/queryValidation/types.js';
|
|
18
|
+
export { validateQueryPaths } from './dist/database/queryValidation/validateQueryPaths.js';
|
|
19
|
+
export { validateSearchParam } from './dist/database/queryValidation/validateSearchParams.js';
|
|
20
|
+
export { commitTransaction } from './dist/utilities/commitTransaction.js';
|
|
21
|
+
export { initTransaction } from './dist/utilities/initTransaction.js';
|
|
22
|
+
export { killTransaction } from './dist/utilities/killTransaction.js';
|
|
23
|
+
//# sourceMappingURL=database.d.ts.map
|
package/database.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './dist/database/queryValidation/types.js';
|
|
2
|
+
export { combineQueries } from './dist/database/combineQueries.js';
|
|
3
|
+
export { createDatabaseAdapter } from './dist/database/createDatabaseAdapter.js';
|
|
4
|
+
export { default as flattenWhereToOperators } from './dist/database/flattenWhereToOperators.js';
|
|
5
|
+
export { getLocalizedPaths } from './dist/database/getLocalizedPaths.js';
|
|
6
|
+
export { createMigration } from './dist/database/migrations/createMigration.js';
|
|
7
|
+
export { getMigrations } from './dist/database/migrations/getMigrations.js';
|
|
8
|
+
export { migrate } from './dist/database/migrations/migrate.js';
|
|
9
|
+
export { migrateDown } from './dist/database/migrations/migrateDown.js';
|
|
10
|
+
export { migrateRefresh } from './dist/database/migrations/migrateRefresh.js';
|
|
11
|
+
export { migrateReset } from './dist/database/migrations/migrateReset.js';
|
|
12
|
+
export { migrateStatus } from './dist/database/migrations/migrateStatus.js';
|
|
13
|
+
export { migrationTemplate } from './dist/database/migrations/migrationTemplate.js';
|
|
14
|
+
export { migrationsCollection } from './dist/database/migrations/migrationsCollection.js';
|
|
15
|
+
export { readMigrationFiles } from './dist/database/migrations/readMigrationFiles.js';
|
|
16
|
+
export { validateQueryPaths } from './dist/database/queryValidation/validateQueryPaths.js';
|
|
17
|
+
export { validateSearchParam } from './dist/database/queryValidation/validateSearchParams.js';
|
|
18
|
+
export { commitTransaction } from './dist/utilities/commitTransaction.js';
|
|
19
|
+
export { initTransaction } from './dist/utilities/initTransaction.js';
|
|
20
|
+
export { killTransaction } from './dist/utilities/killTransaction.js';
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageOptions.d.ts","sourceRoot":"","sources":["../../src/admin/LanguageOptions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/admin/LanguageOptions.ts"],"sourcesContent":["export type LanguageOptions = {\n label: string\n value: string\n}[]\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAGG"}
|
package/dist/admin/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { LanguageOptions } from './LanguageOptions.js';
|
|
1
2
|
export type { RichTextAdapter, RichTextAdapterProvider, RichTextFieldProps } from './RichText.js';
|
|
2
3
|
export type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js';
|
|
3
4
|
export type { ConditionalDateProps } from './elements/DatePicker.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/admin/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACjG,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACvF,YAAY,E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E,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,mCAAmC,CAAA;AAC1C,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,6BAA6B,CAAA;AACpC,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC3F,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEvE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEtE,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,eAAe,GAChB,MAAM,kBAAkB,CAAA"}
|
package/dist/admin/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["export type { RichTextAdapter, RichTextAdapterProvider, RichTextFieldProps } from './RichText.js'\nexport type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { CustomPreviewButton } from './elements/PreviewButton.js'\nexport type { CustomPublishButton } from './elements/PublishButton.js'\nexport type { CustomSaveButton } from './elements/SaveButton.js'\nexport type { CustomSaveDraftButton } from './elements/SaveDraftButton.js'\nexport type {\n DocumentTab,\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n DocumentTabProps,\n} from './elements/Tab.js'\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\nexport type { ErrorProps } from './forms/Error.js'\nexport type {\n Description,\n DescriptionComponent,\n DescriptionFunction,\n FieldDescriptionProps,\n} from './forms/FieldDescription.js'\nexport type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'\nexport type { LabelProps, SanitizedLabelProps } from './forms/Label.js'\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type {\n AdminViewComponent,\n AdminViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n"],"names":[],"rangeMappings":"","mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["export type { LanguageOptions } from './LanguageOptions.js'\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextFieldProps } from './RichText.js'\nexport type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { CustomPreviewButton } from './elements/PreviewButton.js'\nexport type { CustomPublishButton } from './elements/PublishButton.js'\nexport type { CustomSaveButton } from './elements/SaveButton.js'\nexport type { CustomSaveDraftButton } from './elements/SaveDraftButton.js'\nexport type {\n DocumentTab,\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n DocumentTabProps,\n} from './elements/Tab.js'\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\nexport type { ErrorProps } from './forms/Error.js'\nexport type {\n Description,\n DescriptionComponent,\n DescriptionFunction,\n FieldDescriptionProps,\n} from './forms/FieldDescription.js'\nexport type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'\nexport type { LabelProps, SanitizedLabelProps } from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type {\n AdminViewComponent,\n AdminViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n"],"names":[],"rangeMappings":"","mappings":"AAgCA,WAOyB"}
|
|
@@ -5,6 +5,7 @@ import type { SanitizedCollectionConfig } from '../../collections/config/types.j
|
|
|
5
5
|
import type { Locale } from '../../config/types.js';
|
|
6
6
|
import type { SanitizedGlobalConfig } from '../../globals/config/types.js';
|
|
7
7
|
import type { PayloadRequestWithData } from '../../types/index.js';
|
|
8
|
+
import type { LanguageOptions } from '../LanguageOptions.js';
|
|
8
9
|
export type AdminViewConfig = {
|
|
9
10
|
Component: AdminViewComponent;
|
|
10
11
|
/** Whether the path should be matched exactly or as a prefix */
|
|
@@ -37,6 +38,7 @@ export type InitPageResult = {
|
|
|
37
38
|
cookies: Map<string, string>;
|
|
38
39
|
docID?: string;
|
|
39
40
|
globalConfig?: SanitizedGlobalConfig;
|
|
41
|
+
languageOptions: LanguageOptions;
|
|
40
42
|
locale: Locale;
|
|
41
43
|
permissions: Permissions;
|
|
42
44
|
req: PayloadRequestWithData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/admin/views/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;A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AAG;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAA;IAChD,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,eAAe,EAAE,eAAe,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;IACxB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,YAAY,EAAE,wBAAwB,CAAA;IACtC,eAAe,EAAE,eAAe,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,EAAE,cAAc,CAAA;IAC9B,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAA;IACxD,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAA;CAC/D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/views/types.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { Locale } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\n\nexport type AdminViewConfig = {\n Component: AdminViewComponent\n /** Whether the path should be matched exactly or as a prefix */\n exact?: boolean\n path: string\n sensitive?: boolean\n strict?: boolean\n}\n\nexport type AdminViewProps = {\n initPageResult: InitPageResult\n params?: { [key: string]: string | string[] | undefined }\n searchParams: { [key: string]: string | string[] | undefined }\n}\n\nexport type AdminViewComponent = React.ComponentType<AdminViewProps>\n\nexport type AdminView = AdminViewComponent | AdminViewConfig\n\nexport type EditViewProps = {\n collectionSlug?: string\n globalSlug?: string\n}\n\nexport type VisibleEntities = {\n collections: SanitizedCollectionConfig['slug'][]\n globals: SanitizedGlobalConfig['slug'][]\n}\n\nexport type InitPageResult = {\n collectionConfig?: SanitizedCollectionConfig\n cookies: Map<string, string>\n docID?: string\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n permissions: Permissions\n req: PayloadRequestWithData\n translations: ClientTranslationsObject\n visibleEntities: VisibleEntities\n}\n\nexport type ServerSideEditViewProps = {\n initPageResult: InitPageResult\n params: { [key: string]: string | string[] | undefined }\n routeSegments: string[]\n searchParams: { [key: string]: string | string[] | undefined }\n}\n"],"names":[],"rangeMappings":"","mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/views/types.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { Locale } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\nimport type { LanguageOptions } from '../LanguageOptions.js'\n\nexport type AdminViewConfig = {\n Component: AdminViewComponent\n /** Whether the path should be matched exactly or as a prefix */\n exact?: boolean\n path: string\n sensitive?: boolean\n strict?: boolean\n}\n\nexport type AdminViewProps = {\n initPageResult: InitPageResult\n params?: { [key: string]: string | string[] | undefined }\n searchParams: { [key: string]: string | string[] | undefined }\n}\n\nexport type AdminViewComponent = React.ComponentType<AdminViewProps>\n\nexport type AdminView = AdminViewComponent | AdminViewConfig\n\nexport type EditViewProps = {\n collectionSlug?: string\n globalSlug?: string\n}\n\nexport type VisibleEntities = {\n collections: SanitizedCollectionConfig['slug'][]\n globals: SanitizedGlobalConfig['slug'][]\n}\n\nexport type InitPageResult = {\n collectionConfig?: SanitizedCollectionConfig\n cookies: Map<string, string>\n docID?: string\n globalConfig?: SanitizedGlobalConfig\n languageOptions: LanguageOptions\n locale: Locale\n permissions: Permissions\n req: PayloadRequestWithData\n translations: ClientTranslationsObject\n visibleEntities: VisibleEntities\n}\n\nexport type ServerSideEditViewProps = {\n initPageResult: InitPageResult\n params: { [key: string]: string | string[] | undefined }\n routeSegments: string[]\n searchParams: { [key: string]: string | string[] | undefined }\n}\n"],"names":[],"rangeMappings":"","mappings":"AAmDA,WAKC"}
|
|
@@ -17,7 +17,7 @@ export const registerLocalStrategy = async ({ collection, doc, password, payload
|
|
|
17
17
|
throw new ValidationError([
|
|
18
18
|
{
|
|
19
19
|
field: 'email',
|
|
20
|
-
message: '
|
|
20
|
+
message: req.t('error:userEmailAlreadyRegistered')
|
|
21
21
|
}
|
|
22
22
|
]);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/strategies/local/register.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequestWithData } from '../../../types/index.js'\n\nimport { ValidationError } from '../../../errors/index.js'\nimport { generatePasswordSaltHash } from './generatePasswordSaltHash.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: Record<string, unknown>\n password: string\n payload: Payload\n req: PayloadRequestWithData\n}\n\nexport const registerLocalStrategy = async ({\n collection,\n doc,\n password,\n payload,\n req,\n}: Args): Promise<Record<string, unknown>> => {\n const existingUser = await payload.find({\n collection: collection.slug,\n depth: 0,\n limit: 1,\n pagination: false,\n req,\n where: {\n email: {\n equals: doc.email,\n },\n },\n })\n\n if (existingUser.docs.length > 0) {\n throw new ValidationError([\n { field: 'email', message: '
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/strategies/local/register.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequestWithData } from '../../../types/index.js'\n\nimport { ValidationError } from '../../../errors/index.js'\nimport { generatePasswordSaltHash } from './generatePasswordSaltHash.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: Record<string, unknown>\n password: string\n payload: Payload\n req: PayloadRequestWithData\n}\n\nexport const registerLocalStrategy = async ({\n collection,\n doc,\n password,\n payload,\n req,\n}: Args): Promise<Record<string, unknown>> => {\n const existingUser = await payload.find({\n collection: collection.slug,\n depth: 0,\n limit: 1,\n pagination: false,\n req,\n where: {\n email: {\n equals: doc.email,\n },\n },\n })\n\n if (existingUser.docs.length > 0) {\n throw new ValidationError([\n { field: 'email', message: req.t('error:userEmailAlreadyRegistered') },\n ])\n }\n\n const { hash, salt } = await generatePasswordSaltHash({ password })\n\n const sanitizedDoc = { ...doc }\n if (sanitizedDoc.password) delete sanitizedDoc.password\n\n return payload.db.create({\n collection: collection.slug,\n data: {\n ...sanitizedDoc,\n hash,\n salt,\n },\n req,\n })\n}\n"],"names":["ValidationError","generatePasswordSaltHash","registerLocalStrategy","collection","doc","password","payload","req","existingUser","find","slug","depth","limit","pagination","where","email","equals","docs","length","field","message","t","hash","salt","sanitizedDoc","db","create","data"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,eAAe,QAAQ,2BAA0B;AAC1D,SAASC,wBAAwB,QAAQ,gCAA+B;AAUxE,OAAO,MAAMC,wBAAwB,OAAO,EAC1CC,UAAU,EACVC,GAAG,EACHC,QAAQ,EACRC,OAAO,EACPC,GAAG,EACE;IACL,MAAMC,eAAe,MAAMF,QAAQG,IAAI,CAAC;QACtCN,YAAYA,WAAWO,IAAI;QAC3BC,OAAO;QACPC,OAAO;QACPC,YAAY;QACZN;QACAO,OAAO;YACLC,OAAO;gBACLC,QAAQZ,IAAIW,KAAK;YACnB;QACF;IACF;IAEA,IAAIP,aAAaS,IAAI,CAACC,MAAM,GAAG,GAAG;QAChC,MAAM,IAAIlB,gBAAgB;YACxB;gBAAEmB,OAAO;gBAASC,SAASb,IAAIc,CAAC,CAAC;YAAoC;SACtE;IACH;IAEA,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAG,MAAMtB,yBAAyB;QAAEI;IAAS;IAEjE,MAAMmB,eAAe;QAAE,GAAGpB,GAAG;IAAC;IAC9B,IAAIoB,aAAanB,QAAQ,EAAE,OAAOmB,aAAanB,QAAQ;IAEvD,OAAOC,QAAQmB,EAAE,CAACC,MAAM,CAAC;QACvBvB,YAAYA,WAAWO,IAAI;QAC3BiB,MAAM;YACJ,GAAGH,YAAY;YACfF;YACAC;QACF;QACAhB;IACF;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/restoreVersion.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAahE,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,uBAAuB,qCAC5B,SAAS,KACd,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/restoreVersion.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAahE,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,uBAAuB,qCAC5B,SAAS,KACd,QAAQ,CAAC,CAmLX,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/operations/restoreVersion.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport httpStatus from 'http-status'\n\nimport type { FindOneArgs } from '../../database/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\nimport type { Collection, TypeWithID } from '../config/types.js'\n\nimport executeAccess from '../../auth/executeAccess.js'\nimport { hasWhereAccessResult } from '../../auth/types.js'\nimport { combineQueries } from '../../database/combineQueries.js'\nimport { APIError, Forbidden, NotFound } from '../../errors/index.js'\nimport { afterChange } from '../../fields/hooks/afterChange/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getLatestCollectionVersion } from '../../versions/getLatestCollectionVersion.js'\n\nexport type Arguments = {\n collection: Collection\n currentDepth?: number\n depth?: number\n disableErrors?: boolean\n id: number | string\n overrideAccess?: boolean\n req: PayloadRequestWithData\n showHiddenFields?: boolean\n}\n\nexport const restoreVersionOperation = async <T extends TypeWithID = any>(\n args: Arguments,\n): Promise<T> => {\n const {\n id,\n collection: { config: collectionConfig },\n depth,\n overrideAccess = false,\n req,\n req: { fallbackLocale, locale, payload },\n showHiddenFields,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n if (!id) {\n throw new APIError('Missing ID of version to restore.', httpStatus.BAD_REQUEST)\n }\n\n // /////////////////////////////////////\n // Retrieve original raw version\n // /////////////////////////////////////\n\n const { docs: versionDocs } = await req.payload.db.findVersions({\n collection: collectionConfig.slug,\n limit: 1,\n locale,\n req,\n where: { id: { equals: id } },\n })\n\n const [rawVersion] = versionDocs\n\n if (!rawVersion) {\n throw new NotFound(req.t)\n }\n\n const parentDocID = rawVersion.parent\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n const accessResults = !overrideAccess\n ? await executeAccess({ id: parentDocID, req }, collectionConfig.access.update)\n : true\n const hasWherePolicy = hasWhereAccessResult(accessResults)\n\n // /////////////////////////////////////\n // Retrieve document\n // /////////////////////////////////////\n\n const findOneArgs: FindOneArgs = {\n collection: collectionConfig.slug,\n locale,\n req,\n where: combineQueries({ id: { equals: parentDocID } }, accessResults),\n }\n\n const doc = await req.payload.db.findOne(findOneArgs)\n\n if (!doc && !hasWherePolicy) throw new NotFound(req.t)\n if (!doc && hasWherePolicy) throw new Forbidden(req.t)\n\n // /////////////////////////////////////\n // fetch previousDoc\n // /////////////////////////////////////\n\n const prevDocWithLocales = await getLatestCollectionVersion({\n id: parentDocID,\n config: collectionConfig,\n payload,\n query: findOneArgs,\n req,\n })\n\n // /////////////////////////////////////\n // Update\n // /////////////////////////////////////\n\n let result = await req.payload.db.updateOne({\n id: parentDocID,\n collection: collectionConfig.slug,\n data: rawVersion.version,\n req,\n })\n\n // /////////////////////////////////////\n // Save `previousDoc` as a version after restoring\n // /////////////////////////////////////\n\n const prevVersion = { ...prevDocWithLocales }\n\n delete prevVersion.id\n\n await payload.db.createVersion({\n autosave: false,\n collectionSlug: collectionConfig.slug,\n createdAt: prevVersion.createdAt,\n parent: parentDocID,\n req,\n updatedAt: new Date().toISOString(),\n versionData: rawVersion.version,\n })\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n result = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth,\n doc: result,\n draft: undefined,\n fallbackLocale,\n global: null,\n locale,\n overrideAccess,\n req,\n showHiddenFields,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n doc: result,\n req,\n })) || result\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterChange - Fields\n // /////////////////////////////////////\n\n result = await afterChange({\n collection: collectionConfig,\n context: req.context,\n data: result,\n doc: result,\n global: null,\n operation: 'update',\n previousDoc: prevDocWithLocales,\n req,\n })\n\n // /////////////////////////////////////\n // afterChange - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterChange.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n doc: result,\n operation: 'update',\n previousDoc: prevDocWithLocales,\n req,\n })) || result\n }, Promise.resolve())\n\n if (shouldCommit) await commitTransaction(req)\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["httpStatus","executeAccess","hasWhereAccessResult","combineQueries","APIError","Forbidden","NotFound","afterChange","afterRead","commitTransaction","initTransaction","killTransaction","getLatestCollectionVersion","restoreVersionOperation","args","id","collection","config","collectionConfig","depth","overrideAccess","req","fallbackLocale","locale","payload","showHiddenFields","shouldCommit","BAD_REQUEST","docs","versionDocs","db","findVersions","slug","limit","where","equals","rawVersion","t","parentDocID","parent","accessResults","access","update","hasWherePolicy","findOneArgs","doc","findOne","prevDocWithLocales","query","result","updateOne","data","version","prevVersion","createVersion","autosave","collectionSlug","createdAt","updatedAt","Date","toISOString","versionData","context","draft","undefined","global","hooks","reduce","priorHook","hook","Promise","resolve","operation","previousDoc","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,uCAAuC,GACvC,OAAOA,gBAAgB,cAAa;AAMpC,OAAOC,mBAAmB,8BAA6B;AACvD,SAASC,oBAAoB,QAAQ,sBAAqB;AAC1D,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,wBAAuB;AACrE,SAASC,WAAW,QAAQ,0CAAyC;AACrE,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,0BAA0B,QAAQ,+CAA8C;AAazF,OAAO,MAAMC,0BAA0B,OACrCC;IAEA,MAAM,EACJC,EAAE,EACFC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxCC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,GAAG,EACHA,KAAK,EAAEC,cAAc,EAAEC,MAAM,EAAEC,OAAO,EAAE,EACxCC,gBAAgB,EACjB,GAAGX;IAEJ,IAAI;QACF,MAAMY,eAAe,MAAMhB,gBAAgBW;QAE3C,IAAI,CAACN,IAAI;YACP,MAAM,IAAIX,SAAS,qCAAqCJ,WAAW2B,WAAW;QAChF;QAEA,wCAAwC;QACxC,gCAAgC;QAChC,wCAAwC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D;YAENnB,SACE,AAAC,MAAMoB,KAAK;gBACVrD,YAAYE;gBACZ4C,SAASzC,IAAIyC,OAAO;gBACpBjB,KAAKI;gBACLuB,WAAW;gBACXC,aAAa1B;gBACb1B;YACF,MAAO4B;QACX,GAAGqB,QAAQC,OAAO;QAElB,IAAI7C,cAAc,MAAMjB,kBAAkBY;QAE1C,OAAO4B;IACT,EAAE,OAAOyB,OAAgB;QACvB,MAAM/D,gBAAgBU;QACtB,MAAMqD;IACR;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/operations/restoreVersion.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport httpStatus from 'http-status'\n\nimport type { FindOneArgs } from '../../database/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\nimport type { Collection, TypeWithID } from '../config/types.js'\n\nimport executeAccess from '../../auth/executeAccess.js'\nimport { hasWhereAccessResult } from '../../auth/types.js'\nimport { combineQueries } from '../../database/combineQueries.js'\nimport { APIError, Forbidden, NotFound } from '../../errors/index.js'\nimport { afterChange } from '../../fields/hooks/afterChange/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getLatestCollectionVersion } from '../../versions/getLatestCollectionVersion.js'\n\nexport type Arguments = {\n collection: Collection\n currentDepth?: number\n depth?: number\n disableErrors?: boolean\n id: number | string\n overrideAccess?: boolean\n req: PayloadRequestWithData\n showHiddenFields?: boolean\n}\n\nexport const restoreVersionOperation = async <T extends TypeWithID = any>(\n args: Arguments,\n): Promise<T> => {\n const {\n id,\n collection: { config: collectionConfig },\n depth,\n overrideAccess = false,\n req,\n req: { fallbackLocale, locale, payload },\n showHiddenFields,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n if (!id) {\n throw new APIError('Missing ID of version to restore.', httpStatus.BAD_REQUEST)\n }\n\n // /////////////////////////////////////\n // Retrieve original raw version\n // /////////////////////////////////////\n\n const { docs: versionDocs } = await req.payload.db.findVersions({\n collection: collectionConfig.slug,\n limit: 1,\n locale,\n pagination: false,\n req,\n where: { id: { equals: id } },\n })\n\n const [rawVersion] = versionDocs\n\n if (!rawVersion) {\n throw new NotFound(req.t)\n }\n\n const parentDocID = rawVersion.parent\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n const accessResults = !overrideAccess\n ? await executeAccess({ id: parentDocID, req }, collectionConfig.access.update)\n : true\n const hasWherePolicy = hasWhereAccessResult(accessResults)\n\n // /////////////////////////////////////\n // Retrieve document\n // /////////////////////////////////////\n\n const findOneArgs: FindOneArgs = {\n collection: collectionConfig.slug,\n locale,\n req,\n where: combineQueries({ id: { equals: parentDocID } }, accessResults),\n }\n\n const doc = await req.payload.db.findOne(findOneArgs)\n\n if (!doc && !hasWherePolicy) throw new NotFound(req.t)\n if (!doc && hasWherePolicy) throw new Forbidden(req.t)\n\n // /////////////////////////////////////\n // fetch previousDoc\n // /////////////////////////////////////\n\n const prevDocWithLocales = await getLatestCollectionVersion({\n id: parentDocID,\n config: collectionConfig,\n payload,\n query: findOneArgs,\n req,\n })\n\n // /////////////////////////////////////\n // Update\n // /////////////////////////////////////\n\n let result = await req.payload.db.updateOne({\n id: parentDocID,\n collection: collectionConfig.slug,\n data: rawVersion.version,\n req,\n })\n\n // /////////////////////////////////////\n // Save `previousDoc` as a version after restoring\n // /////////////////////////////////////\n\n const prevVersion = { ...prevDocWithLocales }\n\n delete prevVersion.id\n\n await payload.db.createVersion({\n autosave: false,\n collectionSlug: collectionConfig.slug,\n createdAt: prevVersion.createdAt,\n parent: parentDocID,\n req,\n updatedAt: new Date().toISOString(),\n versionData: rawVersion.version,\n })\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n result = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth,\n doc: result,\n draft: undefined,\n fallbackLocale,\n global: null,\n locale,\n overrideAccess,\n req,\n showHiddenFields,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n doc: result,\n req,\n })) || result\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterChange - Fields\n // /////////////////////////////////////\n\n result = await afterChange({\n collection: collectionConfig,\n context: req.context,\n data: result,\n doc: result,\n global: null,\n operation: 'update',\n previousDoc: prevDocWithLocales,\n req,\n })\n\n // /////////////////////////////////////\n // afterChange - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterChange.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n doc: result,\n operation: 'update',\n previousDoc: prevDocWithLocales,\n req,\n })) || result\n }, Promise.resolve())\n\n if (shouldCommit) await commitTransaction(req)\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["httpStatus","executeAccess","hasWhereAccessResult","combineQueries","APIError","Forbidden","NotFound","afterChange","afterRead","commitTransaction","initTransaction","killTransaction","getLatestCollectionVersion","restoreVersionOperation","args","id","collection","config","collectionConfig","depth","overrideAccess","req","fallbackLocale","locale","payload","showHiddenFields","shouldCommit","BAD_REQUEST","docs","versionDocs","db","findVersions","slug","limit","pagination","where","equals","rawVersion","t","parentDocID","parent","accessResults","access","update","hasWherePolicy","findOneArgs","doc","findOne","prevDocWithLocales","query","result","updateOne","data","version","prevVersion","createVersion","autosave","collectionSlug","createdAt","updatedAt","Date","toISOString","versionData","context","draft","undefined","global","hooks","reduce","priorHook","hook","Promise","resolve","operation","previousDoc","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
|
1
|
+
import type { Payload } from '../../index.js';
|
|
2
|
+
import type { MigrationTemplateArgs } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get predefined migration 'up', 'down' and 'imports'
|
|
5
|
+
*/
|
|
6
|
+
export declare const getPredefinedMigration: ({ dirname, file, migrationName: migrationNameArg, payload, }: {
|
|
7
|
+
dirname: string;
|
|
8
|
+
file?: string;
|
|
9
|
+
migrationName?: string;
|
|
10
|
+
payload: Payload;
|
|
11
|
+
}) => Promise<MigrationTemplateArgs>;
|
|
12
|
+
//# sourceMappingURL=getPredefinedMigration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPredefinedMigration.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/getPredefinedMigration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,sBAAsB,iEAKhC;IACD,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,QAAQ,qBAAqB,CA8BhC,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
4
|
+
/**
|
|
5
|
+
* Get predefined migration 'up', 'down' and 'imports'
|
|
6
|
+
*/ export const getPredefinedMigration = async ({ dirname, file, migrationName: migrationNameArg, payload })=>{
|
|
7
|
+
// Check for predefined migration.
|
|
8
|
+
// Either passed in via --file or prefixed with '@payloadcms/db-mongodb/' for example
|
|
9
|
+
if (file || migrationNameArg?.startsWith('@payloadcms/')) {
|
|
10
|
+
// removes the package name from the migrationName.
|
|
11
|
+
const migrationName = (file || migrationNameArg).split('/').slice(2).join('/');
|
|
12
|
+
let cleanPath = path.join(dirname, `./predefinedMigrations/${migrationName}.mjs`);
|
|
13
|
+
// Check if predefined migration exists
|
|
14
|
+
if (fs.existsSync(cleanPath)) {
|
|
15
|
+
cleanPath = cleanPath.replaceAll('\\', '/');
|
|
16
|
+
const moduleURL = pathToFileURL(cleanPath);
|
|
17
|
+
try {
|
|
18
|
+
const { downSQL, imports, upSQL } = await import(moduleURL.href);
|
|
19
|
+
return {
|
|
20
|
+
downSQL,
|
|
21
|
+
imports,
|
|
22
|
+
upSQL
|
|
23
|
+
};
|
|
24
|
+
} catch (error) {
|
|
25
|
+
payload.logger.error({
|
|
26
|
+
error,
|
|
27
|
+
msg: `Error loading predefined migration ${migrationName}`
|
|
28
|
+
});
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
payload.logger.error({
|
|
33
|
+
msg: `Canned migration ${migrationName} not found.`
|
|
34
|
+
});
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return {};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=getPredefinedMigration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/database/migrations/getPredefinedMigration.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport { pathToFileURL } from 'url'\n\nimport type { Payload } from '../../index.js'\nimport type { MigrationTemplateArgs } from '../types.js'\n\n/**\n * Get predefined migration 'up', 'down' and 'imports'\n */\nexport const getPredefinedMigration = async ({\n dirname,\n file,\n migrationName: migrationNameArg,\n payload,\n}: {\n dirname: string\n file?: string\n migrationName?: string\n payload: Payload\n}): Promise<MigrationTemplateArgs> => {\n // Check for predefined migration.\n // Either passed in via --file or prefixed with '@payloadcms/db-mongodb/' for example\n if (file || migrationNameArg?.startsWith('@payloadcms/')) {\n // removes the package name from the migrationName.\n const migrationName = (file || migrationNameArg).split('/').slice(2).join('/')\n let cleanPath = path.join(dirname, `./predefinedMigrations/${migrationName}.mjs`)\n\n // Check if predefined migration exists\n if (fs.existsSync(cleanPath)) {\n cleanPath = cleanPath.replaceAll('\\\\', '/')\n const moduleURL = pathToFileURL(cleanPath)\n try {\n const { downSQL, imports, upSQL } = await import(moduleURL.href)\n return { downSQL, imports, upSQL }\n } catch (error) {\n payload.logger.error({\n error,\n msg: `Error loading predefined migration ${migrationName}`,\n })\n process.exit(1)\n }\n } else {\n payload.logger.error({\n msg: `Canned migration ${migrationName} not found.`,\n })\n process.exit(1)\n }\n }\n return {}\n}\n"],"names":["fs","path","pathToFileURL","getPredefinedMigration","dirname","file","migrationName","migrationNameArg","payload","startsWith","split","slice","join","cleanPath","existsSync","replaceAll","moduleURL","downSQL","imports","upSQL","href","error","logger","msg","process","exit"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,SAASC,aAAa,QAAQ,MAAK;AAKnC;;CAEC,GACD,OAAO,MAAMC,yBAAyB,OAAO,EAC3CC,OAAO,EACPC,IAAI,EACJC,eAAeC,gBAAgB,EAC/BC,OAAO,EAMR;IACC,kCAAkC;IAClC,qFAAqF;IACrF,IAAIH,QAAQE,kBAAkBE,WAAW,iBAAiB;QACxD,mDAAmD;QACnD,MAAMH,gBAAgB,AAACD,CAAAA,QAAQE,gBAAe,EAAGG,KAAK,CAAC,KAAKC,KAAK,CAAC,GAAGC,IAAI,CAAC;QAC1E,IAAIC,YAAYZ,KAAKW,IAAI,CAACR,SAAS,CAAC,uBAAuB,EAAEE,cAAc,IAAI,CAAC;QAEhF,uCAAuC;QACvC,IAAIN,GAAGc,UAAU,CAACD,YAAY;YAC5BA,YAAYA,UAAUE,UAAU,CAAC,MAAM;YACvC,MAAMC,YAAYd,cAAcW;YAChC,IAAI;gBACF,MAAM,EAAEI,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAG,MAAM,MAAM,CAACH,UAAUI,IAAI;gBAC/D,OAAO;oBAAEH;oBAASC;oBAASC;gBAAM;YACnC,EAAE,OAAOE,OAAO;gBACdb,QAAQc,MAAM,CAACD,KAAK,CAAC;oBACnBA;oBACAE,KAAK,CAAC,mCAAmC,EAAEjB,cAAc,CAAC;gBAC5D;gBACAkB,QAAQC,IAAI,CAAC;YACf;QACF,OAAO;YACLjB,QAAQc,MAAM,CAACD,KAAK,CAAC;gBACnBE,KAAK,CAAC,iBAAiB,EAAEjB,cAAc,WAAW,CAAC;YACrD;YACAkB,QAAQC,IAAI,CAAC;QACf;IACF;IACA,OAAO,CAAC;AACV,EAAC"}
|
package/dist/database/types.d.ts
CHANGED
|
@@ -331,4 +331,9 @@ export type DBIdentifierName = ((Args: {
|
|
|
331
331
|
/** The name of the parent table when using relational DBs */
|
|
332
332
|
tableName?: string;
|
|
333
333
|
}) => string) | string;
|
|
334
|
+
export type MigrationTemplateArgs = {
|
|
335
|
+
downSQL?: string;
|
|
336
|
+
imports?: string;
|
|
337
|
+
upSQL?: string;
|
|
338
|
+
};
|
|
334
339
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/database/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,YAAY,EAAE,eAAe,EAAE,CAAA;AAE/B,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,gBAAgB,CAAC,EAAE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AK,CAAC,EAAE,MAAM,CAAA;IACd,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI;IACnC,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,mBAAmB,IAAI;IAC3D,aAAa,EAAE,QAAQ,GAAG,MAAM,CAAA;IAChC,IAAI,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,CAAC,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,gBAAgB,GACxB,CAAC,CAAC,IAAI,EAAE;IACN,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KAAK,MAAM,CAAC,GACb,MAAM,CAAA;AAEV,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/database/types.ts"],"sourcesContent":["import type { TypeWithID } from '../collections/config/types.js'\nimport type { TypeWithID as GlobalsTypeWithID } from '../globals/config/types.js'\nimport type { Document, Payload, PayloadRequestWithData, Where } from '../types/index.js'\nimport type { TypeWithVersion } from '../versions/types.js'\n\nexport type { TypeWithVersion }\n\nexport interface BaseDatabaseAdapter {\n /**\n * Start a transaction, requiring commitTransaction() to be called for any changes to be made.\n * @returns an identifier for the transaction or null if one cannot be established\n */\n beginTransaction?: BeginTransaction\n /**\n * Persist the changes made since the start of the transaction.\n */\n commitTransaction?: CommitTransaction\n\n /**\n * Open the connection to the database\n */\n connect?: Connect\n\n count: Count\n\n create: Create\n\n createGlobal: CreateGlobal\n\n createGlobalVersion: CreateGlobalVersion\n /**\n * Output a migration file\n */\n createMigration: CreateMigration\n\n createVersion: CreateVersion\n\n /**\n * Specify if the ID is a text or number field by default within this database adapter.\n */\n defaultIDType: 'number' | 'text'\n\n deleteMany: DeleteMany\n\n deleteOne: DeleteOne\n\n deleteVersions: DeleteVersions\n\n /**\n * Terminate the connection with the database\n */\n destroy?: Destroy\n\n find: <T = TypeWithID>(args: FindArgs) => Promise<PaginatedDocs<T>>\n\n findGlobal: FindGlobal\n\n findGlobalVersions: FindGlobalVersions\n\n findOne: FindOne\n\n findVersions: FindVersions\n\n /**\n * Perform startup tasks required to interact with the database such as building Schema and models\n */\n init?: Init\n\n /**\n * Run any migration up functions that have not yet been performed and update the status\n */\n migrate: () => Promise<void>\n\n /**\n * Run any migration down functions that have been performed\n */\n migrateDown: () => Promise<void>\n\n /**\n * Drop the current database and run all migrate up functions\n */\n migrateFresh: (args: { forceAcceptWarning?: boolean }) => Promise<void>\n /**\n * Run all migration down functions before running up\n */\n migrateRefresh: () => Promise<void>\n\n /**\n * Run all migrate down functions\n */\n migrateReset: () => Promise<void>\n /**\n * Read the current state of migrations and output the result to show which have been run\n */\n migrateStatus: () => Promise<void>\n /**\n * Path to read and write migration files from\n */\n migrationDir: string\n /**\n * The name of the database adapter\n */\n name: string\n /**\n * reference to the instance of payload\n */\n payload: Payload\n\n queryDrafts: QueryDrafts\n /**\n * Abort any changes since the start of the transaction.\n */\n rollbackTransaction?: RollbackTransaction\n /**\n * A key-value store of all sessions open (used for transactions)\n */\n sessions?: {\n [id: string]: {\n db: unknown\n reject: () => Promise<void>\n resolve: () => Promise<void>\n }\n }\n\n updateGlobal: UpdateGlobal\n\n updateGlobalVersion: UpdateGlobalVersion\n\n updateOne: UpdateOne\n\n updateVersion: UpdateVersion\n}\n\nexport type Init = () => Promise<void> | void\n\ntype ConnectArgs = {\n hotReload: boolean\n}\n\nexport type Connect = (args?: ConnectArgs) => Promise<void>\n\nexport type Destroy = () => Promise<void>\n\nexport type CreateMigration = (args: {\n file?: string\n /**\n * Skips the prompt asking to create empty migrations\n */\n forceAcceptWarning?: boolean\n migrationName?: string\n payload: Payload\n}) => Promise<void>\n\nexport type Transaction = (\n callback: () => Promise<void>,\n options?: Record<string, unknown>,\n) => Promise<void>\n\nexport type BeginTransaction = (\n options?: Record<string, unknown>,\n) => Promise<null | number | string>\n\nexport type RollbackTransaction = (id: number | string) => Promise<void>\n\nexport type CommitTransaction = (id: number | string) => Promise<void>\n\nexport type QueryDraftsArgs = {\n collection: string\n limit?: number\n locale?: string\n page?: number\n pagination?: boolean\n req: PayloadRequestWithData\n sort?: string\n where?: Where\n}\n\nexport type QueryDrafts = <T = TypeWithID>(args: QueryDraftsArgs) => Promise<PaginatedDocs<T>>\n\nexport type FindOneArgs = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n where?: Where\n}\n\nexport type FindOne = <T extends TypeWithID>(args: FindOneArgs) => Promise<T | null>\n\nexport type FindArgs = {\n collection: string\n /** Setting limit to 1 is equal to the previous Model.findOne(). Setting limit to 0 disables the limit */\n limit?: number\n locale?: string\n page?: number\n pagination?: boolean\n req: PayloadRequestWithData\n skip?: number\n sort?: string\n versions?: boolean\n where?: Where\n}\n\nexport type Find = <T = TypeWithID>(args: FindArgs) => Promise<PaginatedDocs<T>>\n\nexport type CountArgs = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n where?: Where\n}\n\nexport type Count = (args: CountArgs) => Promise<{ totalDocs: number }>\n\ntype BaseVersionArgs = {\n limit?: number\n locale?: string\n page?: number\n pagination?: boolean\n req: PayloadRequestWithData\n skip?: number\n sort?: string\n versions?: boolean\n where?: Where\n}\n\nexport type FindVersionsArgs = BaseVersionArgs & {\n collection: string\n}\n\nexport type FindVersions = <T = TypeWithID>(\n args: FindVersionsArgs,\n) => Promise<PaginatedDocs<TypeWithVersion<T>>>\n\nexport type FindGlobalVersionsArgs = BaseVersionArgs & {\n global: string\n}\n\nexport type FindGlobalArgs = {\n locale?: string\n req: PayloadRequestWithData\n slug: string\n where?: Where\n}\n\nexport type UpdateGlobalVersionArgs<T = TypeWithID> = {\n global: string\n locale?: string\n req: PayloadRequestWithData\n versionData: T\n} & (\n | {\n id: number | string\n where?: never\n }\n | {\n id?: never\n where: Where\n }\n)\n\nexport type UpdateGlobalVersion = <T extends TypeWithID = TypeWithID>(\n args: UpdateGlobalVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type FindGlobal = <T extends GlobalsTypeWithID = any>(args: FindGlobalArgs) => Promise<T>\n\nexport type CreateGlobalArgs<T extends GlobalsTypeWithID = any> = {\n data: T\n req: PayloadRequestWithData\n slug: string\n}\nexport type CreateGlobal = <T extends GlobalsTypeWithID = any>(\n args: CreateGlobalArgs<T>,\n) => Promise<T>\n\nexport type UpdateGlobalArgs<T extends GlobalsTypeWithID = any> = {\n data: T\n req: PayloadRequestWithData\n slug: string\n}\nexport type UpdateGlobal = <T extends GlobalsTypeWithID = any>(\n args: UpdateGlobalArgs<T>,\n) => Promise<T>\n// export type UpdateOne = (args: UpdateOneArgs) => Promise<Document>\n\nexport type FindGlobalVersions = <T = TypeWithID>(\n args: FindGlobalVersionsArgs,\n) => Promise<PaginatedDocs<TypeWithVersion<T>>>\n\nexport type DeleteVersionsArgs = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n sort?: {\n [key: string]: string\n }\n where: Where\n}\n\nexport type CreateVersionArgs<T = TypeWithID> = {\n autosave: boolean\n collectionSlug: string\n createdAt: string\n /** ID of the parent document for which the version should be created for */\n parent: number | string\n req: PayloadRequestWithData\n updatedAt: string\n versionData: T\n}\n\nexport type CreateVersion = <T extends TypeWithID = TypeWithID>(\n args: CreateVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type CreateGlobalVersionArgs<T = TypeWithID> = {\n autosave: boolean\n createdAt: string\n globalSlug: string\n /** ID of the parent document for which the version should be created for */\n parent: number | string\n req: PayloadRequestWithData\n updatedAt: string\n versionData: T\n}\n\nexport type CreateGlobalVersion = <T extends TypeWithID = TypeWithID>(\n args: CreateGlobalVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type DeleteVersions = (args: DeleteVersionsArgs) => Promise<void>\n\nexport type UpdateVersionArgs<T = TypeWithID> = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n versionData: T\n} & (\n | {\n id: number | string\n where?: never\n }\n | {\n id?: never\n where: Where\n }\n)\n\nexport type UpdateVersion = <T extends TypeWithID = TypeWithID>(\n args: UpdateVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type CreateArgs = {\n collection: string\n data: Record<string, unknown>\n draft?: boolean\n locale?: string\n req: PayloadRequestWithData\n}\n\nexport type Create = (args: CreateArgs) => Promise<Document>\n\nexport type UpdateOneArgs = {\n collection: string\n data: Record<string, unknown>\n draft?: boolean\n locale?: string\n req: PayloadRequestWithData\n} & (\n | {\n id: number | string\n where?: never\n }\n | {\n id?: never\n where: Where\n }\n)\n\nexport type UpdateOne = (args: UpdateOneArgs) => Promise<Document>\n\nexport type DeleteOneArgs = {\n collection: string\n req: PayloadRequestWithData\n where: Where\n}\n\nexport type DeleteOne = (args: DeleteOneArgs) => Promise<Document>\n\nexport type DeleteManyArgs = {\n collection: string\n req: PayloadRequestWithData\n where: Where\n}\n\nexport type DeleteMany = (args: DeleteManyArgs) => Promise<void>\n\nexport type Migration = MigrationData & {\n down: ({ payload, req }: { payload: Payload; req: PayloadRequestWithData }) => Promise<boolean>\n up: ({ payload, req }: { payload: Payload; req: PayloadRequestWithData }) => Promise<boolean>\n}\n\nexport type MigrationData = {\n batch?: number\n id?: string\n name: string\n}\n\nexport type PaginatedDocs<T = any> = {\n docs: T[]\n hasNextPage: boolean\n hasPrevPage: boolean\n limit: number\n nextPage?: null | number | undefined\n page?: number\n pagingCounter: number\n prevPage?: null | number | undefined\n totalDocs: number\n totalPages: number\n}\n\nexport type DatabaseAdapterResult<T = BaseDatabaseAdapter> = {\n defaultIDType: 'number' | 'text'\n init: (args: { payload: Payload }) => T\n}\n\nexport type DBIdentifierName =\n | ((Args: {\n /** The name of the parent table when using relational DBs */\n tableName?: string\n }) => string)\n | string\n"],"names":[],"rangeMappings":"","mappings":"AAyaA,WAKU"}
|
|
1
|
+
{"version":3,"sources":["../../src/database/types.ts"],"sourcesContent":["import type { TypeWithID } from '../collections/config/types.js'\nimport type { TypeWithID as GlobalsTypeWithID } from '../globals/config/types.js'\nimport type { Document, Payload, PayloadRequestWithData, Where } from '../types/index.js'\nimport type { TypeWithVersion } from '../versions/types.js'\n\nexport type { TypeWithVersion }\n\nexport interface BaseDatabaseAdapter {\n /**\n * Start a transaction, requiring commitTransaction() to be called for any changes to be made.\n * @returns an identifier for the transaction or null if one cannot be established\n */\n beginTransaction?: BeginTransaction\n /**\n * Persist the changes made since the start of the transaction.\n */\n commitTransaction?: CommitTransaction\n\n /**\n * Open the connection to the database\n */\n connect?: Connect\n\n count: Count\n\n create: Create\n\n createGlobal: CreateGlobal\n\n createGlobalVersion: CreateGlobalVersion\n /**\n * Output a migration file\n */\n createMigration: CreateMigration\n\n createVersion: CreateVersion\n\n /**\n * Specify if the ID is a text or number field by default within this database adapter.\n */\n defaultIDType: 'number' | 'text'\n\n deleteMany: DeleteMany\n\n deleteOne: DeleteOne\n\n deleteVersions: DeleteVersions\n\n /**\n * Terminate the connection with the database\n */\n destroy?: Destroy\n\n find: <T = TypeWithID>(args: FindArgs) => Promise<PaginatedDocs<T>>\n\n findGlobal: FindGlobal\n\n findGlobalVersions: FindGlobalVersions\n\n findOne: FindOne\n\n findVersions: FindVersions\n\n /**\n * Perform startup tasks required to interact with the database such as building Schema and models\n */\n init?: Init\n\n /**\n * Run any migration up functions that have not yet been performed and update the status\n */\n migrate: () => Promise<void>\n\n /**\n * Run any migration down functions that have been performed\n */\n migrateDown: () => Promise<void>\n\n /**\n * Drop the current database and run all migrate up functions\n */\n migrateFresh: (args: { forceAcceptWarning?: boolean }) => Promise<void>\n /**\n * Run all migration down functions before running up\n */\n migrateRefresh: () => Promise<void>\n\n /**\n * Run all migrate down functions\n */\n migrateReset: () => Promise<void>\n /**\n * Read the current state of migrations and output the result to show which have been run\n */\n migrateStatus: () => Promise<void>\n /**\n * Path to read and write migration files from\n */\n migrationDir: string\n /**\n * The name of the database adapter\n */\n name: string\n /**\n * reference to the instance of payload\n */\n payload: Payload\n\n queryDrafts: QueryDrafts\n /**\n * Abort any changes since the start of the transaction.\n */\n rollbackTransaction?: RollbackTransaction\n /**\n * A key-value store of all sessions open (used for transactions)\n */\n sessions?: {\n [id: string]: {\n db: unknown\n reject: () => Promise<void>\n resolve: () => Promise<void>\n }\n }\n\n updateGlobal: UpdateGlobal\n\n updateGlobalVersion: UpdateGlobalVersion\n\n updateOne: UpdateOne\n\n updateVersion: UpdateVersion\n}\n\nexport type Init = () => Promise<void> | void\n\ntype ConnectArgs = {\n hotReload: boolean\n}\n\nexport type Connect = (args?: ConnectArgs) => Promise<void>\n\nexport type Destroy = () => Promise<void>\n\nexport type CreateMigration = (args: {\n file?: string\n /**\n * Skips the prompt asking to create empty migrations\n */\n forceAcceptWarning?: boolean\n migrationName?: string\n payload: Payload\n}) => Promise<void>\n\nexport type Transaction = (\n callback: () => Promise<void>,\n options?: Record<string, unknown>,\n) => Promise<void>\n\nexport type BeginTransaction = (\n options?: Record<string, unknown>,\n) => Promise<null | number | string>\n\nexport type RollbackTransaction = (id: number | string) => Promise<void>\n\nexport type CommitTransaction = (id: number | string) => Promise<void>\n\nexport type QueryDraftsArgs = {\n collection: string\n limit?: number\n locale?: string\n page?: number\n pagination?: boolean\n req: PayloadRequestWithData\n sort?: string\n where?: Where\n}\n\nexport type QueryDrafts = <T = TypeWithID>(args: QueryDraftsArgs) => Promise<PaginatedDocs<T>>\n\nexport type FindOneArgs = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n where?: Where\n}\n\nexport type FindOne = <T extends TypeWithID>(args: FindOneArgs) => Promise<T | null>\n\nexport type FindArgs = {\n collection: string\n /** Setting limit to 1 is equal to the previous Model.findOne(). Setting limit to 0 disables the limit */\n limit?: number\n locale?: string\n page?: number\n pagination?: boolean\n req: PayloadRequestWithData\n skip?: number\n sort?: string\n versions?: boolean\n where?: Where\n}\n\nexport type Find = <T = TypeWithID>(args: FindArgs) => Promise<PaginatedDocs<T>>\n\nexport type CountArgs = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n where?: Where\n}\n\nexport type Count = (args: CountArgs) => Promise<{ totalDocs: number }>\n\ntype BaseVersionArgs = {\n limit?: number\n locale?: string\n page?: number\n pagination?: boolean\n req: PayloadRequestWithData\n skip?: number\n sort?: string\n versions?: boolean\n where?: Where\n}\n\nexport type FindVersionsArgs = BaseVersionArgs & {\n collection: string\n}\n\nexport type FindVersions = <T = TypeWithID>(\n args: FindVersionsArgs,\n) => Promise<PaginatedDocs<TypeWithVersion<T>>>\n\nexport type FindGlobalVersionsArgs = BaseVersionArgs & {\n global: string\n}\n\nexport type FindGlobalArgs = {\n locale?: string\n req: PayloadRequestWithData\n slug: string\n where?: Where\n}\n\nexport type UpdateGlobalVersionArgs<T = TypeWithID> = {\n global: string\n locale?: string\n req: PayloadRequestWithData\n versionData: T\n} & (\n | {\n id: number | string\n where?: never\n }\n | {\n id?: never\n where: Where\n }\n)\n\nexport type UpdateGlobalVersion = <T extends TypeWithID = TypeWithID>(\n args: UpdateGlobalVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type FindGlobal = <T extends GlobalsTypeWithID = any>(args: FindGlobalArgs) => Promise<T>\n\nexport type CreateGlobalArgs<T extends GlobalsTypeWithID = any> = {\n data: T\n req: PayloadRequestWithData\n slug: string\n}\nexport type CreateGlobal = <T extends GlobalsTypeWithID = any>(\n args: CreateGlobalArgs<T>,\n) => Promise<T>\n\nexport type UpdateGlobalArgs<T extends GlobalsTypeWithID = any> = {\n data: T\n req: PayloadRequestWithData\n slug: string\n}\nexport type UpdateGlobal = <T extends GlobalsTypeWithID = any>(\n args: UpdateGlobalArgs<T>,\n) => Promise<T>\n// export type UpdateOne = (args: UpdateOneArgs) => Promise<Document>\n\nexport type FindGlobalVersions = <T = TypeWithID>(\n args: FindGlobalVersionsArgs,\n) => Promise<PaginatedDocs<TypeWithVersion<T>>>\n\nexport type DeleteVersionsArgs = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n sort?: {\n [key: string]: string\n }\n where: Where\n}\n\nexport type CreateVersionArgs<T = TypeWithID> = {\n autosave: boolean\n collectionSlug: string\n createdAt: string\n /** ID of the parent document for which the version should be created for */\n parent: number | string\n req: PayloadRequestWithData\n updatedAt: string\n versionData: T\n}\n\nexport type CreateVersion = <T extends TypeWithID = TypeWithID>(\n args: CreateVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type CreateGlobalVersionArgs<T = TypeWithID> = {\n autosave: boolean\n createdAt: string\n globalSlug: string\n /** ID of the parent document for which the version should be created for */\n parent: number | string\n req: PayloadRequestWithData\n updatedAt: string\n versionData: T\n}\n\nexport type CreateGlobalVersion = <T extends TypeWithID = TypeWithID>(\n args: CreateGlobalVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type DeleteVersions = (args: DeleteVersionsArgs) => Promise<void>\n\nexport type UpdateVersionArgs<T = TypeWithID> = {\n collection: string\n locale?: string\n req: PayloadRequestWithData\n versionData: T\n} & (\n | {\n id: number | string\n where?: never\n }\n | {\n id?: never\n where: Where\n }\n)\n\nexport type UpdateVersion = <T extends TypeWithID = TypeWithID>(\n args: UpdateVersionArgs<T>,\n) => Promise<TypeWithVersion<T>>\n\nexport type CreateArgs = {\n collection: string\n data: Record<string, unknown>\n draft?: boolean\n locale?: string\n req: PayloadRequestWithData\n}\n\nexport type Create = (args: CreateArgs) => Promise<Document>\n\nexport type UpdateOneArgs = {\n collection: string\n data: Record<string, unknown>\n draft?: boolean\n locale?: string\n req: PayloadRequestWithData\n} & (\n | {\n id: number | string\n where?: never\n }\n | {\n id?: never\n where: Where\n }\n)\n\nexport type UpdateOne = (args: UpdateOneArgs) => Promise<Document>\n\nexport type DeleteOneArgs = {\n collection: string\n req: PayloadRequestWithData\n where: Where\n}\n\nexport type DeleteOne = (args: DeleteOneArgs) => Promise<Document>\n\nexport type DeleteManyArgs = {\n collection: string\n req: PayloadRequestWithData\n where: Where\n}\n\nexport type DeleteMany = (args: DeleteManyArgs) => Promise<void>\n\nexport type Migration = MigrationData & {\n down: ({ payload, req }: { payload: Payload; req: PayloadRequestWithData }) => Promise<boolean>\n up: ({ payload, req }: { payload: Payload; req: PayloadRequestWithData }) => Promise<boolean>\n}\n\nexport type MigrationData = {\n batch?: number\n id?: string\n name: string\n}\n\nexport type PaginatedDocs<T = any> = {\n docs: T[]\n hasNextPage: boolean\n hasPrevPage: boolean\n limit: number\n nextPage?: null | number | undefined\n page?: number\n pagingCounter: number\n prevPage?: null | number | undefined\n totalDocs: number\n totalPages: number\n}\n\nexport type DatabaseAdapterResult<T = BaseDatabaseAdapter> = {\n defaultIDType: 'number' | 'text'\n init: (args: { payload: Payload }) => T\n}\n\nexport type DBIdentifierName =\n | ((Args: {\n /** The name of the parent table when using relational DBs */\n tableName?: string\n }) => string)\n | string\n\nexport type MigrationTemplateArgs = {\n downSQL?: string\n imports?: string\n upSQL?: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAgbA,WAIC"}
|