@degenerate/generic 0.7.1 → 0.9.1

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 (52) hide show
  1. package/LICENSE.md +12 -60
  2. package/README.md +15 -0
  3. package/dist/_settings/application-settings.d.ts +1 -0
  4. package/dist/_settings/application-settings.d.ts.map +1 -1
  5. package/dist/_settings/application-settings.js +5 -0
  6. package/dist/_settings/authorization-settings.d.ts +2 -2
  7. package/dist/application/database/firestore/generics/add-items-to-database.d.ts.map +1 -1
  8. package/dist/application/database/firestore/generics/add-items-to-database.js +2 -36
  9. package/dist/application/database/firestore/generics/add-or-update-items-to-database.d.ts.map +1 -1
  10. package/dist/application/database/firestore/generics/add-or-update-items-to-database.js +2 -36
  11. package/dist/application/database/firestore/generics/delete-items-on-database.d.ts.map +1 -1
  12. package/dist/application/database/firestore/generics/delete-items-on-database.js +2 -36
  13. package/dist/application/database/firestore/generics/get-item-from-database.d.ts.map +1 -1
  14. package/dist/application/database/firestore/generics/get-item-from-database.js +2 -36
  15. package/dist/application/database/firestore/generics/get-items-different-path-on-database.d.ts.map +1 -1
  16. package/dist/application/database/firestore/generics/get-items-different-path-on-database.js +2 -36
  17. package/dist/application/database/firestore/generics/get-items-from-database.d.ts +9 -4
  18. package/dist/application/database/firestore/generics/get-items-from-database.d.ts.map +1 -1
  19. package/dist/application/database/firestore/generics/get-items-from-database.js +180 -61
  20. package/dist/application/database/firestore/generics/update-items-on-database.d.ts.map +1 -1
  21. package/dist/application/database/firestore/generics/update-items-on-database.js +2 -36
  22. package/dist/application/database/firestore/generics/update-items-properties-on-database.d.ts.map +1 -1
  23. package/dist/application/database/firestore/generics/update-items-properties-on-database.js +2 -36
  24. package/dist/application/database/firestore/page-cursor/page-cursor.d.ts +33 -0
  25. package/dist/application/database/firestore/page-cursor/page-cursor.d.ts.map +1 -0
  26. package/dist/application/database/firestore/page-cursor/page-cursor.js +206 -0
  27. package/dist/application/database/firestore/path-references/audit-log/create-audit-log-col-ref.d.ts.map +1 -1
  28. package/dist/application/database/firestore/path-references/audit-log/create-audit-log-col-ref.js +2 -36
  29. package/dist/application/database/index.d.ts +1 -0
  30. package/dist/application/database/index.d.ts.map +1 -1
  31. package/dist/application/database/index.js +3 -0
  32. package/dist/application/index.d.ts +1 -0
  33. package/dist/application/index.d.ts.map +1 -1
  34. package/dist/application/index.js +3 -0
  35. package/dist/authorization/jwt/sign/create-jwt-options.d.ts +2 -2
  36. package/dist/authorization/jwt/sign/create-jwt-options.d.ts.map +1 -1
  37. package/dist/errors/base-error.d.ts +3 -1
  38. package/dist/errors/base-error.d.ts.map +1 -1
  39. package/dist/errors/base-error.js +5 -1
  40. package/dist/errors/database/database-errors.d.ts +28 -0
  41. package/dist/errors/database/database-errors.d.ts.map +1 -1
  42. package/dist/errors/database/database-errors.js +35 -1
  43. package/dist/helpers/firestore/firestore-id-helpers.d.ts +25 -0
  44. package/dist/helpers/firestore/firestore-id-helpers.d.ts.map +1 -0
  45. package/dist/helpers/firestore/firestore-id-helpers.js +39 -0
  46. package/dist/helpers/index.d.ts +1 -0
  47. package/dist/helpers/index.d.ts.map +1 -1
  48. package/dist/helpers/index.js +1 -0
  49. package/dist/models/application/database/firestore-models.d.ts +35 -14
  50. package/dist/models/application/database/firestore-models.d.ts.map +1 -1
  51. package/dist/models/application/database/firestore-models.js +64 -46
  52. package/package.json +13 -4
