@dereekb/firebase 13.11.13 → 13.11.15

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 (112) hide show
  1. package/index.cjs.js +1446 -1137
  2. package/index.esm.js +1437 -1128
  3. package/package.json +5 -5
  4. package/src/lib/client/error/error.d.ts +1 -1
  5. package/src/lib/client/firestore/array.d.ts +3 -2
  6. package/src/lib/client/firestore/driver.accessor.batch.d.ts +5 -4
  7. package/src/lib/client/firestore/driver.accessor.create.d.ts +4 -3
  8. package/src/lib/client/firestore/driver.accessor.d.ts +2 -1
  9. package/src/lib/client/firestore/driver.accessor.default.d.ts +5 -3
  10. package/src/lib/client/firestore/driver.accessor.transaction.d.ts +7 -5
  11. package/src/lib/client/firestore/driver.d.ts +1 -1
  12. package/src/lib/client/firestore/driver.query.d.ts +5 -5
  13. package/src/lib/client/firestore/increment.d.ts +3 -2
  14. package/src/lib/client/function/development.function.factory.d.ts +3 -2
  15. package/src/lib/client/function/error.d.ts +2 -2
  16. package/src/lib/client/function/function.callable.d.ts +5 -5
  17. package/src/lib/client/function/function.factory.d.ts +6 -4
  18. package/src/lib/client/function/model.function.factory.d.ts +9 -8
  19. package/src/lib/client/storage/driver.accessor.d.ts +14 -14
  20. package/src/lib/client/storage/driver.d.ts +1 -1
  21. package/src/lib/common/auth/auth.error.d.ts +2 -2
  22. package/src/lib/common/development/function.d.ts +5 -5
  23. package/src/lib/common/firestore/accessor/accessor.d.ts +22 -16
  24. package/src/lib/common/firestore/accessor/accessor.wrap.d.ts +33 -29
  25. package/src/lib/common/firestore/accessor/accessor.wrap.modify.d.ts +11 -7
  26. package/src/lib/common/firestore/accessor/array.d.ts +3 -2
  27. package/src/lib/common/firestore/accessor/document.d.ts +27 -24
  28. package/src/lib/common/firestore/accessor/document.paged.d.ts +2 -2
  29. package/src/lib/common/firestore/accessor/document.rxjs.d.ts +15 -12
  30. package/src/lib/common/firestore/accessor/document.utility.d.ts +81 -72
  31. package/src/lib/common/firestore/accessor/increment.d.ts +3 -2
  32. package/src/lib/common/firestore/cache/cache.d.ts +8 -7
  33. package/src/lib/common/firestore/cache/cache.memory.d.ts +13 -10
  34. package/src/lib/common/firestore/collection/collection.d.ts +62 -42
  35. package/src/lib/common/firestore/collection/collection.group.d.ts +4 -2
  36. package/src/lib/common/firestore/collection/collection.query.d.ts +7 -4
  37. package/src/lib/common/firestore/collection/collection.single.d.ts +4 -2
  38. package/src/lib/common/firestore/collection/collection.util.d.ts +3 -2
  39. package/src/lib/common/firestore/collection/subcollection.d.ts +4 -2
  40. package/src/lib/common/firestore/collection/subcollection.paged.d.ts +7 -3
  41. package/src/lib/common/firestore/collection/subcollection.single.d.ts +4 -2
  42. package/src/lib/common/firestore/context.d.ts +4 -2
  43. package/src/lib/common/firestore/driver/query.handler.d.ts +4 -3
  44. package/src/lib/common/firestore/error.d.ts +6 -5
  45. package/src/lib/common/firestore/query/constraint.d.ts +56 -36
  46. package/src/lib/common/firestore/query/constraint.template.d.ts +15 -7
  47. package/src/lib/common/firestore/query/iterator.d.ts +20 -13
  48. package/src/lib/common/firestore/query/query.d.ts +6 -4
  49. package/src/lib/common/firestore/query/query.iterate.array.d.ts +10 -6
  50. package/src/lib/common/firestore/query/query.iterate.d.ts +8 -8
  51. package/src/lib/common/firestore/query/query.util.d.ts +11 -7
  52. package/src/lib/common/firestore/query/watcher.d.ts +9 -7
  53. package/src/lib/common/firestore/snapshot/snapshot.d.ts +6 -3
  54. package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +230 -132
  55. package/src/lib/common/firestore/util/id.batch.d.ts +4 -2
  56. package/src/lib/common/model/function.d.ts +21 -20
  57. package/src/lib/common/model/model/model.loader.d.ts +2 -2
  58. package/src/lib/common/model/model.service.d.ts +28 -20
  59. package/src/lib/common/model/permission/permission.service.d.ts +3 -2
  60. package/src/lib/common/model/permission/permission.service.grant.d.ts +27 -21
  61. package/src/lib/common/model/permission/permission.service.role.d.ts +7 -7
  62. package/src/lib/common/storage/accessor/path.model.d.ts +3 -2
  63. package/src/lib/common/storage/context.d.ts +3 -2
  64. package/src/lib/common/storage/driver/accessor.iterate.d.ts +7 -6
  65. package/src/lib/common/storage/driver/accessor.util.d.ts +4 -4
  66. package/src/lib/common/storage/driver/error.d.ts +3 -3
  67. package/src/lib/common/storage/driver/list.d.ts +4 -3
  68. package/src/lib/common/storage/storage.d.ts +9 -8
  69. package/src/lib/common/storage/types.d.ts +1 -1
  70. package/src/lib/model/notification/notification.api.d.ts +2 -2
  71. package/src/lib/model/notification/notification.api.util.d.ts +16 -16
  72. package/src/lib/model/notification/notification.config.d.ts +35 -34
  73. package/src/lib/model/notification/notification.create.d.ts +17 -15
  74. package/src/lib/model/notification/notification.create.loggedevent.d.ts +3 -2
  75. package/src/lib/model/notification/notification.create.task.d.ts +3 -2
  76. package/src/lib/model/notification/notification.d.ts +53 -45
  77. package/src/lib/model/notification/notification.details.d.ts +5 -4
  78. package/src/lib/model/notification/notification.id.d.ts +8 -8
  79. package/src/lib/model/notification/notification.item.d.ts +3 -3
  80. package/src/lib/model/notification/notification.loggedevent.loader.d.ts +2 -2
  81. package/src/lib/model/notification/notification.message.d.ts +6 -4
  82. package/src/lib/model/notification/notification.query.d.ts +12 -12
  83. package/src/lib/model/notification/notification.send.d.ts +3 -3
  84. package/src/lib/model/notification/notification.task.d.ts +15 -15
  85. package/src/lib/model/notification/notification.task.subtask.d.ts +3 -3
  86. package/src/lib/model/notification/notification.util.d.ts +29 -29
  87. package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +2 -2
  88. package/src/lib/model/oidcmodel/oidcmodel.d.ts +6 -6
  89. package/src/lib/model/oidcmodel/oidcmodel.query.d.ts +18 -18
  90. package/src/lib/model/storagefile/storagefile.api.d.ts +2 -2
  91. package/src/lib/model/storagefile/storagefile.create.d.ts +8 -7
  92. package/src/lib/model/storagefile/storagefile.d.ts +19 -18
  93. package/src/lib/model/storagefile/storagefile.file.d.ts +2 -1
  94. package/src/lib/model/storagefile/storagefile.group.d.ts +5 -5
  95. package/src/lib/model/storagefile/storagefile.permission.d.ts +3 -2
  96. package/src/lib/model/storagefile/storagefile.query.d.ts +15 -15
  97. package/src/lib/model/storagefile/storagefile.task.d.ts +2 -2
  98. package/src/lib/model/storagefile/storagefile.upload.claims.d.ts +4 -4
  99. package/src/lib/model/storagefile/storagefile.upload.d.ts +8 -6
  100. package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +18 -16
  101. package/src/lib/model/storagefile/storagefile.util.d.ts +8 -8
  102. package/src/lib/model/system/system.d.ts +6 -6
  103. package/test/index.cjs.js +43 -43
  104. package/test/index.esm.js +38 -38
  105. package/test/package.json +6 -6
  106. package/test/src/lib/client/firebase.d.ts +1 -1
  107. package/test/src/lib/common/firestore/firestore.d.ts +3 -3
  108. package/test/src/lib/common/mock/mock.item.collection.fixture.d.ts +3 -3
  109. package/test/src/lib/common/mock/mock.item.d.ts +16 -16
  110. package/test/src/lib/common/mock/mock.item.query.d.ts +4 -4
  111. package/test/src/lib/common/mock/mock.item.storage.fixture.d.ts +3 -3
  112. package/test/src/lib/common/storage/storage.d.ts +1 -1
