@dereekb/firebase 13.11.2 → 13.11.4
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/index.cjs.js +2467 -568
- package/index.esm.js +2443 -572
- package/package.json +5 -5
- package/src/lib/client/firestore/array.d.ts +1 -0
- package/src/lib/client/firestore/driver.accessor.batch.d.ts +1 -0
- package/src/lib/client/firestore/driver.accessor.create.d.ts +1 -0
- package/src/lib/client/firestore/driver.accessor.d.ts +1 -0
- package/src/lib/client/firestore/driver.accessor.default.d.ts +1 -0
- package/src/lib/client/firestore/driver.accessor.transaction.d.ts +1 -0
- package/src/lib/client/firestore/increment.d.ts +1 -0
- package/src/lib/client/function/development.function.factory.d.ts +1 -0
- package/src/lib/client/function/function.factory.d.ts +2 -0
- package/src/lib/client/function/model.function.factory.d.ts +1 -0
- package/src/lib/common/firestore/accessor/accessor.d.ts +1 -0
- package/src/lib/common/firestore/accessor/accessor.wrap.d.ts +1 -0
- package/src/lib/common/firestore/accessor/accessor.wrap.modify.d.ts +4 -0
- package/src/lib/common/firestore/accessor/array.d.ts +1 -0
- package/src/lib/common/firestore/accessor/document.d.ts +4 -0
- package/src/lib/common/firestore/accessor/document.paged.d.ts +134 -0
- package/src/lib/common/firestore/accessor/document.utility.d.ts +195 -0
- package/src/lib/common/firestore/accessor/increment.d.ts +1 -0
- package/src/lib/common/firestore/accessor/index.d.ts +1 -0
- package/src/lib/common/firestore/cache/cache.d.ts +1 -0
- package/src/lib/common/firestore/cache/cache.memory.d.ts +3 -0
- package/src/lib/common/firestore/collection/collection.d.ts +29 -2
- package/src/lib/common/firestore/collection/collection.group.d.ts +1 -0
- package/src/lib/common/firestore/collection/collection.query.d.ts +1 -0
- package/src/lib/common/firestore/collection/collection.single.d.ts +1 -0
- package/src/lib/common/firestore/collection/collection.util.d.ts +1 -0
- package/src/lib/common/firestore/collection/index.d.ts +1 -0
- package/src/lib/common/firestore/collection/subcollection.d.ts +1 -0
- package/src/lib/common/firestore/collection/subcollection.paged.d.ts +226 -0
- package/src/lib/common/firestore/collection/subcollection.single.d.ts +1 -0
- package/src/lib/common/firestore/context.d.ts +37 -1
- package/src/lib/common/firestore/driver/query.handler.d.ts +1 -0
- package/src/lib/common/firestore/error.d.ts +1 -0
- package/src/lib/common/firestore/query/constraint.d.ts +2 -0
- package/src/lib/common/firestore/query/iterator.d.ts +5 -0
- package/src/lib/common/firestore/query/query.d.ts +1 -0
- package/src/lib/common/firestore/snapshot/snapshot.d.ts +1 -0
- package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +262 -0
- package/src/lib/common/firestore/util/id.batch.d.ts +1 -0
- package/src/lib/common/model/function.d.ts +1 -0
- package/src/lib/common/model/model.service.d.ts +8 -0
- package/src/lib/common/model/permission/permission.service.d.ts +1 -0
- package/src/lib/common/model/permission/permission.service.grant.d.ts +6 -0
- package/src/lib/common/storage/accessor/path.model.d.ts +1 -0
- package/src/lib/common/storage/context.d.ts +1 -0
- package/src/lib/common/storage/driver/accessor.iterate.d.ts +1 -0
- package/src/lib/common/storage/driver/list.d.ts +1 -0
- package/src/lib/common/storage/storage.d.ts +1 -0
- package/src/lib/model/notification/index.d.ts +2 -0
- package/src/lib/model/notification/notification.api.d.ts +36 -1
- package/src/lib/model/notification/notification.config.d.ts +1 -0
- package/src/lib/model/notification/notification.create.d.ts +2 -0
- package/src/lib/model/notification/notification.create.loggedevent.d.ts +33 -0
- package/src/lib/model/notification/notification.create.task.d.ts +1 -0
- package/src/lib/model/notification/notification.d.ts +179 -3
- package/src/lib/model/notification/notification.details.d.ts +1 -0
- package/src/lib/model/notification/notification.id.d.ts +23 -1
- package/src/lib/model/notification/notification.loggedevent.loader.d.ts +82 -0
- package/src/lib/model/notification/notification.message.d.ts +2 -0
- package/src/lib/model/notification/notification.query.d.ts +17 -0
- package/src/lib/model/notification/notification.util.d.ts +12 -1
- package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +23 -0
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +18 -0
- package/src/lib/model/oidcmodel/oidcmodel.data.d.ts +26 -0
- package/src/lib/model/oidcmodel/oidcmodel.query.d.ts +18 -0
- package/src/lib/model/storagefile/storagefile.create.d.ts +1 -0
- package/src/lib/model/storagefile/storagefile.d.ts +1 -0
- package/src/lib/model/storagefile/storagefile.file.d.ts +1 -0
- package/src/lib/model/storagefile/storagefile.permission.d.ts +1 -0
- package/src/lib/model/storagefile/storagefile.upload.d.ts +2 -0
- package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +2 -0
- package/test/index.cjs.js +1038 -1
- package/test/index.esm.js +1031 -3
- package/test/package.json +6 -6
- package/test/src/lib/common/mock/mock.item.d.ts +119 -2
- package/test/src/lib/common/mock/mock.item.service.d.ts +21 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type Maybe } from '@dereekb/util';
|
|
2
|
+
import { type Transaction, type FirestoreDocumentSnapshotDataPair } from '../../common';
|
|
3
|
+
import { type NotificationBoxDocument, type NotificationFirestoreCollections, type NotificationLoggedEventDayDocument } from './notification';
|
|
4
|
+
import { type NotificationLoggedEventDayId, type NotificationTaskType, type NotificationTemplateType } from './notification.id';
|
|
5
|
+
import { type NotificationItem } from './notification.item';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for {@link notificationLoggedEventLoader}.
|
|
8
|
+
*/
|
|
9
|
+
export interface NotificationLoggedEventLoaderConfig {
|
|
10
|
+
readonly notificationFirestoreCollections: NotificationFirestoreCollections;
|
|
11
|
+
readonly notificationBox: NotificationBoxDocument;
|
|
12
|
+
readonly transaction?: Maybe<Transaction>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Input for {@link NotificationLoggedEventLoader.getItemsForDayRange}.
|
|
16
|
+
*/
|
|
17
|
+
export interface NotificationLoggedEventLoaderItemsForDayRangeInput {
|
|
18
|
+
readonly from: Date;
|
|
19
|
+
readonly to: Date;
|
|
20
|
+
readonly type?: Maybe<NotificationTemplateType | NotificationTaskType>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Per-day result yielded by {@link NotificationLoggedEventLoader.forEachDayInRange}.
|
|
24
|
+
*/
|
|
25
|
+
export interface NotificationLoggedEventLoaderDayResult {
|
|
26
|
+
readonly dayId: NotificationLoggedEventDayId;
|
|
27
|
+
readonly items: NotificationItem[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Input for {@link NotificationLoggedEventLoader.forEachDayInRange}.
|
|
31
|
+
*/
|
|
32
|
+
export interface NotificationLoggedEventLoaderForEachDayInRangeInput {
|
|
33
|
+
readonly from: Date;
|
|
34
|
+
readonly to: Date;
|
|
35
|
+
readonly type?: Maybe<NotificationTemplateType | NotificationTaskType>;
|
|
36
|
+
readonly maxParallelTasks?: Maybe<number>;
|
|
37
|
+
readonly handler: (input: NotificationLoggedEventLoaderDayResult) => Promise<void> | void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Cached, range-aware reader for the {@link NotificationLoggedEventDay} archive of a single
|
|
41
|
+
* {@link NotificationBoxDocument}. Mirrors the pattern of `regionalHeirarchyForRegionalObjectModelKeyLoader`
|
|
42
|
+
* — request-scoped, deduplicates reads via promise caching, and exposes both per-day and
|
|
43
|
+
* date-range methods.
|
|
44
|
+
*/
|
|
45
|
+
export interface NotificationLoggedEventLoader {
|
|
46
|
+
readonly notificationBox: NotificationBoxDocument;
|
|
47
|
+
/**
|
|
48
|
+
* Loads (and caches) the {@link NotificationLoggedEventDay} wrapper document for the given day.
|
|
49
|
+
*/
|
|
50
|
+
getDay(dayId: NotificationLoggedEventDayId): Promise<FirestoreDocumentSnapshotDataPair<NotificationLoggedEventDayDocument>>;
|
|
51
|
+
/**
|
|
52
|
+
* Loads (and caches) every archived {@link NotificationItem} for the given day.
|
|
53
|
+
*/
|
|
54
|
+
getItemsForDay(dayId: NotificationLoggedEventDayId): Promise<NotificationItem[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Loads items for the given day, filtered to those whose `t` matches the given type.
|
|
57
|
+
* Reuses the underlying day cache; no extra Firestore reads.
|
|
58
|
+
*/
|
|
59
|
+
getItemsForDayWithType(dayId: NotificationLoggedEventDayId, type: NotificationTemplateType | NotificationTaskType): Promise<NotificationItem[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Loads items across all days in `[from, to]` (inclusive), optionally filtered by type.
|
|
62
|
+
* Days with no archive contribute zero items.
|
|
63
|
+
*/
|
|
64
|
+
getItemsForDayRange(input: NotificationLoggedEventLoaderItemsForDayRangeInput): Promise<NotificationItem[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Streams items per-day across `[from, to]` (inclusive). Each day is loaded via the same cache
|
|
67
|
+
* as the per-day getters and passed to `handler` exactly once. Concurrency is bounded by
|
|
68
|
+
* `maxParallelTasks` (defaults to unbounded — same as {@link performTasksFromFactoryInParallelFunction}).
|
|
69
|
+
*/
|
|
70
|
+
forEachDayInRange(input: NotificationLoggedEventLoaderForEachDayInRangeInput): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Creates a request-scoped {@link NotificationLoggedEventLoader} that caches both day wrapper
|
|
74
|
+
* snapshots (via {@link limitedFirestoreDocumentAccessorSnapshotCache}) and the per-day merged
|
|
75
|
+
* `NotificationItem[]` from the paged subcollection.
|
|
76
|
+
*
|
|
77
|
+
* Cache lifetime is the loader instance — create one per request/transaction; do not retain.
|
|
78
|
+
*
|
|
79
|
+
* @param config - notification collections, the parent {@link NotificationBoxDocument}, optional transaction.
|
|
80
|
+
* @returns the cached loader.
|
|
81
|
+
*/
|
|
82
|
+
export declare function notificationLoggedEventLoader(config: NotificationLoggedEventLoaderConfig): NotificationLoggedEventLoader;
|
|
@@ -280,6 +280,7 @@ export type NotificationMessageFunction = NotificationMessageFunctionWithoutExtr
|
|
|
280
280
|
* { globalRecipients: [adminRecipient] }
|
|
281
281
|
* );
|
|
282
282
|
* ```
|
|
283
|
+
* @__NO_SIDE_EFFECTS__
|
|
283
284
|
*/
|
|
284
285
|
export declare function notificationMessageFunction(fn: NotificationMessageFunctionWithoutExtras, extras?: NotificationMessageFunctionExtras): NotificationMessageFunction;
|
|
285
286
|
/**
|
|
@@ -296,5 +297,6 @@ export declare function notificationMessageFunction(fn: NotificationMessageFunct
|
|
|
296
297
|
* const msg = await msgFn(inputContext);
|
|
297
298
|
* // msg.flag === NotificationMessageFlag.NO_CONTENT
|
|
298
299
|
* ```
|
|
300
|
+
* @__NO_SIDE_EFFECTS__
|
|
299
301
|
*/
|
|
300
302
|
export declare function noContentNotificationMessageFunctionFactory<D extends NotificationItemMetadata = {}>(): NotificationMessageFunctionFactory<D>;
|
|
@@ -59,3 +59,20 @@ export declare function notificationsPastSendAtTimeQuery(now?: Date): FirestoreQ
|
|
|
59
59
|
* @returns array of Firestore query constraints filtering for completed notifications ready to archive
|
|
60
60
|
*/
|
|
61
61
|
export declare function notificationsReadyForCleanupQuery(): FirestoreQueryConstraint[];
|
|
62
|
+
/**
|
|
63
|
+
* Query constraints for finding {@link NotificationLoggedEventDay} documents whose ISO day string
|
|
64
|
+
* is older than `now - retentionDays`.
|
|
65
|
+
*
|
|
66
|
+
* Intended for use against the {@link NotificationLoggedEventDayFirestoreCollectionGroup} during
|
|
67
|
+
* scheduled retention cleanup. Documents older than the cutoff (and their nested page subcollection
|
|
68
|
+
* contents) should be deleted.
|
|
69
|
+
*
|
|
70
|
+
* Uses the `d` field rather than document ID — Firestore collection-group queries cannot filter on
|
|
71
|
+
* `FieldPath.documentId()` with a bare day string (it requires a full path). The `d` field stores
|
|
72
|
+
* the same ISO 8601 day string as the document ID and supports a plain inequality.
|
|
73
|
+
*
|
|
74
|
+
* @param retentionDays - number of days of history to retain; days strictly older than `now - retentionDays` match
|
|
75
|
+
* @param now - reference time for the cutoff (defaults to current time)
|
|
76
|
+
* @returns array of Firestore query constraints filtering by the day string
|
|
77
|
+
*/
|
|
78
|
+
export declare function notificationLoggedEventDaysOlderThanQuery(retentionDays: number, now?: Date): FirestoreQueryConstraint[];
|
|
@@ -126,11 +126,22 @@ export interface AllowedNotificationRecipients {
|
|
|
126
126
|
* @returns an object indicating which recipient groups are permitted for this notification
|
|
127
127
|
*/
|
|
128
128
|
export declare function allowedNotificationRecipients(flag?: Maybe<NotificationRecipientSendFlag>): AllowedNotificationRecipients;
|
|
129
|
+
/**
|
|
130
|
+
* Returns true if the given notification is a logged-event record (`st === LOGGED_EVENT`).
|
|
131
|
+
*
|
|
132
|
+
* Logged-event notifications bypass the normal send pipeline entirely and are archived to the
|
|
133
|
+
* day-keyed {@link NotificationLoggedEventDay} collection during cleanup.
|
|
134
|
+
*
|
|
135
|
+
* @param notification - the notification to check
|
|
136
|
+
* @returns true if the notification has the LOGGED_EVENT send type
|
|
137
|
+
*/
|
|
138
|
+
export declare function isLoggedEventNotification(notification: Pick<Notification, 'st'>): boolean;
|
|
129
139
|
/**
|
|
130
140
|
* Returns true if the notification should be archived to a {@link NotificationWeek} after delivery.
|
|
131
141
|
*
|
|
132
142
|
* Only notifications that can be sent to box recipients are archived (notifications restricted
|
|
133
|
-
* to only explicit or only global recipients are not saved to the weekly archive).
|
|
143
|
+
* to only explicit or only global recipients are not saved to the weekly archive). Logged-event
|
|
144
|
+
* notifications are archived to {@link NotificationLoggedEventDay} instead and never to the weekly archive.
|
|
134
145
|
*
|
|
135
146
|
* @param notification - the notification to check
|
|
136
147
|
* @returns true if the notification should be saved to the weekly archive after delivery
|
|
@@ -16,6 +16,15 @@ export interface UpdateOidcClientFieldParams {
|
|
|
16
16
|
readonly redirect_uris: OidcRedirectUri[];
|
|
17
17
|
readonly logo_uri?: Maybe<WebsiteUrlWithPrefix>;
|
|
18
18
|
readonly client_uri?: Maybe<WebsiteUrlWithPrefix>;
|
|
19
|
+
/**
|
|
20
|
+
* Optional per-client maximum login duration (seconds).
|
|
21
|
+
*
|
|
22
|
+
* When set, caps any value the client requests via the `dbx_session_ttl` auth-URL param.
|
|
23
|
+
* The effective ceiling for that client is `min(this, OidcModuleConfig.maxRequestedLoginDuration)`.
|
|
24
|
+
*
|
|
25
|
+
* Set to `null` to clear an existing value.
|
|
26
|
+
*/
|
|
27
|
+
readonly dbx_max_session_ttl?: Maybe<number>;
|
|
19
28
|
}
|
|
20
29
|
export declare const updateOidcClientFieldParamsType: Type<UpdateOidcClientFieldParams>;
|
|
21
30
|
export declare const createOidcClientFieldParamsType: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
@@ -23,6 +32,7 @@ export declare const createOidcClientFieldParamsType: import("arktype/internal/v
|
|
|
23
32
|
readonly redirect_uris: OidcRedirectUri[];
|
|
24
33
|
readonly logo_uri?: Maybe<string>;
|
|
25
34
|
readonly client_uri?: Maybe<string>;
|
|
35
|
+
readonly dbx_max_session_ttl?: Maybe<number>;
|
|
26
36
|
token_endpoint_auth_method: "client_secret_basic" | "client_secret_post" | "client_secret_jwt" | "private_key_jwt";
|
|
27
37
|
}, {}>;
|
|
28
38
|
/**
|
|
@@ -76,6 +86,17 @@ export type RotateOidcClientSecretResult = Pick<CreateOidcClientResult, 'client_
|
|
|
76
86
|
*/
|
|
77
87
|
export type DeleteOidcClientParams = TargetModelParams;
|
|
78
88
|
export declare const deleteOidcClientParamsType: import("arktype/internal/variants/object.ts").ObjectType<TargetModelParams, {}>;
|
|
89
|
+
/**
|
|
90
|
+
* Parameters for revoking a user's own OIDC token entry.
|
|
91
|
+
*
|
|
92
|
+
* The target {@link OidcEntry} must be of type `Grant` and have its `uid`
|
|
93
|
+
* matching the authenticated user. Revoking a grant cascades through
|
|
94
|
+
* oidc-provider's grantable models (`AccessToken`, `RefreshToken`,
|
|
95
|
+
* `AuthorizationCode`, `DeviceCode`, `BackchannelAuthenticationRequest`),
|
|
96
|
+
* deleting all entries that share the grant id.
|
|
97
|
+
*/
|
|
98
|
+
export type DeleteOidcTokenParams = TargetModelParams;
|
|
99
|
+
export declare const deleteOidcTokenParamsType: import("arktype/internal/variants/object.ts").ObjectType<TargetModelParams, {}>;
|
|
79
100
|
/**
|
|
80
101
|
* Custom (non-CRUD) function type map for OIDC.
|
|
81
102
|
*/
|
|
@@ -97,6 +118,7 @@ export type OidcModelCrudFunctionsConfig = {
|
|
|
97
118
|
};
|
|
98
119
|
delete: {
|
|
99
120
|
client: DeleteOidcClientParams;
|
|
121
|
+
token: DeleteOidcTokenParams;
|
|
100
122
|
};
|
|
101
123
|
};
|
|
102
124
|
};
|
|
@@ -117,6 +139,7 @@ export declare abstract class OidcModelFunctions implements ModelFirebaseFunctio
|
|
|
117
139
|
};
|
|
118
140
|
deleteOidcEntry: {
|
|
119
141
|
client: ModelFirebaseDeleteFunction<DeleteOidcClientParams>;
|
|
142
|
+
token: ModelFirebaseDeleteFunction<DeleteOidcTokenParams>;
|
|
120
143
|
};
|
|
121
144
|
};
|
|
122
145
|
}
|
|
@@ -84,6 +84,13 @@ export interface OidcEntry {
|
|
|
84
84
|
* @dbxModelVariable grantId
|
|
85
85
|
*/
|
|
86
86
|
grantId?: Maybe<string>;
|
|
87
|
+
/**
|
|
88
|
+
* OAuth client identifier. Extracted from the payload for indexed queries
|
|
89
|
+
* (e.g. listing or revoking every grant/token issued to a particular client).
|
|
90
|
+
*
|
|
91
|
+
* @dbxModelVariable clientId
|
|
92
|
+
*/
|
|
93
|
+
clientId?: Maybe<string>;
|
|
87
94
|
/**
|
|
88
95
|
* User code for device flow. Extracted from the payload for indexed queries.
|
|
89
96
|
*
|
|
@@ -96,6 +103,17 @@ export interface OidcEntry {
|
|
|
96
103
|
* @dbxModelVariable consumedAt
|
|
97
104
|
*/
|
|
98
105
|
consumed?: Maybe<number>;
|
|
106
|
+
/**
|
|
107
|
+
* When this entry was created. Derived from `payload.iat` on grantable
|
|
108
|
+
* tokens (AccessToken, RefreshToken, AuthorizationCode, Grant, etc.) and
|
|
109
|
+
* from `payload.created_at` on Client entries.
|
|
110
|
+
*
|
|
111
|
+
* Enables Firestore-level `orderBy` and date-range queries (e.g. "grants
|
|
112
|
+
* issued in the last 7 days") without parsing the payload.
|
|
113
|
+
*
|
|
114
|
+
* @dbxModelVariable createdAt
|
|
115
|
+
*/
|
|
116
|
+
createdAt?: Maybe<Date>;
|
|
99
117
|
/**
|
|
100
118
|
* When this entry expires.
|
|
101
119
|
*
|
|
@@ -14,4 +14,30 @@ export interface OidcEntryOAuthClientPayloadData {
|
|
|
14
14
|
readonly logo_uri?: Maybe<string>;
|
|
15
15
|
readonly client_uri?: Maybe<string>;
|
|
16
16
|
readonly created_at?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional per-client maximum login duration (seconds).
|
|
19
|
+
*
|
|
20
|
+
* Custom oidc-provider client metadata (registered via `extraClientMetadata`).
|
|
21
|
+
* Caps how long a client may request via the `dbx_session_ttl` auth-URL param.
|
|
22
|
+
*/
|
|
23
|
+
readonly dbx_max_session_ttl?: Maybe<number>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Subset of an oidc-provider Grant adapter payload that is safe to expose to the
|
|
27
|
+
* granting user when they manage their issued tokens.
|
|
28
|
+
*
|
|
29
|
+
* Mirrors the relevant fields of oidc-provider's `lib/models/grant.js` payload.
|
|
30
|
+
*/
|
|
31
|
+
export interface OidcEntryGrantPayloadData {
|
|
32
|
+
readonly accountId?: Maybe<string>;
|
|
33
|
+
readonly clientId?: Maybe<OidcEntryClientId>;
|
|
34
|
+
readonly exp?: Maybe<number>;
|
|
35
|
+
readonly iat?: Maybe<number>;
|
|
36
|
+
/**
|
|
37
|
+
* Space-delimited string of scopes that apply across all resources, e.g. `'openid email offline_access'`.
|
|
38
|
+
*/
|
|
39
|
+
readonly openid?: Maybe<{
|
|
40
|
+
readonly scope?: Maybe<string>;
|
|
41
|
+
readonly claims?: Maybe<string[]>;
|
|
42
|
+
}>;
|
|
17
43
|
}
|
|
@@ -31,6 +31,14 @@ export declare function oidcEntriesByUidQuery(type: OidcEntryType, uid: Firebase
|
|
|
31
31
|
* @returns Firestore query constraints for the given type and grantId
|
|
32
32
|
*/
|
|
33
33
|
export declare function oidcEntriesByGrantIdQuery(type: OidcEntryType, grantId: string): FirestoreQueryConstraint[];
|
|
34
|
+
/**
|
|
35
|
+
* Query for OidcEntry documents with a specific type and clientId.
|
|
36
|
+
*
|
|
37
|
+
* @param type - the OIDC entry type to filter by
|
|
38
|
+
* @param clientId - the OAuth client ID to match
|
|
39
|
+
* @returns Firestore query constraints for the given type and clientId
|
|
40
|
+
*/
|
|
41
|
+
export declare function oidcEntriesByClientIdQuery(type: OidcEntryType, clientId: string): FirestoreQueryConstraint[];
|
|
34
42
|
/**
|
|
35
43
|
* Query for OidcEntry Client documents owned by a specific user.
|
|
36
44
|
*
|
|
@@ -38,3 +46,13 @@ export declare function oidcEntriesByGrantIdQuery(type: OidcEntryType, grantId:
|
|
|
38
46
|
* @returns Firestore query constraints for Client entries matching the ownership key
|
|
39
47
|
*/
|
|
40
48
|
export declare function oidcClientEntriesByOwnerQuery(ownershipKey: FirebaseAuthOwnershipKey): FirestoreQueryConstraint[];
|
|
49
|
+
/**
|
|
50
|
+
* Query for OidcEntry Grant documents issued to a specific user.
|
|
51
|
+
*
|
|
52
|
+
* Used by the "apps with access to my account" UI to list every outstanding
|
|
53
|
+
* grant the signed-in user has authorized.
|
|
54
|
+
*
|
|
55
|
+
* @param uid - the Firebase user id the grants were issued to
|
|
56
|
+
* @returns Firestore query constraints for Grant entries matching the uid
|
|
57
|
+
*/
|
|
58
|
+
export declare function oidcGrantEntriesByUidQuery(uid: FirebaseAuthUserId): FirestoreQueryConstraint[];
|
|
@@ -188,6 +188,7 @@ export type CreateStorageFileDocumentPairFactory = <M extends StorageFileMetadat
|
|
|
188
188
|
* context: collections
|
|
189
189
|
* });
|
|
190
190
|
* ```
|
|
191
|
+
* @__NO_SIDE_EFFECTS__
|
|
191
192
|
*/
|
|
192
193
|
export declare function createStorageFileDocumentPairFactory(config?: CreateStorageFileDocumentPairFactoryConfig): CreateStorageFileDocumentPairFactory;
|
|
193
194
|
/**
|
|
@@ -82,6 +82,7 @@ export type StorageFileGroupCreateStorageFileKeyFactory<P extends StorageFileGro
|
|
|
82
82
|
*
|
|
83
83
|
* @param purpose The purpose of the StorageFileGroupCreatedStorageFileKey.
|
|
84
84
|
* @returns A factory function that takes a StorageFileGroupId and returns a StorageFileGroupCreatedStorageFileKey.
|
|
85
|
+
* @__NO_SIDE_EFFECTS__
|
|
85
86
|
*/
|
|
86
87
|
export declare function storageFileGroupCreateStorageFileKeyFactory<P extends StorageFileGroupRelatedStorageFilePurpose>(purpose: P): StorageFileGroupCreateStorageFileKeyFactory<P>;
|
|
87
88
|
/**
|
|
@@ -44,5 +44,6 @@ export type GrantStorageFileRolesForUserAuthFunction = (input: GrantStorageFileR
|
|
|
44
44
|
* rolesForStorageFileOwnershipKey: (key) => ({ read: true })
|
|
45
45
|
* });
|
|
46
46
|
* ```
|
|
47
|
+
* @__NO_SIDE_EFFECTS__
|
|
47
48
|
*/
|
|
48
49
|
export declare function grantStorageFileRolesForUserAuthFunction<T extends FirebaseModelContext>(config: GrantStorageFileRolesForUserAuthFunctionConfig<T>): GrantStorageFileRolesForUserAuthFunction;
|
|
@@ -36,6 +36,7 @@ export type UserUploadsFolderSlashPathFactory = FactoryWithRequiredInput<SlashPa
|
|
|
36
36
|
* const path = factory('user123');
|
|
37
37
|
* // path === '/uploads/u/user123'
|
|
38
38
|
* ```
|
|
39
|
+
* @__NO_SIDE_EFFECTS__
|
|
39
40
|
*/
|
|
40
41
|
export declare function userUploadsFolderSlashPathFactory(inputBasePath?: Maybe<string>): UserUploadsFolderSlashPathFactory;
|
|
41
42
|
/**
|
|
@@ -63,6 +64,7 @@ export interface UserUploadsFolderStoragePathFactoryConfig {
|
|
|
63
64
|
* const storagePath = factory('user123');
|
|
64
65
|
* // storagePath === { pathString: '/uploads/u/user123', bucketId: 'my-bucket' }
|
|
65
66
|
* ```
|
|
67
|
+
* @__NO_SIDE_EFFECTS__
|
|
66
68
|
*/
|
|
67
69
|
export declare function userUploadsFolderStoragePathFactory({ bucketId, basePath: inputBasePath }: UserUploadsFolderStoragePathFactoryConfig): UserUploadsFolderStoragePathFactory;
|
|
68
70
|
/**
|
|
@@ -276,6 +276,7 @@ export type DetermineUserByFolderDeterminerWrapperFunction = (determiner: Upload
|
|
|
276
276
|
* });
|
|
277
277
|
* const withUser = addUser(myDeterminer);
|
|
278
278
|
* ```
|
|
279
|
+
* @__NO_SIDE_EFFECTS__
|
|
279
280
|
*/
|
|
280
281
|
export declare function determineUserByFolderWrapperFunction(config: DetermineUserByFolderWrapperFunctionConfig): DetermineUserByFolderDeterminerWrapperFunction;
|
|
281
282
|
/**
|
|
@@ -289,6 +290,7 @@ export declare function determineUserByFolderWrapperFunction(config: DetermineUs
|
|
|
289
290
|
* const addUser = determineUserByUserUploadsFolderWrapperFunction();
|
|
290
291
|
* const withUser = addUser(myDeterminer);
|
|
291
292
|
* ```
|
|
293
|
+
* @__NO_SIDE_EFFECTS__
|
|
292
294
|
*/
|
|
293
295
|
export declare function determineUserByUserUploadsFolderWrapperFunction(config?: Omit<DetermineUserByFolderWrapperFunctionConfig, 'rootFolder' | 'userFolderPrefix'>): DetermineUserByFolderDeterminerWrapperFunction;
|
|
294
296
|
/**
|