@@ -1,48 +1,14 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.createAuditLogColRef = void 0;
37
- const admin = __importStar(require("firebase-admin"));
4
+ const firestore_1 = require("firebase-admin/firestore");
38
5
  const database_settings_1 = require("../../../../../_settings/database-settings");
39
- const db = admin.firestore();
40
6
  /**
41
7
  * This creates the audit log collection reference.
42
8
  *
43
9
  * @returns the collection reference.
44
10
  */
45
11
  const createAuditLogColRef = () => {
46
- return db.collection(database_settings_1.DatabaseSettingsFirestore.AuditLogs.Collection);
12
+ return (0, firestore_1.getFirestore)().collection(database_settings_1.DatabaseSettingsFirestore.AuditLogs.Collection);
47
13
  };
48
14
  exports.createAuditLogColRef = createAuditLogColRef;
@@ -7,5 +7,6 @@ export * from './firestore/generics/get-items-different-path-on-database';
7
7
  export * from './firestore/generics/get-items-from-database';
8
8
  export * from './firestore/generics/update-items-on-database';
9
9
  export * from './firestore/generics/update-items-properties-on-database';
10
+ export * from './firestore/page-cursor/page-cursor';
10
11
  export * from './firestore/path-references/audit-log/create-audit-log-col-ref';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/database/index.ts"],"names":[],"mappings":"AACA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sDAAsD,CAAC;AACrE,cAAc,yDAAyD,CAAC;AACxE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AAGzE,cAAc,gEAAgE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/database/index.ts"],"names":[],"mappings":"AACA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sDAAsD,CAAC;AACrE,cAAc,yDAAyD,CAAC;AACxE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AAGzE,cAAc,qCAAqC,CAAC;AAGpD,cAAc,gEAAgE,CAAC"}
@@ -25,6 +25,9 @@ __exportStar(require("./firestore/generics/get-items-from-database"), exports);
25
25
  __exportStar(require("./firestore/generics/update-items-on-database"), exports);
26
26
  __exportStar(require("./firestore/generics/update-items-properties-on-database"), exports);
27
27
  //#endregion firestore generics
28
+ //#region page cursor
29
+ __exportStar(require("./firestore/page-cursor/page-cursor"), exports);
30
+ //#endregion page cursor
28
31
  //#region path references
29
32
  __exportStar(require("./firestore/path-references/audit-log/create-audit-log-col-ref"), exports);
30
33
  //#endregion path references
@@ -11,5 +11,6 @@ export * from './database/firestore/generics/get-items-different-path-on-databas
11
11
  export * from './database/firestore/generics/get-items-from-database';
12
12
  export * from './database/firestore/generics/update-items-on-database';
13
13
  export * from './database/firestore/generics/update-items-properties-on-database';
14
+ export * from './database/firestore/page-cursor/page-cursor';
14
15
  export * from './database/firestore/path-references/audit-log/create-audit-log-col-ref';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAKA,cAAc,uEAAuE,CAAC;AACtF,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAG3E,cAAc,0CAA0C,CAAC;AAUzD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,kEAAkE,CAAC;AACjF,cAAc,wDAAwD,CAAC;AACvE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oEAAoE,CAAC;AACnF,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,mEAAmE,CAAC;AAMlF,cAAc,yEAAyE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAKA,cAAc,uEAAuE,CAAC;AACtF,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAG3E,cAAc,0CAA0C,CAAC;AAUzD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,kEAAkE,CAAC;AACjF,cAAc,wDAAwD,CAAC;AACvE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oEAAoE,CAAC;AACnF,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,mEAAmE,CAAC;AAMlF,cAAc,8CAA8C,CAAC;AAM7D,cAAc,yEAAyE,CAAC"}
