@dereekb/firebase 13.11.14 → 13.11.16
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/eslint/index.cjs.default.js +1 -0
- package/eslint/index.cjs.js +2290 -0
- package/eslint/index.cjs.mjs +2 -0
- package/eslint/index.d.ts +1 -0
- package/eslint/index.esm.js +2277 -0
- package/eslint/package.json +24 -0
- package/eslint/src/index.d.ts +1 -0
- package/eslint/src/lib/comments.d.ts +112 -0
- package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
- package/eslint/src/lib/index.d.ts +6 -0
- package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
- package/eslint/src/lib/plugin.d.ts +28 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +47 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-query-suffix.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-valid-dispatcher.rule.d.ts +54 -0
- package/eslint/src/lib/require-tagged-firestore-constraints.rule.d.ts +46 -0
- package/eslint/src/lib/util.d.ts +107 -0
- package/index.cjs.js +1446 -1137
- package/index.esm.js +1437 -1128
- package/package.json +11 -5
- package/src/lib/client/error/error.d.ts +1 -1
- package/src/lib/client/firestore/array.d.ts +3 -2
- package/src/lib/client/firestore/driver.accessor.batch.d.ts +5 -4
- package/src/lib/client/firestore/driver.accessor.create.d.ts +4 -3
- package/src/lib/client/firestore/driver.accessor.d.ts +2 -1
- package/src/lib/client/firestore/driver.accessor.default.d.ts +5 -3
- package/src/lib/client/firestore/driver.accessor.transaction.d.ts +7 -5
- package/src/lib/client/firestore/driver.d.ts +1 -1
- package/src/lib/client/firestore/driver.query.d.ts +5 -5
- package/src/lib/client/firestore/increment.d.ts +3 -2
- package/src/lib/client/function/development.function.factory.d.ts +3 -2
- package/src/lib/client/function/error.d.ts +2 -2
- package/src/lib/client/function/function.callable.d.ts +5 -5
- package/src/lib/client/function/function.factory.d.ts +6 -4
- package/src/lib/client/function/model.function.factory.d.ts +9 -8
- package/src/lib/client/storage/driver.accessor.d.ts +14 -14
- package/src/lib/client/storage/driver.d.ts +1 -1
- package/src/lib/common/auth/auth.error.d.ts +2 -2
- package/src/lib/common/development/function.d.ts +5 -5
- package/src/lib/common/firestore/accessor/accessor.d.ts +22 -16
- package/src/lib/common/firestore/accessor/accessor.wrap.d.ts +33 -29
- package/src/lib/common/firestore/accessor/accessor.wrap.modify.d.ts +11 -7
- package/src/lib/common/firestore/accessor/array.d.ts +3 -2
- package/src/lib/common/firestore/accessor/document.d.ts +27 -24
- package/src/lib/common/firestore/accessor/document.paged.d.ts +2 -2
- package/src/lib/common/firestore/accessor/document.rxjs.d.ts +15 -12
- package/src/lib/common/firestore/accessor/document.utility.d.ts +81 -72
- package/src/lib/common/firestore/accessor/increment.d.ts +3 -2
- package/src/lib/common/firestore/cache/cache.d.ts +8 -7
- package/src/lib/common/firestore/cache/cache.memory.d.ts +13 -10
- package/src/lib/common/firestore/collection/collection.d.ts +62 -42
- package/src/lib/common/firestore/collection/collection.group.d.ts +4 -2
- package/src/lib/common/firestore/collection/collection.query.d.ts +7 -4
- package/src/lib/common/firestore/collection/collection.single.d.ts +4 -2
- package/src/lib/common/firestore/collection/collection.util.d.ts +3 -2
- package/src/lib/common/firestore/collection/subcollection.d.ts +4 -2
- package/src/lib/common/firestore/collection/subcollection.paged.d.ts +7 -3
- package/src/lib/common/firestore/collection/subcollection.single.d.ts +4 -2
- package/src/lib/common/firestore/context.d.ts +4 -2
- package/src/lib/common/firestore/driver/query.handler.d.ts +4 -3
- package/src/lib/common/firestore/error.d.ts +6 -5
- package/src/lib/common/firestore/query/constraint.d.ts +56 -36
- package/src/lib/common/firestore/query/constraint.template.d.ts +15 -7
- package/src/lib/common/firestore/query/iterator.d.ts +20 -13
- package/src/lib/common/firestore/query/query.d.ts +6 -4
- package/src/lib/common/firestore/query/query.iterate.array.d.ts +10 -6
- package/src/lib/common/firestore/query/query.iterate.d.ts +8 -8
- package/src/lib/common/firestore/query/query.util.d.ts +11 -7
- package/src/lib/common/firestore/query/watcher.d.ts +9 -7
- package/src/lib/common/firestore/snapshot/snapshot.d.ts +6 -3
- package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +230 -132
- package/src/lib/common/firestore/util/id.batch.d.ts +4 -2
- package/src/lib/common/model/function.d.ts +21 -20
- package/src/lib/common/model/model/model.loader.d.ts +2 -2
- package/src/lib/common/model/model.service.d.ts +28 -20
- package/src/lib/common/model/permission/permission.service.d.ts +3 -2
- package/src/lib/common/model/permission/permission.service.grant.d.ts +27 -21
- package/src/lib/common/model/permission/permission.service.role.d.ts +7 -7
- package/src/lib/common/storage/accessor/path.model.d.ts +3 -2
- package/src/lib/common/storage/context.d.ts +3 -2
- package/src/lib/common/storage/driver/accessor.iterate.d.ts +7 -6
- package/src/lib/common/storage/driver/accessor.util.d.ts +4 -4
- package/src/lib/common/storage/driver/error.d.ts +3 -3
- package/src/lib/common/storage/driver/list.d.ts +4 -3
- package/src/lib/common/storage/storage.d.ts +9 -8
- package/src/lib/common/storage/types.d.ts +1 -1
- package/src/lib/model/notification/notification.api.d.ts +2 -2
- package/src/lib/model/notification/notification.api.util.d.ts +16 -16
- package/src/lib/model/notification/notification.config.d.ts +35 -34
- package/src/lib/model/notification/notification.create.d.ts +17 -15
- package/src/lib/model/notification/notification.create.loggedevent.d.ts +3 -2
- package/src/lib/model/notification/notification.create.task.d.ts +3 -2
- package/src/lib/model/notification/notification.d.ts +53 -45
- package/src/lib/model/notification/notification.details.d.ts +5 -4
- package/src/lib/model/notification/notification.id.d.ts +8 -8
- package/src/lib/model/notification/notification.item.d.ts +3 -3
- package/src/lib/model/notification/notification.loggedevent.loader.d.ts +2 -2
- package/src/lib/model/notification/notification.message.d.ts +6 -4
- package/src/lib/model/notification/notification.query.d.ts +12 -12
- package/src/lib/model/notification/notification.send.d.ts +3 -3
- package/src/lib/model/notification/notification.task.d.ts +15 -15
- package/src/lib/model/notification/notification.task.subtask.d.ts +3 -3
- package/src/lib/model/notification/notification.util.d.ts +29 -29
- package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +2 -2
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +6 -6
- package/src/lib/model/oidcmodel/oidcmodel.query.d.ts +18 -18
- package/src/lib/model/storagefile/storagefile.api.d.ts +2 -2
- package/src/lib/model/storagefile/storagefile.create.d.ts +8 -7
- package/src/lib/model/storagefile/storagefile.d.ts +19 -18
- package/src/lib/model/storagefile/storagefile.file.d.ts +2 -1
- package/src/lib/model/storagefile/storagefile.group.d.ts +5 -5
- package/src/lib/model/storagefile/storagefile.permission.d.ts +3 -2
- package/src/lib/model/storagefile/storagefile.query.d.ts +15 -15
- package/src/lib/model/storagefile/storagefile.task.d.ts +2 -2
- package/src/lib/model/storagefile/storagefile.upload.claims.d.ts +4 -4
- package/src/lib/model/storagefile/storagefile.upload.d.ts +8 -6
- package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +18 -16
- package/src/lib/model/storagefile/storagefile.util.d.ts +8 -8
- package/src/lib/model/system/system.d.ts +6 -6
- package/test/index.cjs.js +43 -43
- package/test/index.esm.js +38 -38
- package/test/package.json +6 -6
- package/test/src/lib/client/firebase.d.ts +1 -1
- package/test/src/lib/common/firestore/firestore.d.ts +3 -3
- package/test/src/lib/common/mock/mock.item.collection.fixture.d.ts +3 -3
- package/test/src/lib/common/mock/mock.item.d.ts +16 -16
- package/test/src/lib/common/mock/mock.item.query.d.ts +4 -4
- package/test/src/lib/common/mock/mock.item.storage.fixture.d.ts +3 -3
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|