@dereekb/firebase-server 13.32.0 → 13.34.0
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/calcom/index.cjs.default.js +1 -0
- package/calcom/index.cjs.js +1451 -0
- package/calcom/index.cjs.mjs +2 -0
- package/calcom/index.d.ts +1 -0
- package/calcom/index.esm.js +1437 -0
- package/calcom/package.json +29 -0
- package/calcom/src/index.d.ts +1 -0
- package/calcom/src/lib/calcom.oauth.connection.cache.d.ts +49 -0
- package/calcom/src/lib/calcom.oauth.connection.config.d.ts +75 -0
- package/calcom/src/lib/calcom.oauth.connection.context.d.ts +84 -0
- package/calcom/src/lib/calcom.oauth.connection.controller.d.ts +18 -0
- package/calcom/src/lib/calcom.oauth.connection.module.d.ts +55 -0
- package/calcom/src/lib/calcom.oauth.connection.service.d.ts +33 -0
- package/calcom/src/lib/index.d.ts +6 -0
- package/discord/index.cjs.default.js +1 -0
- package/discord/index.cjs.js +761 -0
- package/discord/index.cjs.mjs +2 -0
- package/discord/index.d.ts +1 -0
- package/discord/index.esm.js +753 -0
- package/discord/package.json +29 -0
- package/discord/src/index.d.ts +1 -0
- package/discord/src/lib/discord.oauth.connection.config.d.ts +69 -0
- package/discord/src/lib/discord.oauth.connection.controller.d.ts +18 -0
- package/discord/src/lib/discord.oauth.connection.module.d.ts +39 -0
- package/discord/src/lib/discord.oauth.connection.service.d.ts +43 -0
- package/discord/src/lib/index.d.ts +4 -0
- package/index.cjs.js +42 -9
- package/index.esm.js +42 -9
- package/mailgun/package.json +9 -9
- package/mcp/package.json +11 -11
- package/model/index.cjs.js +4243 -855
- package/model/index.esm.js +4183 -862
- package/model/package.json +10 -9
- package/model/src/lib/index.d.ts +2 -0
- package/model/src/lib/system/index.d.ts +2 -0
- package/model/src/lib/system/system.private.d.ts +63 -0
- package/model/src/lib/system/system.private.module.d.ts +70 -0
- package/model/src/lib/userexternalconnection/index.d.ts +8 -0
- package/model/src/lib/userexternalconnection/oauth/index.d.ts +7 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.config.d.ts +110 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.controller.d.ts +68 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.error.d.ts +29 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.refresh.d.ts +24 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.registry.d.ts +54 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.service.d.ts +216 -0
- package/model/src/lib/userexternalconnection/oauth/userexternalconnection.oauth.state.d.ts +114 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.accessor.service.d.ts +111 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.action.server.d.ts +172 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.error.d.ts +44 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.module.d.ts +129 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.private.d.ts +192 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.reader.service.d.ts +157 -0
- package/model/src/lib/userexternalconnection/userexternalconnection.refresh.service.d.ts +46 -0
- package/oidc/index.cjs.js +104 -78
- package/oidc/index.esm.js +104 -78
- package/oidc/package.json +10 -10
- package/package.json +24 -10
- package/src/lib/env/env.config.d.ts +15 -0
- package/src/lib/env/env.service.d.ts +7 -0
- package/src/lib/firestore/snapshot/snapshot.field.encrypt.d.ts +21 -2
- package/src/lib/nest/env/env.service.d.ts +1 -0
- package/test/index.cjs.js +14 -2
- package/test/index.esm.js +15 -3
- package/test/package.json +11 -11
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +1 -1
- package/twilio/package.json +8 -8
- package/zoho/README.md +38 -0
- package/zoho/index.cjs.js +1418 -64
- package/zoho/index.esm.js +1401 -67
- package/zoho/package.json +13 -9
- package/zoho/src/lib/index.d.ts +6 -0
- package/zoho/src/lib/zoho.accounts.firebase.d.ts +10 -3
- package/zoho/src/lib/zoho.accounts.firebase.module.d.ts +51 -0
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +51 -8
- package/zoho/src/lib/zoho.oauth.connection.cache.d.ts +45 -0
- package/zoho/src/lib/zoho.oauth.connection.config.d.ts +80 -0
- package/zoho/src/lib/zoho.oauth.connection.controller.d.ts +18 -0
- package/zoho/src/lib/zoho.oauth.connection.module.d.ts +43 -0
- package/zoho/src/lib/zoho.oauth.connection.service.d.ts +107 -0
package/zoho/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @dereekb/firebase-server/zoho
|
|
2
|
+
|
|
3
|
+
Firebase-server integrations for Zoho. Provides `firebaseZohoAccountsAccessTokenCacheService`, a
|
|
4
|
+
`SystemState`-backed cache for the server-to-server Zoho access token, and the Zoho provider adapter
|
|
5
|
+
for the generic `UserExternalConnection` OAuth framework — a controller, service, and module that
|
|
6
|
+
mount a per-user Zoho connect flow at `/oauth/zoho`. The two are independent: the cache holds one
|
|
7
|
+
token for the whole app, while the connect flow stores per-user credentials on the private
|
|
8
|
+
connection document.
|
|
9
|
+
|
|
10
|
+
## Access token cache: server-only, encrypted at rest
|
|
11
|
+
|
|
12
|
+
The cached access token is a credential, so back the cache with a **server-only** collection —
|
|
13
|
+
`systemStatePrivateFirestoreCollection()` from `@dereekb/firebase-server/model`, which stores at
|
|
14
|
+
`/sysp` and has no `firestore.rules` match block:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
const collections = systemStatePrivateFirestoreCollection({
|
|
18
|
+
firestoreContext,
|
|
19
|
+
converters: {
|
|
20
|
+
...zohoAccessTokenSystemStatePrivateConverterEntry({ encryptionSecret })
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const cacheService = firebaseZohoAccountsAccessTokenCacheService(collections);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Supply `encryptionSecret` from `ZOHO_ACCESS_TOKEN_ENCRYPTION_SECRET` (see
|
|
28
|
+
`zohoAccessTokenEncryptionSecretFactory`). Only the `accessToken` string is encrypted — `expiresAt`
|
|
29
|
+
and the other metadata stay plaintext so expired entries can be filtered without decrypting.
|
|
30
|
+
|
|
31
|
+
**Do not** register `zohoAccessTokenSystemStateDataConverter` (now deprecated) in an app's
|
|
32
|
+
client-shared `SystemStateStoredDataConverterMap`. That converter stores the token in plaintext, and
|
|
33
|
+
importing it from client-shared code drags `@dereekb/firebase-server` — and therefore
|
|
34
|
+
`firebase-admin`, `@nestjs/*` and Node builtins — into the browser bundle, which is a hard
|
|
35
|
+
resolution error rather than something a bundler can tree-shake away.
|
|
36
|
+
|
|
37
|
+
Rotating `ZOHO_ACCESS_TOKEN_ENCRYPTION_SECRET` is survivable: entries written under the old key
|
|
38
|
+
degrade to a cache miss and the next Zoho call re-mints a token.
|