@@ -36,6 +36,9 @@ __exportStar(require("./database/firestore/generics/get-items-from-database"), e
36
36
  __exportStar(require("./database/firestore/generics/update-items-on-database"), exports);
37
37
  __exportStar(require("./database/firestore/generics/update-items-properties-on-database"), exports);
38
38
  //#endregion Generics
39
+ //#region Page Cursor
40
+ __exportStar(require("./database/firestore/page-cursor/page-cursor"), exports);
41
+ //#endregion Page Cursor
39
42
  //#region Path References
40
43
  __exportStar(require("./database/firestore/path-references/audit-log/create-audit-log-col-ref"), exports);
41
44
  //#endregion Path References
@@ -15,8 +15,8 @@ import { AuthorizationAudience, AuthorizationSubject } from '../../../models/aut
15
15
  declare const createJwtOptions: (subject: AuthorizationSubject, // the subject of the token
16
16
  audience?: AuthorizationAudience | AuthorizationAudience[], // audience
17
17
  algorithm?: jwt.Algorithm, // ECDSA using P-521 curve and SHA-512 hash algorithm
18
- expiresIn?: string | number, // Default expiration time
19
- notBefore?: string | number, // Default not before time
18
+ expiresIn?: jwt.SignOptions["expiresIn"], // Default expiration time
19
+ notBefore?: jwt.SignOptions["notBefore"], // Default not before time
20
20
  keyid?: string, // A unique identifier for the key used to sign the token. This can be used to prevent replay attacks.
21
21
  header?: jwt.JwtHeader) => jwt.SignOptions;
22
22
  export { createJwtOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"create-jwt-options.d.ts","sourceRoot":"","sources":["../../../../src/authorization/jwt/sign/create-jwt-options.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAGjH;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,GAClB,SAAS,oBAAoB,EAAE,2BAA2B;AAC1D,WAAU,qBAAqB,GAAG,qBAAqB,EAAoC,EAAE,WAAW;AACxG,YAAW,GAAG,CAAC,SAAgE,EAAE,qDAAqD;AACtI,YAAW,MAAM,GAAG,MAAmD,EAAE,0BAA0B;AACnG,YAAW,MAAM,GAAG,MAAmD,EAAE,0BAA0B;AACnG,QAAQ,MAAM,EAAE,sGAAsG;AACtH,SAAS,GAAG,CAAC,SAAS,KACvB,GAAG,CAAC,WAkBN,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"create-jwt-options.d.ts","sourceRoot":"","sources":["../../../../src/authorization/jwt/sign/create-jwt-options.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAGjH;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,GAClB,SAAS,oBAAoB,EAAE,2BAA2B;AAC1D,WAAU,qBAAqB,GAAG,qBAAqB,EAAoC,EAAE,WAAW;AACxG,YAAW,GAAG,CAAC,SAA+C,EAAE,qDAAqD;AACrH,YAAW,GAAG,CAAC,WAAW,CAAC,WAAW,CAA8C,EAAE,0BAA0B;AAChH,YAAW,GAAG,CAAC,WAAW,CAAC,WAAW,CAA8C,EAAE,0BAA0B;AAChH,QAAQ,MAAM,EAAE,sGAAsG;AACtH,SAAS,GAAG,CAAC,SAAS,KACvB,GAAG,CAAC,WAkBN,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -3,13 +3,15 @@
3
3
  */
4
4
  export declare class BaseError extends Error {
5
5
  errorCode?: number;
6
+ cause?: unknown;
6
7
  /**
7
8
  * This is the base error type for the application.
8
9
  *
9
10
  * @param message the message to include.
10
11
  * @param errorCode the error code if we want to include one.
12
+ * @param cause the error that led to this one, if any.
11
13
  */
12
- constructor(message: string, errorCode?: number);
14
+ constructor(message: string, errorCode?: number, cause?: unknown);
13
15
  /**
14
16
  * This function returns the error as a JSON object.
15
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"base-error.d.ts","sourceRoot":"","sources":["../../src/errors/base-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAU/C;;OAEG;IACI,MAAM;;;;;;CAQhB"}
1
+ {"version":3,"file":"base-error.d.ts","sourceRoot":"","sources":["../../src/errors/base-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;IAahE;;OAEG;IACI,MAAM;;;;;;CAQhB"}
@@ -10,11 +10,15 @@ class BaseError extends Error {
10
10
  *
11
11
  * @param message the message to include.
12
12
  * @param errorCode the error code if we want to include one.
13
+ * @param cause the error that led to this one, if any.
13
14
  */
14
- constructor(message, errorCode) {
15
+ constructor(message, errorCode, cause) {
15
16
  super(message); // Pass the message to the Error constructor
16
17
  this.name = this.constructor.name; // Set the name of the error
17
18
  this.errorCode = errorCode; // Set the error code
19
+ if (cause !== undefined) {
20
+ this.cause = cause; // set here, since the ES2020 lib has no Error options
21
+ }
18
22
  // This line is needed to restore the correct prototype chain.
19
23
  // (see note below)
20
24
  Object.setPrototypeOf(this, new.target.prototype);
@@ -10,6 +10,34 @@ export declare class DatabaseRecordNotFoundError extends BaseError {
10
10
  */
11
11
  constructor(databasePath: string);
12
12
  }
13
+ /**
14
+ * This is thrown when a page cursor doesn't fit the list being paged.
15
+ */
16
+ export declare class DatabaseCursorInvalidError extends BaseError {
17
+ /**
18
+ * This is thrown when a page cursor doesn't fit the list being paged: the token is malformed,
19
+ * came from a list with different orderings, doesn't hold one value for each ordering, its
20
+ * document id isn't a single id, or Firestore can't use one of its values.
21
+ *
22
+ * @param collectionPath the path to the collection being listed.
23
+ * @param cause the error Firestore raised for the cursor, if any.
24
+ */
25
+ constructor(collectionPath: string, cause?: unknown);
26
+ }
27
+ /**
28
+ * This is thrown when a list's filters and order are a combination Firestore can't run.
29
+ */
30
+ export declare class DatabaseQueryNotSupportedError extends BaseError {
31
+ /**
32
+ * This is thrown when a list's filters and order are a combination Firestore can't run, so it
33
+ * is refused before any read.
34
+ *
35
+ * @param collectionPath the path to the collection being listed.
36
+ * @param reason what makes the combination unsupported.
37
+ * @param cause the error that led to this one, if any.
38
+ */
39
+ constructor(collectionPath: string, reason: string, cause?: unknown);
40
+ }
13
41
  /**
14
42
  * This is throw when too many database records are found.
15
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"database-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/database/database-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;IACtD;;;;OAIG;gBACS,YAAY,EAAE,MAAM;CAGnC;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;IACtD;;;;OAIG;gBACS,YAAY,EAAE,MAAM;CAGnC"}
1
+ {"version":3,"file":"database-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/database/database-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;IACtD;;;;OAIG;gBACS,YAAY,EAAE,MAAM;CAGnC;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,SAAS;IACrD;;;;;;;OAOG;gBACS,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAGtD;AAED;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,SAAS;IACzD;;;;;;;OAOG;gBACS,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAGtE;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;IACtD;;;;OAIG;gBACS,YAAY,EAAE,MAAM;CAGnC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DatabaseTooManyRecordsError = exports.DatabaseRecordNotFoundError = void 0;
3
+ exports.DatabaseTooManyRecordsError = exports.DatabaseQueryNotSupportedError = exports.DatabaseCursorInvalidError = exports.DatabaseRecordNotFoundError = void 0;
4
4
  // This file contains all the errors that are related to database records.
5
5
  const base_error_1 = require("../base-error");
6
6
  /**
@@ -17,6 +17,40 @@ class DatabaseRecordNotFoundError extends base_error_1.BaseError {
17
17
  }
18
18
  }
19
19
  exports.DatabaseRecordNotFoundError = DatabaseRecordNotFoundError;
20
+ /**
21
+ * This is thrown when a page cursor doesn't fit the list being paged.
22
+ */
23
+ class DatabaseCursorInvalidError extends base_error_1.BaseError {
24
+ /**
25
+ * This is thrown when a page cursor doesn't fit the list being paged: the token is malformed,
26
+ * came from a list with different orderings, doesn't hold one value for each ordering, its
27
+ * document id isn't a single id, or Firestore can't use one of its values.
28
+ *
29
+ * @param collectionPath the path to the collection being listed.
30
+ * @param cause the error Firestore raised for the cursor, if any.
31
+ */
32
+ constructor(collectionPath, cause) {
33
+ super(`The page cursor doesn't fit the list at ${collectionPath}`, undefined, cause);
34
+ }
35
+ }
36
+ exports.DatabaseCursorInvalidError = DatabaseCursorInvalidError;
37
+ /**
38
+ * This is thrown when a list's filters and order are a combination Firestore can't run.
39
+ */
40
+ class DatabaseQueryNotSupportedError extends base_error_1.BaseError {
41
+ /**
42
+ * This is thrown when a list's filters and order are a combination Firestore can't run, so it
43
+ * is refused before any read.
44
+ *
45
+ * @param collectionPath the path to the collection being listed.
46
+ * @param reason what makes the combination unsupported.
47
+ * @param cause the error that led to this one, if any.
48
+ */
49
+ constructor(collectionPath, reason, cause) {
50
+ super(`The list at ${collectionPath} can't be queried: ${reason}`, undefined, cause);
51
+ }
52
+ }
53
+ exports.DatabaseQueryNotSupportedError = DatabaseQueryNotSupportedError;
20
54
  /**
21
55
  * This is throw when too many database records are found.
22
56
  */
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Whether text is well-formed UTF-16, with no lone surrogate.
3
+ *
4
+ * @param text the text to check.
5
+ * @returns true when every surrogate is part of a pair.
6
+ */
7
+ declare const isWellFormedText: (text: string) => boolean;
8
+ /**
9
+ * Whether a field name or id is one Firestore reserves (`__x__`).
10
+ *
11
+ * @param name the name to check.
12
+ * @returns true when Firestore reserves the name.
13
+ */
14
+ declare const isReservedFirestoreName: (name: string) => boolean;
15
+ /**
16
+ * Whether a value is one document or collection id Firestore accepts: a well-formed string, not
17
+ * empty, no '/', not '.', '..' or reserved (`__x__`), and at most 1,500 UTF-8 bytes. Anything else
18
+ * would be refused by Firestore, or (a lone surrogate) silently name a different document.
19
+ *
20
+ * @param value the value to check.
21
+ * @returns true when the value is a usable Firestore id.
22
+ */
23
+ declare const isFirestoreDocumentId: (value: unknown) => value is string;
24
+ export { isFirestoreDocumentId, isReservedFirestoreName, isWellFormedText };
25
+ //# sourceMappingURL=firestore-id-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestore-id-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/firestore/firestore-id-helpers.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OAAqC,CAAC;AAE/E;;;;;GAKG;AACH,QAAA,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,OAAmC,CAAC;AAEpF;;;;;;;GAOG;AACH,QAAA,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAE4D,CAAC;AAEtH,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // This file contains the helper functions for Firestore names and document ids.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.isWellFormedText = exports.isReservedFirestoreName = exports.isFirestoreDocumentId = void 0;
5
+ // A lone UTF-16 surrogate. JSON can carry one, but no stored string holds one: Firestore replaces it
6
+ // with U+FFFD, so an id holding one names a different document, and a request holding one can fail
7
+ // with an error a transaction retries.
8
+ const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
9
+ // A name Firestore reserves (`__name__`, `__proto__`, ...). [\s\S], not '.', so one with a line
10
+ // terminator inside (`__a\nb__`) is still caught.
11
+ const RESERVED_NAME = /^__[\s\S]*__$/;
12
+ const MAX_ID_BYTES = 1500; // Firestore's limit on a document or collection id
13
+ /**
14
+ * Whether text is well-formed UTF-16, with no lone surrogate.
15
+ *
16
+ * @param text the text to check.
17
+ * @returns true when every surrogate is part of a pair.
18
+ */
19
+ const isWellFormedText = (text) => !LONE_SURROGATE.test(text);
20
+ exports.isWellFormedText = isWellFormedText;
21
+ /**
22
+ * Whether a field name or id is one Firestore reserves (`__x__`).
23
+ *
24
+ * @param name the name to check.
25
+ * @returns true when Firestore reserves the name.
26
+ */
27
+ const isReservedFirestoreName = (name) => RESERVED_NAME.test(name);
28
+ exports.isReservedFirestoreName = isReservedFirestoreName;
29
+ /**
30
+ * Whether a value is one document or collection id Firestore accepts: a well-formed string, not
31
+ * empty, no '/', not '.', '..' or reserved (`__x__`), and at most 1,500 UTF-8 bytes. Anything else
32
+ * would be refused by Firestore, or (a lone surrogate) silently name a different document.
33
+ *
34
+ * @param value the value to check.
35
+ * @returns true when the value is a usable Firestore id.
36
+ */
37
+ const isFirestoreDocumentId = (value) => typeof value === 'string' && value !== '' && value !== '.' && value !== '..' && !value.includes('/')
38
+ && !isReservedFirestoreName(value) && isWellFormedText(value) && Buffer.byteLength(value, 'utf8') <= MAX_ID_BYTES;
39
+ exports.isFirestoreDocumentId = isFirestoreDocumentId;
@@ -9,5 +9,6 @@ export * from './array/array-helpers';
9
9
  export * from './crypto/cryptography-helpers';
10
10
  export * from './data/data-helpers';
11
11
  export * from './file/file-helpers';
12
+ export * from './firestore/firestore-id-helpers';
12
13
  export * from './lodash/lodash-helpers';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AAMvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AAKjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AAMvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AAKjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC"}
@@ -30,4 +30,5 @@ __exportStar(require("./array/array-helpers"), exports);
30
30
  __exportStar(require("./crypto/cryptography-helpers"), exports);
31
31
  __exportStar(require("./data/data-helpers"), exports);
32
32
  __exportStar(require("./file/file-helpers"), exports);
33
+ __exportStar(require("./firestore/firestore-id-helpers"), exports);
33
34
  __exportStar(require("./lodash/lodash-helpers"), exports);
@@ -1,5 +1,5 @@
1
- import * as admin from 'firebase-admin';
2
1
  import { z } from 'zod';
2
+ import type { CollectionReference, DocumentReference, FieldPath } from 'firebase-admin/firestore';
3
3
  /**
4
4
  * This contains the additional information audit logs.
5
5
  */
@@ -37,7 +37,7 @@ export declare const IDatabaseChangeInformationSchema: z.ZodObject<{
37
37
  profile: "profile";
38
38
  }>]>;
39
39
  item: z.ZodUnknown;
40
- itemDocRef: z.ZodCustom<admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
40
+ itemDocRef: z.ZodCustom<DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
41
41
  }, z.core.$strip>;
42
42
  export type IDatabaseChangeInformation = z.infer<typeof IDatabaseChangeInformationSchema>;
43
43
  /**
@@ -60,7 +60,7 @@ export declare const IDatabasePropertyChangeInformationSchema: z.ZodObject<{
60
60
  profile: "profile";
61
61
  }>]>;
62
62
  partialObjectUpdate: z.ZodAny;
63
- itemDocRef: z.ZodCustom<admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
63
+ itemDocRef: z.ZodCustom<DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
64
64
  }, z.core.$strip>;
65
65
  export type IDatabasePropertyChangeInformation = z.infer<typeof IDatabasePropertyChangeInformationSchema>;
66
66
  /**
@@ -68,7 +68,7 @@ export type IDatabasePropertyChangeInformation = z.infer<typeof IDatabasePropert
68
68
  */
69
69
  export declare const IDatabaseRecordAndRefSchema: z.ZodObject<{
70
70
  record: z.ZodUnknown;
71
- recordDocRef: z.ZodCustom<admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
71
+ recordDocRef: z.ZodCustom<DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
72
72
  }, z.core.$strip>;
73
73
  export type IDatabaseRecordAndRef = z.infer<typeof IDatabaseRecordAndRefSchema>;
74
74
  /**
@@ -77,7 +77,7 @@ export type IDatabaseRecordAndRef = z.infer<typeof IDatabaseRecordAndRefSchema>;
77
77
  export declare const IDatabaseUpdatesSchema: z.ZodObject<{
78
78
  recordsandRefs: z.ZodArray<z.ZodObject<{
79
79
  record: z.ZodUnknown;
80
- recordDocRef: z.ZodCustom<admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
80
+ recordDocRef: z.ZodCustom<DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
81
81
  }, z.core.$strip>>;
82
82
  auditLogInfo: z.ZodObject<{
83
83
  additionalAuditLogIds: z.ZodArray<z.ZodObject<{
@@ -147,7 +147,7 @@ export declare const IDatabaseGetItemSchema: z.ZodObject<{
147
147
  }>, z.ZodEnum<{
148
148
  profile: "profile";
149
149
  }>]>;
150
- itemDocRef: z.ZodCustom<admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
150
+ itemDocRef: z.ZodCustom<DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
151
151
  throwErrorOnNotFound: z.ZodBoolean;
152
152
  }, z.core.$strip>;
153
153
  export type IDatabaseGetItem = z.infer<typeof IDatabaseGetItemSchema>;
@@ -155,7 +155,7 @@ export type IDatabaseGetItem = z.infer<typeof IDatabaseGetItemSchema>;
155
155
  * This contains the information that is needed to get information from the database.
156
156
  */
157
157
  export declare const IDatabaseOrderBySchema: z.ZodObject<{
158
- fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<admin.firestore.FieldPath, admin.firestore.FieldPath>]>;
158
+ fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FieldPath, FieldPath>]>;
159
159
  direction: z.ZodEnum<{
160
160
  desc: "desc";
161
161
  asc: "asc";
@@ -166,7 +166,7 @@ export type IDatabaseOrderBy = z.infer<typeof IDatabaseOrderBySchema>;
166
166
  * This contains the query information for the database if it is required
167
167
  */
168
168
  export declare const IDatabaseQueryFieldsSchema: z.ZodObject<{
169
- fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<admin.firestore.FieldPath, admin.firestore.FieldPath>]>;
169
+ fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FieldPath, FieldPath>]>;
170
170
  opStr: z.ZodEnum<{
171
171
  "<": "<";
172
172
  "<=": "<=";
@@ -182,6 +182,20 @@ export declare const IDatabaseQueryFieldsSchema: z.ZodObject<{
182
182
  value: z.ZodAny;
183
183
  }, z.core.$strip>;
184
184
  export type IDatabaseQueryFields = z.infer<typeof IDatabaseQueryFieldsSchema>;
185
+ /**
186
+ * A page cursor: an opaque token that getItemsFromDatabase returns as a page's nextCursor. Pass it
187
+ * back unchanged, with the same filters and orderBy, for the next page. It is a plain string of
188
+ * URL-safe characters, about 4/3 the size of the last item's ordered values as tagged JSON plus the
189
+ * list's field paths, and inside it those values keep their Firestore types. A small cursor fits
190
+ * a URL or JSON body; a large one may not (a default express.json() body takes about 100 KB, a URL
191
+ * or header about 16 KiB), so size the transport for the ordered fields in use.
192
+ *
193
+ * Opaque is not secret: the token is encoded, not encrypted. It holds the last item's value for
194
+ * every field the list is ordered by (its orderBy and every inequality filter's field), and those
195
+ * fields' names. Only hand a cursor to someone who may see those values for that item.
196
+ */
197
+ export declare const IDatabasePageCursorSchema: z.ZodString;
198
+ export type IDatabasePageCursor = z.infer<typeof IDatabasePageCursorSchema>;
185
199
  /**
186
200
  * This contains the information that is needed to get multiple items from the database.
187
201
  */
@@ -199,17 +213,17 @@ export declare const IDatabaseGetInformationSchema: z.ZodObject<{
199
213
  }>, z.ZodEnum<{
200
214
  profile: "profile";
201
215
  }>]>;
202
- itemColRef: z.ZodCustom<admin.firestore.CollectionReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.CollectionReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
203
- lastId: z.ZodString;
216
+ itemColRef: z.ZodCustom<CollectionReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, CollectionReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
217
+ cursor: z.ZodOptional<z.ZodString>;
204
218
  orderBy: z.ZodOptional<z.ZodObject<{
205
- fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<admin.firestore.FieldPath, admin.firestore.FieldPath>]>;
219
+ fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FieldPath, FieldPath>]>;
206
220
  direction: z.ZodEnum<{
207
221
  desc: "desc";
208
222
  asc: "asc";
209
223
  }>;
210
224
  }, z.core.$strip>>;
211
225
  queryFields: z.ZodArray<z.ZodObject<{
212
- fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<admin.firestore.FieldPath, admin.firestore.FieldPath>]>;
226
+ fieldPath: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FieldPath, FieldPath>]>;
213
227
  opStr: z.ZodEnum<{
214
228
  "<": "<";
215
229
  "<=": "<=";
@@ -225,8 +239,15 @@ export declare const IDatabaseGetInformationSchema: z.ZodObject<{
225
239
  value: z.ZodAny;
226
240
  }, z.core.$strip>>;
227
241
  isMaxSizeDocumentSet: z.ZodOptional<z.ZodBoolean>;
228
- }, z.core.$strip>;
242
+ }, z.core.$strict>;
229
243
  export type IDatabaseGetInformation = z.infer<typeof IDatabaseGetInformationSchema>;
244
+ /**
245
+ * A page of items from the database, and the cursor that starts the next page.
246
+ */
247
+ export interface IDatabasePage<T> {
248
+ items: T[];
249
+ nextCursor?: IDatabasePageCursor;
250
+ }
230
251
  /**
231
252
  * This contains the information to delete a single item from the database.
232
253
  */
@@ -244,7 +265,7 @@ export declare const IDatabaseDeleteItemSchema: z.ZodObject<{
244
265
  }>, z.ZodEnum<{
245
266
  profile: "profile";
246
267
  }>]>;
247
- itemDocRef: z.ZodCustom<admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>, admin.firestore.DocumentReference<admin.firestore.DocumentData, admin.firestore.DocumentData>>;
268
+ itemDocRef: z.ZodCustom<DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>, DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>>;
248
269
  throwErrorOnNotFound: z.ZodBoolean;
249
270
  }, z.core.$strip>;
250
271
  export type IDatabaseDeleteItem = z.infer<typeof IDatabaseDeleteItemSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"firestore-models.d.ts","sourceRoot":"","sources":["../../../../src/models/application/database/firestore-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;GAEG;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;iBAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;iBAK3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;;;GAIG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;iBAKnD,CAAC;AAEH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;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