@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.
Files changed (54) hide show
  1. package/dist/entity-manager/index.d.ts.map +1 -1
  2. package/dist/entity-manager/morph-relations.d.ts +1 -1
  3. package/dist/entity-manager/morph-relations.d.ts.map +1 -1
  4. package/dist/entity-manager/regular-relations.d.ts +8 -8
  5. package/dist/entity-manager/regular-relations.d.ts.map +1 -1
  6. package/dist/entity-manager/relations-orderer.d.ts.map +1 -1
  7. package/dist/index.d.ts +4 -6
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +899 -340
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +897 -338
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/lifecycles/types.d.ts +1 -0
  14. package/dist/lifecycles/types.d.ts.map +1 -1
  15. package/dist/metadata/index.d.ts +1 -1
  16. package/dist/metadata/index.d.ts.map +1 -1
  17. package/dist/metadata/metadata.d.ts +2 -1
  18. package/dist/metadata/metadata.d.ts.map +1 -1
  19. package/dist/metadata/relations.d.ts.map +1 -1
  20. package/dist/migrations/common.d.ts +16 -2
  21. package/dist/migrations/common.d.ts.map +1 -1
  22. package/dist/migrations/index.d.ts +2 -2
  23. package/dist/migrations/index.d.ts.map +1 -1
  24. package/dist/migrations/internal-migrations/5.0.0-01-convert-identifiers-long-than-max-length.d.ts +3 -0
  25. package/dist/migrations/internal-migrations/5.0.0-01-convert-identifiers-long-than-max-length.d.ts.map +1 -0
  26. package/dist/migrations/internal-migrations/5.0.0-02-document-id.d.ts +3 -0
  27. package/dist/migrations/internal-migrations/5.0.0-02-document-id.d.ts.map +1 -0
  28. package/dist/migrations/internal-migrations/5.0.0-03-locale.d.ts +3 -0
  29. package/dist/migrations/internal-migrations/5.0.0-03-locale.d.ts.map +1 -0
  30. package/dist/migrations/internal-migrations/index.d.ts.map +1 -1
  31. package/dist/migrations/internal.d.ts +2 -2
  32. package/dist/migrations/internal.d.ts.map +1 -1
  33. package/dist/migrations/storage.d.ts.map +1 -1
  34. package/dist/migrations/users.d.ts +2 -2
  35. package/dist/migrations/users.d.ts.map +1 -1
  36. package/dist/query/helpers/join.d.ts.map +1 -1
  37. package/dist/query/helpers/populate/apply.d.ts.map +1 -1
  38. package/dist/query/helpers/where.d.ts +1 -0
  39. package/dist/query/helpers/where.d.ts.map +1 -1
  40. package/dist/schema/index.d.ts +0 -3
  41. package/dist/schema/index.d.ts.map +1 -1
  42. package/dist/transaction-context.d.ts.map +1 -1
  43. package/dist/types/index.d.ts +3 -0
  44. package/dist/types/index.d.ts.map +1 -1
  45. package/dist/utils/identifiers/hash.d.ts +31 -0
  46. package/dist/utils/identifiers/hash.d.ts.map +1 -0
  47. package/dist/utils/identifiers/index.d.ts +107 -47
  48. package/dist/utils/identifiers/index.d.ts.map +1 -1
  49. package/dist/utils/identifiers/types.d.ts +27 -0
  50. package/dist/utils/identifiers/types.d.ts.map +1 -0
  51. package/dist/validations/relations/bidirectional.d.ts.map +1 -1
  52. package/package.json +9 -7
  53. package/dist/utils/identifiers/shortener.d.ts +0 -73
  54. package/dist/utils/identifiers/shortener.d.ts.map +0 -1
@@ -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"}