@strapi/database 5.0.0-beta.0 → 5.0.0-beta.10
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/morph-relations.d.ts +1 -1
- package/dist/entity-manager/morph-relations.d.ts.map +1 -1
- package/dist/entity-manager/regular-relations.d.ts +8 -8
- package/dist/entity-manager/regular-relations.d.ts.map +1 -1
- package/dist/entity-manager/relations-orderer.d.ts.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +899 -340
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +897 -338
- 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/common.d.ts +16 -2
- package/dist/migrations/common.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +2 -2
- package/dist/migrations/index.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/5.0.0-03-locale.d.ts +3 -0
- package/dist/migrations/internal-migrations/5.0.0-03-locale.d.ts.map +1 -0
- package/dist/migrations/internal-migrations/index.d.ts.map +1 -1
- package/dist/migrations/internal.d.ts +2 -2
- package/dist/migrations/internal.d.ts.map +1 -1
- package/dist/migrations/storage.d.ts.map +1 -1
- package/dist/migrations/users.d.ts +2 -2
- package/dist/migrations/users.d.ts.map +1 -1
- package/dist/query/helpers/join.d.ts.map +1 -1
- package/dist/query/helpers/populate/apply.d.ts.map +1 -1
- package/dist/query/helpers/where.d.ts +1 -0
- package/dist/query/helpers/where.d.ts.map +1 -1
- package/dist/schema/index.d.ts +0 -3
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/transaction-context.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 +9 -7
- 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":"index.d.ts","sourceRoot":"","sources":["../../src/entity-manager/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAsB,MAAM,SAAS,CAAC;AAE5D,cAAc,SAAS,CAAC;AAuLxB,eAAO,MAAM,mBAAmB,OAAQ,QAAQ,KAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity-manager/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAsB,MAAM,SAAS,CAAC;AAE5D,cAAc,SAAS,CAAC;AAuLxB,eAAO,MAAM,mBAAmB,OAAQ,QAAQ,KAAG,aA2kClD,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare const deleteRelatedMorphOneRelationsAfterMorphToManyUpdate: (rows
|
|
|
7
7
|
attributeName: string;
|
|
8
8
|
joinTable: MorphJoinTable;
|
|
9
9
|
db: Database;
|
|
10
|
-
transaction?: Knex.Transaction
|
|
10
|
+
transaction?: Knex.Transaction;
|
|
11
11
|
}) => Promise<void>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=morph-relations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morph-relations.d.ts","sourceRoot":"","sources":["../../src/entity-manager/morph-relations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,UAAU,CAAC;AAEzD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;AA8BtC,eAAO,MAAM,oDAAoD;
|
|
1
|
+
{"version":3,"file":"morph-relations.d.ts","sourceRoot":"","sources":["../../src/entity-manager/morph-relations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,UAAU,CAAC;AAEzD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;AA8BtC,eAAO,MAAM,oDAAoD,yEAQ5D;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,cAAc,CAAC;IAC1B,EAAE,EAAE,QAAQ,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,WAAW,CAAC;CAChC,kBAoCF,CAAC"}
|
|
@@ -21,7 +21,7 @@ declare const deletePreviousOneToAnyRelations: ({ id, attribute, relIdsToadd, db
|
|
|
21
21
|
attribute: Relation.Bidirectional;
|
|
22
22
|
relIdsToadd: ID[];
|
|
23
23
|
db: Database;
|
|
24
|
-
transaction?: Knex.Transaction
|
|
24
|
+
transaction?: Knex.Transaction;
|
|
25
25
|
}) => Promise<void>;
|
|
26
26
|
/**
|
|
27
27
|
* If a relation currently exists for this xToOne relations, this function removes it and update the inverse order if needed.
|
|
@@ -31,7 +31,7 @@ declare const deletePreviousAnyToOneRelations: ({ id, attribute, relIdToadd, db,
|
|
|
31
31
|
attribute: Relation.Bidirectional;
|
|
32
32
|
relIdToadd: ID;
|
|
33
33
|
db: Database;
|
|
34
|
-
transaction?: Knex.Transaction
|
|
34
|
+
transaction?: Knex.Transaction;
|
|
35
35
|
}) => Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* Delete all or some relations of entity field
|
|
@@ -40,19 +40,19 @@ declare const deleteRelations: ({ id, attribute, db, relIdsToNotDelete, relIdsTo
|
|
|
40
40
|
id: ID;
|
|
41
41
|
attribute: Relation.Bidirectional;
|
|
42
42
|
db: Database;
|
|
43
|
-
relIdsToNotDelete?: ID[]
|
|
44
|
-
relIdsToDelete?: ID[] |
|
|
45
|
-
transaction?: Knex.Transaction
|
|
43
|
+
relIdsToNotDelete?: ID[];
|
|
44
|
+
relIdsToDelete?: ID[] | 'all';
|
|
45
|
+
transaction?: Knex.Transaction;
|
|
46
46
|
}) => Promise<void>;
|
|
47
47
|
/**
|
|
48
48
|
* Clean the order columns by ensuring the order value are continuous (ex: 1, 2, 3 and not 1, 5, 10)
|
|
49
49
|
*/
|
|
50
50
|
declare const cleanOrderColumns: ({ id, attribute, db, inverseRelIds, transaction: trx, }: {
|
|
51
|
-
id?: ID
|
|
51
|
+
id?: ID;
|
|
52
52
|
attribute: Relation.Bidirectional;
|
|
53
53
|
db: Database;
|
|
54
|
-
inverseRelIds?: ID[]
|
|
55
|
-
transaction?: Knex.Transaction
|
|
54
|
+
inverseRelIds?: ID[];
|
|
55
|
+
transaction?: Knex.Transaction;
|
|
56
56
|
}) => Promise<[void, void] | undefined>;
|
|
57
57
|
export { deletePreviousOneToAnyRelations, deletePreviousAnyToOneRelations, deleteRelations, cleanOrderColumns, };
|
|
58
58
|
//# sourceMappingURL=regular-relations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regular-relations.d.ts","sourceRoot":"","sources":["../../src/entity-manager/regular-relations.ts"],"names":[],"mappings":";;;;;AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAYjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAS,MAAM,UAAU,CAAC;AAEpD,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAU,IAAI,CAAC;QACb,UAAU,kBAAkB;YAC1B,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;SAC3C;KACF;CACF;AAgCD;;GAEG;AACH,QAAA,MAAM,+BAA+B;
|
|
1
|
+
{"version":3,"file":"regular-relations.d.ts","sourceRoot":"","sources":["../../src/entity-manager/regular-relations.ts"],"names":[],"mappings":";;;;;AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAYjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAS,MAAM,UAAU,CAAC;AAEpD,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAU,IAAI,CAAC;QACb,UAAU,kBAAkB;YAC1B,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;SAC3C;KACF;CACF;AAgCD;;GAEG;AACH,QAAA,MAAM,+BAA+B,0DAMlC;IACD,EAAE,EAAE,EAAE,CAAC;IACP,SAAS,EAAE,SAAS,aAAa,CAAC;IAClC,WAAW,EAAE,EAAE,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C;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import { LifecycleProvider } from './lifecycles';
|
|
|
8
8
|
import * as errors from './errors';
|
|
9
9
|
import { Callback, TransactionObject } from './transaction-context';
|
|
10
10
|
import type { Model } from './types';
|
|
11
|
-
import
|
|
11
|
+
import type { Migration } from './migrations';
|
|
12
|
+
import { type Identifiers } from './utils/identifiers';
|
|
12
13
|
export { isKnexQuery } from './utils/knex';
|
|
13
14
|
interface Settings {
|
|
14
15
|
forceMigration?: boolean;
|
|
@@ -46,9 +47,6 @@ declare class Database {
|
|
|
46
47
|
queryBuilder(uid: string): import("./query/query-builder").QueryBuilder;
|
|
47
48
|
destroy(): Promise<void>;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
export { Database, errors, utils };
|
|
53
|
-
export type { Model };
|
|
50
|
+
export { Database, errors };
|
|
51
|
+
export type { Model, Identifiers, Migration };
|
|
54
52
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAc,MAAM,YAAY,CAAC;AACjD,OAAO,EAAwB,cAAc,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAkB,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAuB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAA4B,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAA4B,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EA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