@strapi/database 5.0.0-beta.1 → 5.0.0-beta.2
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/dist/entity-manager/index.d.ts.map +1 -1
- package/dist/entity-manager/relations-orderer.d.ts.map +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +757 -313
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +752 -308
- package/dist/index.mjs.map +1 -1
- package/dist/lifecycles/types.d.ts +1 -0
- package/dist/lifecycles/types.d.ts.map +1 -1
- package/dist/metadata/index.d.ts +1 -1
- package/dist/metadata/index.d.ts.map +1 -1
- package/dist/metadata/metadata.d.ts +2 -1
- package/dist/metadata/metadata.d.ts.map +1 -1
- package/dist/metadata/relations.d.ts.map +1 -1
- package/dist/migrations/internal-migrations/5.0.0-01-convert-identifiers-long-than-max-length.d.ts +3 -0
- package/dist/migrations/internal-migrations/5.0.0-01-convert-identifiers-long-than-max-length.d.ts.map +1 -0
- package/dist/migrations/internal-migrations/5.0.0-02-document-id.d.ts +3 -0
- package/dist/migrations/internal-migrations/5.0.0-02-document-id.d.ts.map +1 -0
- package/dist/migrations/internal-migrations/index.d.ts.map +1 -1
- package/dist/query/helpers/populate/apply.d.ts.map +1 -1
- package/dist/schema/index.d.ts +0 -3
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/identifiers/hash.d.ts +31 -0
- package/dist/utils/identifiers/hash.d.ts.map +1 -0
- package/dist/utils/identifiers/index.d.ts +107 -47
- package/dist/utils/identifiers/index.d.ts.map +1 -1
- package/dist/utils/identifiers/types.d.ts +27 -0
- package/dist/utils/identifiers/types.d.ts.map +1 -0
- package/dist/validations/relations/bidirectional.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/utils/identifiers/shortener.d.ts +0 -73
- package/dist/utils/identifiers/shortener.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lifecycles/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,MAAM,GACd,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lifecycles/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,MAAM,GACd,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC"}
|
package/dist/metadata/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { isPolymorphic, isBidirectional, isAnyToOne, isOneToAny, hasOrderColumn,
|
|
|
6
6
|
/**
|
|
7
7
|
* Create Metadata from models configurations
|
|
8
8
|
*/
|
|
9
|
-
export declare const createMetadata: (models
|
|
9
|
+
export declare const createMetadata: (models: Model[]) => Metadata;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,GACZ,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,GACZ,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,cAAc,WAAY,KAAK,EAAE,KAAG,QAQhD,CAAC"}
|
|
@@ -8,12 +8,13 @@ export interface Meta extends Model {
|
|
|
8
8
|
lifecycles: Partial<Record<Action, SubscriberFn>>;
|
|
9
9
|
}
|
|
10
10
|
export declare class Metadata extends Map<string, Meta> {
|
|
11
|
+
get identifiers(): import("../utils/identifiers").Identifiers;
|
|
11
12
|
get(key: string): Meta;
|
|
12
13
|
add(meta: Meta): this;
|
|
13
14
|
/**
|
|
14
15
|
* Validate the DB metadata, throwing an error if a duplicate DB table name is detected
|
|
15
16
|
*/
|
|
16
17
|
validate(): void;
|
|
17
|
-
loadModels(models
|
|
18
|
+
loadModels(models: Model[]): void;
|
|
18
19
|
}
|
|
19
20
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/metadata/metadata.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,KAAK,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,WAAW,IAAK,SAAQ,KAAK;IACjC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;CACnD;AAED,qBAAa,QAAS,SAAQ,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/metadata/metadata.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,KAAK,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,WAAW,IAAK,SAAQ,KAAK;IACjC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;CACnD;AAED,qBAAa,QAAS,SAAQ,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;IAI7C,IAAI,WAAW,+CAEd;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQtB,GAAG,CAAC,IAAI,EAAE,IAAI;IAId;;OAEG;IACH,QAAQ;IAYR,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE;CAoD3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../src/metadata/relations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAkB,MAAM,UAAU,CAAC;AAyB9E,eAAO,MAAM,aAAa,cAAe,mBAAmB,gCACyB,CAAC;AAEtF,eAAO,MAAM,UAAU,cACV,mBAAmB,wDAEwB,CAAC;AAEzD,eAAO,MAAM,WAAW,cACX,mBAAmB,0DAE0B,CAAC;AAE3D,eAAO,MAAM,UAAU,cACV,mBAAmB,wDAEwB,CAAC;AAEzD,eAAO,MAAM,WAAW,cACX,mBAAmB,0DAE0B,CAAC;AAE3D,eAAO,MAAM,eAAe,cACf,mBAAmB,wCAC4D,CAAC;AAU7F,eAAO,MAAM,cAAc,cAAe,mBAAmB,YAA2B,CAAC;AACzF,eAAO,MAAM,qBAAqB,cAAe,mBAAmB,YACd,CAAC;
|
|
1
|
+
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../src/metadata/relations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAkB,MAAM,UAAU,CAAC;AAyB9E,eAAO,MAAM,aAAa,cAAe,mBAAmB,gCACyB,CAAC;AAEtF,eAAO,MAAM,UAAU,cACV,mBAAmB,wDAEwB,CAAC;AAEzD,eAAO,MAAM,WAAW,cACX,mBAAmB,0DAE0B,CAAC;AAE3D,eAAO,MAAM,UAAU,cACV,mBAAmB,wDAEwB,CAAC;AAEzD,eAAO,MAAM,WAAW,cACX,mBAAmB,0DAE0B,CAAC;AAE3D,eAAO,MAAM,eAAe,cACf,mBAAmB,wCAC4D,CAAC;AAU7F,eAAO,MAAM,cAAc,cAAe,mBAAmB,YAA2B,CAAC;AACzF,eAAO,MAAM,qBAAqB,cAAe,mBAAmB,YACd,CAAC;AAqiBvD;;GAEG;AACH,eAAO,MAAM,cAAc,kBACV,MAAM,aACV,mBAAmB,QACxB,IAAI,YACA,QAAQ,SAuBnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5.0.0-01-convert-identifiers-long-than-max-length.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/5.0.0-01-convert-identifiers-long-than-max-length.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAqB3C,eAAO,MAAM,oCAAoC,EAAE,SA4ClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5.0.0-02-document-id.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/5.0.0-02-document-id.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AA8I3C,eAAO,MAAM,iBAAiB,EAAE,SAgC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,EAGzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/query/helpers/populate/apply.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIzC,KAAK,OAAO,GAAG;IACb,EAAE,EAAE,QAAQ,CAAC;IACb,EAAE,EAAE,YAAY,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAoBF,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/query/helpers/populate/apply.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIzC,KAAK,OAAO,GAAG;IACb,EAAE,EAAE,QAAQ,CAAC;IACb,EAAE,EAAE,YAAY,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAoBF,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AA8mBnC,QAAA,MAAM,aAAa,YAAmB,GAAG,EAAE,YAAY,OAAO,MAAM,EAAE,GAAG,CAAC,OAAO,OAAO,+BAgEvF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,MAAM,WAAW,CAAC;AAC5C,OAAO,gBAAgB,MAAM,QAAQ,CAAC;AACtC,OAAO,mBAAmB,MAAM,WAAW,CAAC;AAG5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAEnC,mBAAmB,SAAS,CAAC;AAI7B,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAChD,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAChD,aAAa,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;IACtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,MAAM,WAAW,CAAC;AAC5C,OAAO,gBAAgB,MAAM,QAAQ,CAAC;AACtC,OAAO,mBAAmB,MAAM,WAAW,CAAC;AAG5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAEnC,mBAAmB,SAAS,CAAC;AAI7B,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,UAAU,CAAC,O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,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview This file contains utility functions for shortening identifiers for use in a database schema.
|
|
3
|
+
* The functions in this file are used to generate shorter names for database tables and columns
|
|
4
|
+
* to avoid breaking the constraints of databases.
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT
|
|
7
|
+
* Any changes here that result in a different output string from any of the naming methods will
|
|
8
|
+
* cause the schema creation to delete data it doesn't recognize because the name
|
|
9
|
+
* is different.
|
|
10
|
+
*
|
|
11
|
+
* If there are any test failures after updating this code, it means there is a breaking change that
|
|
12
|
+
* will cause data loss, so beware; do not update the test to match your changes
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Creates a hash of the given data with the specified string length as a string of hex characters
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* createHash("myData", 5); // "03f85"
|
|
21
|
+
* createHash("myData", 2); // "03"
|
|
22
|
+
* createHash("myData", 1); // "0"
|
|
23
|
+
*
|
|
24
|
+
* @param data - The data to be hashed
|
|
25
|
+
* @param len - The length of the hash
|
|
26
|
+
* @returns The generated hash
|
|
27
|
+
* @throws Error if the length is not a positive integer
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function createHash(data: string, len: number): string;
|
|
31
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/utils/identifiers/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO5D"}
|
|
@@ -1,48 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import { IdentifiersOptions, NameInput, NameOptions, NameToken } from './types';
|
|
2
|
+
export declare class Identifiers {
|
|
3
|
+
#private;
|
|
4
|
+
ID_COLUMN: "id";
|
|
5
|
+
ORDER_COLUMN: "order";
|
|
6
|
+
FIELD_COLUMN: "field";
|
|
7
|
+
HASH_LENGTH: 5;
|
|
8
|
+
HASH_SEPARATOR: "";
|
|
9
|
+
IDENTIFIER_SEPARATOR: "_";
|
|
10
|
+
MIN_TOKEN_LENGTH: 3;
|
|
11
|
+
constructor(options: {
|
|
12
|
+
maxLength: number;
|
|
13
|
+
});
|
|
14
|
+
get replacementMap(): {
|
|
15
|
+
links: string;
|
|
16
|
+
order_inv_fk: string;
|
|
17
|
+
order: string;
|
|
18
|
+
morphs: string;
|
|
19
|
+
index: string;
|
|
20
|
+
inv_fk: string;
|
|
21
|
+
order_fk: string;
|
|
22
|
+
id_column_index: string;
|
|
23
|
+
order_index: string;
|
|
24
|
+
unique: string;
|
|
25
|
+
primary: string;
|
|
26
|
+
};
|
|
27
|
+
get options(): IdentifiersOptions;
|
|
28
|
+
mapshortNames: (name: string) => string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* TODO: we should be requiring snake_case inputs for all names here, but we
|
|
31
|
+
* aren't and it will require some refactoring to make it work. Currently if
|
|
32
|
+
* we get names 'myModel' and 'my_model' they would be converted to the same
|
|
33
|
+
* final string my_model which generally works but is not entirely safe
|
|
34
|
+
* */
|
|
35
|
+
getName: (names: NameInput, options?: NameOptions) => string;
|
|
36
|
+
/**
|
|
37
|
+
* TABLES
|
|
38
|
+
*/
|
|
39
|
+
getTableName: (name: string, options?: NameOptions) => string;
|
|
40
|
+
getJoinTableName: (collectionName: string, attributeName: string, options?: NameOptions) => string;
|
|
41
|
+
getMorphTableName: (collectionName: string, attributeName: string, options?: NameOptions) => string;
|
|
42
|
+
/**
|
|
43
|
+
* COLUMNS
|
|
44
|
+
*/
|
|
45
|
+
getColumnName: (attributeName: string, options?: NameOptions) => string;
|
|
46
|
+
getJoinColumnAttributeIdName: (attributeName: string, options?: NameOptions) => string;
|
|
47
|
+
getInverseJoinColumnAttributeIdName: (attributeName: string, options?: NameOptions) => string;
|
|
48
|
+
getOrderColumnName: (singularName: string, options?: NameOptions) => string;
|
|
49
|
+
getInverseOrderColumnName: (singularName: string, options?: NameOptions) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Morph Join Tables
|
|
52
|
+
*/
|
|
53
|
+
getMorphColumnJoinTableIdName: (singularName: string, options?: NameOptions) => string;
|
|
54
|
+
getMorphColumnAttributeIdName: (attributeName: string, options?: NameOptions) => string;
|
|
55
|
+
getMorphColumnTypeName: (attributeName: string, options?: NameOptions) => string;
|
|
56
|
+
/**
|
|
57
|
+
* INDEXES
|
|
58
|
+
* Note that these methods are generally used to reference full table names + attribute(s), which
|
|
59
|
+
* may already be shortened strings rather than individual parts.
|
|
60
|
+
* That is fine and expected to compress the previously incompressible parts of those strings,
|
|
61
|
+
* because in these cases the relevant information is the table name and we can't really do
|
|
62
|
+
* any better; shortening the individual parts again might make it even more confusing.
|
|
63
|
+
*
|
|
64
|
+
* So for example, the fk for the table `mytable_myattr4567d_localizations` will become
|
|
65
|
+
* mytable_myattr4567d_loc63bf2_fk
|
|
66
|
+
*/
|
|
67
|
+
getIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
68
|
+
getFkIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
69
|
+
getUniqueIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
70
|
+
getPrimaryIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
71
|
+
getInverseFkIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
72
|
+
getOrderFkIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
73
|
+
getOrderInverseFkIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
74
|
+
getIdColumnIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
75
|
+
getOrderIndexName: (names: NameInput, options?: NameOptions) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Generates a string with a max length, appending a hash at the end if necessary to keep it unique
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* // if we have strings such as "longstring1" and "longstring2" with a max length of 9,
|
|
81
|
+
* // we don't want to end up with "longstrin" and "longstrin"
|
|
82
|
+
* // we want something such as "longs0b23" and "longs953f"
|
|
83
|
+
* const token1 = generateToken("longstring1", 9); // "longs0b23"
|
|
84
|
+
* const token2 = generateToken("longstring2", 9); // "longs953f"
|
|
85
|
+
*
|
|
86
|
+
* @param name - The base name
|
|
87
|
+
* @param len - The desired length of the token.
|
|
88
|
+
* @returns The generated token with hash.
|
|
89
|
+
* @throws Error if the length is not a positive integer, or if the length is too short for the token.
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
getShortenedName: (name: string, len: number) => string;
|
|
93
|
+
/**
|
|
94
|
+
* Constructs a name from an array of name tokens within a specified maximum length. It ensures the final name does not exceed
|
|
95
|
+
* this limit by selectively compressing tokens marked as compressible. If the name exceeds the maximum length and cannot be
|
|
96
|
+
* compressed sufficiently, an error is thrown. This function supports dynamic adjustment of token lengths to fit within the
|
|
97
|
+
* maxLength constraint (that is, it will always make use of all available space), while also ensuring the preservation of
|
|
98
|
+
* incompressible tokens.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
getNameFromTokens: (nameTokens: NameToken[]) => string;
|
|
102
|
+
nameMap: Map<string, string>;
|
|
103
|
+
getUnshortenedName: (shortName: string) => string;
|
|
104
|
+
setUnshortenedName: (shortName: string, fullName: string) => void;
|
|
105
|
+
serializeKey: (shortName: string) => string;
|
|
106
|
+
}
|
|
107
|
+
export declare const identifiers: Identifiers;
|
|
48
108
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/identifiers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/identifiers/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EAEV,MAAM,SAAS,CAAC;AAIjB,qBAAa,WAAW;;IACtB,SAAS,OAAiB;IAE1B,YAAY,UAAoB;IAEhC,YAAY,UAAoB;IAEhC,WAAW,IAAc;IAEzB,cAAc,KAAe;IAE7B,oBAAoB,MAAgB;IAEpC,gBAAgB,IAAc;gBAmBlB,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE;IAI1C,IAAI,cAAc;;;;;;;;;;;;MAEjB;IAED,IAAI,OAAO,uBAEV;IAED,aAAa,SAAU,MAAM,KAAG,MAAM,GAAG,SAAS,CAKhD;IAGF;;;;;SAKK;IACL,OAAO,UAAW,SAAS,YAAY,WAAW,YAyBhD;IAEF;;OAEG;IAEH,YAAY,SAAU,MAAM,YAAY,WAAW,YAEjD;IAEF,gBAAgB,mBAAoB,MAAM,iBAAiB,MAAM,YAAY,WAAW,YAKtF;IAEF,iBAAiB,mBAAoB,MAA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export type NameInput = string | string[];
|
|
2
|
+
export type CompressibleNameToken = {
|
|
3
|
+
compressible: true;
|
|
4
|
+
name: string;
|
|
5
|
+
allocatedLength?: number;
|
|
6
|
+
};
|
|
7
|
+
export type IncompressibleNameToken = {
|
|
8
|
+
compressible: false;
|
|
9
|
+
name: string;
|
|
10
|
+
allocatedLength?: number;
|
|
11
|
+
shortName?: string;
|
|
12
|
+
};
|
|
13
|
+
export type NameToken = CompressibleNameToken | IncompressibleNameToken;
|
|
14
|
+
export type NameFromTokenOptions = {
|
|
15
|
+
maxLength: number;
|
|
16
|
+
};
|
|
17
|
+
export type IdentifiersOptions = {
|
|
18
|
+
maxLength: number;
|
|
19
|
+
};
|
|
20
|
+
export type NameOptions = {
|
|
21
|
+
suffix?: string;
|
|
22
|
+
prefix?: string;
|
|
23
|
+
};
|
|
24
|
+
export type NameTokenWithAllocation = NameToken & {
|
|
25
|
+
allocatedLength: number;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/identifiers/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,KAAK,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAExE,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bidirectional.d.ts","sourceRoot":"","sources":["../../../src/validations/relations/bidirectional.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bidirectional.d.ts","sourceRoot":"","sources":["../../../src/validations/relations/bidirectional.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA+CtC;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,OAAc,QAAQ,kBAqChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/database",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.2",
|
|
4
4
|
"description": "Strapi's database layer",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"watch": "pack-up watch"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@
|
|
42
|
+
"@paralleldrive/cuid2": "2.2.2",
|
|
43
|
+
"@strapi/utils": "5.0.0-beta.2",
|
|
43
44
|
"date-fns": "2.30.0",
|
|
44
45
|
"debug": "4.3.4",
|
|
45
46
|
"fs-extra": "10.1.0",
|
|
@@ -49,13 +50,13 @@
|
|
|
49
50
|
"umzug": "3.2.1"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@strapi/pack-up": "5.0.0-beta.
|
|
53
|
-
"eslint-config-custom": "5.0.0-beta.
|
|
54
|
-
"tsconfig": "5.0.0-beta.
|
|
53
|
+
"@strapi/pack-up": "5.0.0-beta.2",
|
|
54
|
+
"eslint-config-custom": "5.0.0-beta.2",
|
|
55
|
+
"tsconfig": "5.0.0-beta.2"
|
|
55
56
|
},
|
|
56
57
|
"engines": {
|
|
57
58
|
"node": ">=18.0.0 <=20.x.x",
|
|
58
59
|
"npm": ">=6.0.0"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "e39426bd12ead73ca35d3d9bbf6dc71b5e8ac354"
|
|
61
62
|
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview This file contains utility functions for shortening identifiers for use in a database schema.
|
|
3
|
-
* The functions in this file are used to generate shorter names for database tables and columns
|
|
4
|
-
* to avoid breaking the constraints of databases.
|
|
5
|
-
*
|
|
6
|
-
* IMPORTANT
|
|
7
|
-
* Any changes here that result in a different output string from any of the naming methods will
|
|
8
|
-
* cause the schema creation to delete data it doesn't recognize because the name
|
|
9
|
-
* is different.
|
|
10
|
-
*
|
|
11
|
-
* If there are any test failures after updating this code, it means there is a breaking change that
|
|
12
|
-
* will cause data loss, so beware; do not update the test to match your changes
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare const MAX_DB_IDENTIFIER_LENGTH = 0;
|
|
17
|
-
export declare const HASH_LENGTH = 5;
|
|
18
|
-
export declare const HASH_SEPARATOR = "";
|
|
19
|
-
export declare const IDENTIFIER_SEPARATOR = "_";
|
|
20
|
-
export declare const MIN_TOKEN_LENGTH = 3;
|
|
21
|
-
type NameToken = {
|
|
22
|
-
allocatedLength?: number;
|
|
23
|
-
name: string;
|
|
24
|
-
compressible: boolean;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Creates a hash of the given data with the specified string length as a string of hex characters
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* createHash("myData", 5); // "03f85"
|
|
31
|
-
* createHash("myData", 2); // "03"
|
|
32
|
-
* createHash("myData", 1); // "0"
|
|
33
|
-
*
|
|
34
|
-
* @param data - The data to be hashed
|
|
35
|
-
* @param len - The length of the hash
|
|
36
|
-
* @returns The generated hash
|
|
37
|
-
* @throws Error if the length is not a positive integer
|
|
38
|
-
* @internal
|
|
39
|
-
*/
|
|
40
|
-
export declare function createHash(data: string, len: number): string;
|
|
41
|
-
/**
|
|
42
|
-
* Generates a string with a max length, appending a hash at the end if necessary to keep it unique
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* // if we have strings such as "longstring1" and "longstring2" with a max length of 9,
|
|
46
|
-
* // we don't want to end up with "longstrin" and "longstrin"
|
|
47
|
-
* // we want something such as "longs0b23" and "longs953f"
|
|
48
|
-
* const token1 = generateToken("longstring1", 9); // "longs0b23"
|
|
49
|
-
* const token2 = generateToken("longstring2", 9); // "longs953f"
|
|
50
|
-
*
|
|
51
|
-
* @param name - The base name
|
|
52
|
-
* @param len - The desired length of the token.
|
|
53
|
-
* @returns The generated token with hash.
|
|
54
|
-
* @throws Error if the length is not a positive integer, or if the length is too short for the token.
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
export declare function getShortenedName(name: string, len: number): string;
|
|
58
|
-
/**
|
|
59
|
-
* Constructs a name from an array of name tokens within a specified maximum length. It ensures the final name does not exceed
|
|
60
|
-
* this limit by selectively compressing tokens marked as compressible. If the name exceeds the maximum length and cannot be
|
|
61
|
-
* compressed sufficiently, an error is thrown. This function supports dynamic adjustment of token lengths to fit within the
|
|
62
|
-
* maxLength constraint (that is, it will always make use of all available space), while also ensuring the preservation of
|
|
63
|
-
* incompressible tokens.
|
|
64
|
-
*
|
|
65
|
-
* @param {NameToken[]} nameTokens - Array of name tokens
|
|
66
|
-
* @param {number} [maxLength=MAX_DB_IDENTIFIER_LENGTH] - Maximum length for the final name string.
|
|
67
|
-
* @returns {string} The generated name string within maxLength.
|
|
68
|
-
* @throws {Error} If the name cannot be shortened to meet maxLength.
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
export declare function getNameFromTokens(nameTokens: NameToken[], maxLength?: number): string;
|
|
72
|
-
export {};
|
|
73
|
-
//# sourceMappingURL=shortener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shortener.d.ts","sourceRoot":"","sources":["../../../src/utils/identifiers/shortener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAM1C,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,KAAK,SAAS,GAAG;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAS5D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAqBzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,SAAS,SAA2B,UA2G9F"}
|