@@ -52,6 +52,9 @@ export interface MockItemCollectionFirebaseContextConfig {
52
52
  *
53
53
  * Compose with a Firebase test context factory to get a fully wired test environment:
54
54
  *
55
+ * @param _config - Reserved for future setup/teardown configuration; currently unused.
56
+ * @returns A factory builder that wraps a parent {@link TestFirestoreContextFixture} with a {@link MockItemCollectionFixture} per test.
57
+ *
55
58
  * @example
56
59
  * ```ts
57
60
  * const f = testWithMockItemCollectionFixture()(authorizedFirebaseFactory);
@@ -59,8 +62,5 @@ export interface MockItemCollectionFirebaseContextConfig {
59
62
  * it('should work', () => { ... });
60
63
  * }));
61
64
  * ```
62
- *
63
- * @param _config - Reserved for future setup/teardown configuration; currently unused.
64
- * @returns A factory builder that wraps a parent {@link TestFirestoreContextFixture} with a {@link MockItemCollectionFixture} per test.
65
65
  */
66
66
  export declare function testWithMockItemCollectionFixture(_config?: MockItemCollectionFirebaseContextConfig): TestWrappedContextFactoryBuilder<MockItemCollectionFixture, TestFirestoreContextFixture>;
@@ -83,14 +83,14 @@ export type MockItemFirestoreCollection = FirestoreCollection<MockItem, MockItem
83
83
  /**
84
84
  * Creates a {@link MockItemFirestoreCollection} bound to the given {@link FirestoreContext}.
85
85
  *
86
+ * @param firestoreContext - The Firestore context (test or production) used to resolve the underlying collection reference.
87
+ * @returns A {@link MockItemFirestoreCollection} wired with the {@link mockItemConverter} and {@link mockItemIdentity}.
88
+ *
86
89
  * @example
87
90
  * ```ts
88
91
  * const collection = mockItemFirestoreCollection(firestoreContext);
89
92
  * const doc = collection.documentAccessor().newDocument();
90
93
  * ```
91
- *
92
- * @param firestoreContext - The Firestore context (test or production) used to resolve the underlying collection reference.
93
- * @returns A {@link MockItemFirestoreCollection} wired with the {@link mockItemConverter} and {@link mockItemIdentity}.
94
94
  */
95
95
  export declare function mockItemFirestoreCollection(firestoreContext: FirestoreContext): MockItemFirestoreCollection;
96
96
  /**
@@ -182,7 +182,7 @@ export declare const mockItemPrivateConverter: import("@dereekb/firebase").Snaps
182
182
  * subcollections under a given {@link MockItemDocument} parent.
183
183
  *
184
184
  * @param context - The Firestore context used to resolve subcollections.
185
- * @returns A function that, given a parent {@link MockItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemPrivate subcollection.
185
+ * @returns Function that, given a parent {@link MockItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemPrivate subcollection.
186
186
  */
187
187
  export declare function mockItemPrivateCollectionReferenceFactory(context: FirestoreContext): (parent: MockItemDocument) => CollectionReference<MockItemPrivate>;
188
188
  /**
@@ -247,11 +247,11 @@ export type MockItemUserData = FirestoreModelData<MockItemUser, {}>;
247
247
  /**
248
248
  * Firestore collection path name.
249
249
  */
250
- export declare const mockItemUserCollectionName = "mockItemUser";
250
+ export declare const MOCK_ITEM_USER_COLLECTION_NAME = "mockItemUser";
251
251
  /**
252
252
  * Default document identifier used for MockItemUser in tests.
253
253
  */
254
- export declare const mockItemUserIdentifier = "0";
254
+ export declare const MOCK_ITEM_USER_IDENTIFIER = "0";
255
255
  /**
256
256
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
257
257
  */
@@ -267,7 +267,7 @@ export declare const mockItemUserConverter: import("@dereekb/firebase").Snapshot
267
267
  * subcollections under a given {@link MockItemDocument} parent.
268
268
  *
269
269
  * @param context - The Firestore context used to resolve subcollections.
270
- * @returns A function that, given a parent {@link MockItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemUser subcollection.
270
+ * @returns Function that, given a parent {@link MockItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemUser subcollection.
271
271
  */
272
272
  export declare function mockItemUserCollectionReferenceFactory(context: FirestoreContext): (parent: MockItemDocument) => CollectionReference<MockItemUser>;
273
273
  /**
@@ -347,7 +347,7 @@ export declare const mockItemSubItemConverter: import("@dereekb/firebase").Snaps
347
347
  * subcollections under a given {@link MockItemDocument} parent.
348
348
  *
349
349
  * @param context - The Firestore context used to resolve subcollections.
350
- * @returns A function that, given a parent {@link MockItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemSubItem subcollection.
350
+ * @returns Function that, given a parent {@link MockItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemSubItem subcollection.
351
351
  */
352
352
  export declare function mockItemSubItemCollectionReferenceFactory(context: FirestoreContext): (parent: MockItemDocument) => CollectionReference<MockItemSubItem>;
353
353
  /**
@@ -423,7 +423,7 @@ export declare const mockItemSubItemDeepConverter: import("@dereekb/firebase").S
423
423
  * subcollections under a given {@link MockItemSubItemDocument} parent.
424
424
  *
425
425
  * @param context - The Firestore context used to resolve subcollections.
426
- * @returns A function that, given a parent {@link MockItemSubItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemSubItemDeep subcollection.
426
+ * @returns Function that, given a parent {@link MockItemSubItemDocument}, returns a typed {@link CollectionReference} for that parent's MockItemSubItemDeep subcollection.
427
427
  */
428
428
  export declare function mockItemSubItemDeepCollectionReferenceFactory(context: FirestoreContext): (parent: MockItemSubItemDocument) => CollectionReference<MockItemSubItemDeep>;
429
429
  /**
@@ -504,17 +504,17 @@ export declare class MockItemPagedDocument extends AbstractFirestoreDocumentWith
504
504
  * The mock entry shape is already Firestore-safe, so the converter is an identity
505
505
  * pass-through. Production usage may wrap a real converter (e.g. for date fields).
506
506
  */
507
- export declare const mockItemPagedEntryConverter: PagedItemConverter<MockItemPagedEntry>;
507
+ export declare const MOCK_ITEM_PAGED_ENTRY_CONVERTER: PagedItemConverter<MockItemPagedEntry>;
508
508
  /**
509
509
  * Static distribution scheme for {@link MockItemPagedEntry} that buckets items by their
510
510
  * {@link MockItemPagedEntry.group} field across three page IDs (`a`, `b`, `c`).
511
511
  */
512
- export declare const mockItemPagedAlphaDistributionScheme: PagedItemDistributionScheme<MockItemPagedEntry>;
512
+ export declare const MOCK_ITEM_PAGED_ALPHA_DISTRIBUTION_SCHEME: PagedItemDistributionScheme<MockItemPagedEntry>;
513
513
  /**
514
514
  * Default `maxItemsPerPage` used by the dynamic mock paged collection factory. Kept small to
515
515
  * exercise multi-page boundary conditions in tests without writing many entries.
516
516
  */
517
- export declare const MOCK_ITEM_PAGED_DEFAULT_MAX_ITEMS_PER_PAGE = 3;
517
+ export declare const DEFAULT_MOCK_ITEM_PAGED_MAX_ITEMS_PER_PAGE = 3;
518
518
  /**
519
519
  * Typed {@link PagedItemFirestoreCollection} for {@link MockItemPagedEntry} items under a
520
520
  * {@link MockItem} parent.
@@ -536,7 +536,7 @@ export interface MockItemPagedFirestoreCollectionConfig {
536
536
  readonly distributionScheme?: PagedItemDistributionScheme<MockItemPagedEntry>;
537
537
  /**
538
538
  * Maximum items per page document in dynamic mode. Defaults to
539
- * {@link MOCK_ITEM_PAGED_DEFAULT_MAX_ITEMS_PER_PAGE}.
539
+ * {@link DEFAULT_MOCK_ITEM_PAGED_MAX_ITEMS_PER_PAGE}.
540
540
  */
541
541
  readonly maxItemsPerPage?: number;
542
542
  }
@@ -547,7 +547,7 @@ export interface MockItemPagedFirestoreCollectionConfig {
547
547
  * @param firestoreContext - The Firestore context used to resolve the underlying subcollection.
548
548
  * @param config - Optional config selecting between dynamic (default) and static distribution.
549
549
  * @returns A factory that, given a parent {@link MockItemDocument}, returns a paged subcollection
550
- * wired with {@link mockItemPagedEntryConverter}.
550
+ * wired with {@link MOCK_ITEM_PAGED_ENTRY_CONVERTER}.
551
551
  */
552
552
  export declare function mockItemPagedFirestoreCollection(firestoreContext: FirestoreContext, config?: MockItemPagedFirestoreCollectionConfig): MockItemPagedFirestoreCollectionFactory;
553
553
  /**
@@ -579,7 +579,7 @@ export declare function mockItemPagedFirestoreCollectionGroup(firestoreContext:
579
579
  /**
580
580
  * System state type identifier for mock system state data.
581
581
  *
582
- * Used as the key in {@link mockItemSystemStateStoredDataConverterMap}.
582
+ * Used as the key in {@link MOCK_ITEM_SYSTEM_STATE_STORED_DATA_CONVERTER_MAP}.
583
583
  */
584
584
  export declare const MOCK_SYSTEM_STATE_TYPE = "mockitemsystemstate";
585
585
  /**
@@ -604,4 +604,4 @@ export declare const mockItemSystemDataConverter: SystemStateStoredDataFieldConv
604
604
  * Used when creating the mock system state Firestore collection to register
605
605
  * the {@link MockSystemData} converter under the {@link MOCK_SYSTEM_STATE_TYPE} key.
606
606
  */
607
- export declare const mockItemSystemStateStoredDataConverterMap: SystemStateStoredDataConverterMap;
607
+ export declare const MOCK_ITEM_SYSTEM_STATE_STORED_DATA_CONVERTER_MAP: SystemStateStoredDataConverterMap;
@@ -3,14 +3,14 @@ import { type FirestoreQueryConstraint, type DocumentReference } from '@dereekb/
3
3
  /**
4
4
  * Creates a Firestore query constraint that filters {@link MockItem} documents by their `value` field.
5
5
  *
6
+ * @param value - The exact `value` to match.
7
+ * @returns A `where('value', '==', value)` constraint typed for {@link MockItem}.
8
+ *
6
9
  * @example
7
10
  * ```ts
8
11
  * const constraint = mockItemWithValue('hello');
9
12
  * const results = await collection.query(constraint);
10
13
  * ```
11
- *
12
- * @param value - The exact `value` to match.
13
- * @returns A `where('value', '==', value)` constraint typed for {@link MockItem}.
14
14
  */
15
15
  export declare function mockItemWithValue(value: string): FirestoreQueryConstraint;
16
16
  /**
@@ -35,6 +35,6 @@ export declare function mockItemWithTestValue(test: boolean): FirestoreQueryCons
35
35
  * https://medium.com/firebase-developers/how-to-query-collections-in-firestore-under-a-certain-path-6a0d686cebd2
36
36
  *
37
37
  * @param mockItem - The parent {@link MockItem} document reference whose descendant documents the constraint should bound to.
38
- * @returns An array of constraints (suitable for use on a collection group query) that restricts results to documents under the given parent path.
38
+ * @returns The constraints (suitable for use on a collection group query) that restricts results to documents under the given parent path.
39
39
  */
40
40
  export declare function allChildMockItemSubItemDeepsWithinMockItem(mockItem: DocumentReference<MockItem>): FirestoreQueryConstraint[];
@@ -34,6 +34,9 @@ export interface MockItemStorageFirebaseStorageContextConfig {
34
34
  *
35
35
  * Compose with a Firebase test context factory to get a fully wired storage test environment:
36
36
  *
37
+ * @param _config - Reserved for future setup/teardown configuration; currently unused.
38
+ * @returns A factory builder that wraps a parent {@link TestFirebaseStorageContextFixture} with a {@link MockItemStorageFixture} per test.
39
+ *
37
40
  * @example
38
41
  * ```ts
39
42
  * const f = testWithMockItemStorageFixture()(authorizedFirebaseFactory);
@@ -41,8 +44,5 @@ export interface MockItemStorageFirebaseStorageContextConfig {
41
44
  * it('should upload', () => { ... });
42
45
  * }));
43
46
  * ```
44
- *
45
- * @param _config - Reserved for future setup/teardown configuration; currently unused.
46
- * @returns A factory builder that wraps a parent {@link TestFirebaseStorageContextFixture} with a {@link MockItemStorageFixture} per test.
47
47
  */
48
48
  export declare function testWithMockItemStorageFixture(_config?: MockItemStorageFirebaseStorageContextConfig): TestWrappedContextFactoryBuilder<MockItemStorageFixture, TestFirebaseStorageContextFixture>;
@@ -10,7 +10,7 @@ export interface MakeTestingFirebaseStorageAccessorDriverConfig {
10
10
  * original driver's default bucket is preserved. When omitted, a test bucket is
11
11
  * generated only if the base driver does not already define a default bucket.
12
12
  */
13
- useTestDefaultBucket?: boolean;
13
+ readonly useTestDefaultBucket?: boolean;
14
14
  }
15
15
  /**
16
16
  * Creates a {@link TestingFirebaseStorageAccessorDriver} that wraps the given driver,