@mshindi-labs/google 1.1.0 → 1.3.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.
Files changed (80) hide show
  1. package/README.md +9 -4
  2. package/dist/calendar.cjs +1593 -0
  3. package/dist/calendar.cjs.map +1 -0
  4. package/dist/calendar.d.cts +161 -0
  5. package/dist/calendar.d.ts +161 -0
  6. package/dist/calendar.js +1593 -0
  7. package/dist/calendar.js.map +1 -0
  8. package/dist/chunk-2MJE3WQ5.js +63 -0
  9. package/dist/chunk-2MJE3WQ5.js.map +1 -0
  10. package/dist/chunk-4UEM6VO4.cjs +119 -0
  11. package/dist/chunk-4UEM6VO4.cjs.map +1 -0
  12. package/dist/{chunk-RWT25QHA.js → chunk-6VGR73PY.js} +87 -2
  13. package/dist/chunk-6VGR73PY.js.map +1 -0
  14. package/dist/{chunk-SIDO26T7.js → chunk-7YVRJ3GY.js} +12 -4
  15. package/dist/chunk-7YVRJ3GY.js.map +1 -0
  16. package/dist/chunk-7ZLAL7UY.cjs +63 -0
  17. package/dist/chunk-7ZLAL7UY.cjs.map +1 -0
  18. package/dist/chunk-BYHOVCN3.cjs +20 -0
  19. package/dist/chunk-BYHOVCN3.cjs.map +1 -0
  20. package/dist/chunk-FPEP5FL5.js +87 -0
  21. package/dist/chunk-FPEP5FL5.js.map +1 -0
  22. package/dist/chunk-JA2JLBNN.js +119 -0
  23. package/dist/chunk-JA2JLBNN.js.map +1 -0
  24. package/dist/{chunk-VN5VWVCT.cjs → chunk-KFQ4O6MT.cjs} +64 -56
  25. package/dist/chunk-KFQ4O6MT.cjs.map +1 -0
  26. package/dist/chunk-LWCB3V7V.js +20 -0
  27. package/dist/chunk-LWCB3V7V.js.map +1 -0
  28. package/dist/{chunk-KJPQ3DMR.cjs → chunk-RWRVNSQG.cjs} +6 -6
  29. package/dist/{chunk-KJPQ3DMR.cjs.map → chunk-RWRVNSQG.cjs.map} +1 -1
  30. package/dist/{chunk-Z7O6GO3C.js → chunk-UR3KSPDZ.js} +2 -2
  31. package/dist/{chunk-SHDP4A3A.cjs → chunk-UUXXCUIB.cjs} +87 -2
  32. package/dist/chunk-UUXXCUIB.cjs.map +1 -0
  33. package/dist/{chunk-V22QP2AM.cjs → chunk-V5Q6XSYZ.cjs} +3 -3
  34. package/dist/{chunk-V22QP2AM.cjs.map → chunk-V5Q6XSYZ.cjs.map} +1 -1
  35. package/dist/chunk-X7QL7AQ6.cjs +87 -0
  36. package/dist/chunk-X7QL7AQ6.cjs.map +1 -0
  37. package/dist/{chunk-JVP7HHFU.js → chunk-ZPDFK5VR.js} +2 -2
  38. package/dist/core.cjs +40 -18
  39. package/dist/core.cjs.map +1 -1
  40. package/dist/core.d.cts +40 -4
  41. package/dist/core.d.ts +40 -4
  42. package/dist/core.js +26 -4
  43. package/dist/core.js.map +1 -1
  44. package/dist/{create-google-CPGcK-3G.d.cts → create-google-B0fX1ixG.d.cts} +3 -1
  45. package/dist/{create-google-nP9f9jd9.d.ts → create-google-CjsKhktN.d.ts} +3 -1
  46. package/dist/{events-BsWOMtza.d.ts → events-BlC10ISp.d.cts} +31 -0
  47. package/dist/{events-BsWOMtza.d.cts → events-BlC10ISp.d.ts} +31 -0
  48. package/dist/gmail.cjs +54 -79
  49. package/dist/gmail.cjs.map +1 -1
  50. package/dist/gmail.d.cts +2 -2
  51. package/dist/gmail.d.ts +2 -2
  52. package/dist/gmail.js +19 -44
  53. package/dist/gmail.js.map +1 -1
  54. package/dist/postgres.cjs +8 -8
  55. package/dist/postgres.d.cts +1 -1
  56. package/dist/postgres.d.ts +1 -1
  57. package/dist/postgres.js +1 -1
  58. package/dist/sheets.cjs +1317 -0
  59. package/dist/sheets.cjs.map +1 -0
  60. package/dist/sheets.d.cts +292 -0
  61. package/dist/sheets.d.ts +292 -0
  62. package/dist/sheets.js +1317 -0
  63. package/dist/sheets.js.map +1 -0
  64. package/dist/testing.cjs +1119 -39
  65. package/dist/testing.cjs.map +1 -1
  66. package/dist/testing.d.cts +223 -2
  67. package/dist/testing.d.ts +223 -2
  68. package/dist/testing.js +1110 -30
  69. package/dist/testing.js.map +1 -1
  70. package/dist/transport-DHApc5oq.d.cts +103 -0
  71. package/dist/transport-DHApc5oq.d.ts +103 -0
  72. package/dist/transport-uuotQ13Y.d.cts +137 -0
  73. package/dist/transport-uuotQ13Y.d.ts +137 -0
  74. package/package.json +35 -4
  75. package/dist/chunk-RWT25QHA.js.map +0 -1
  76. package/dist/chunk-SHDP4A3A.cjs.map +0 -1
  77. package/dist/chunk-SIDO26T7.js.map +0 -1
  78. package/dist/chunk-VN5VWVCT.cjs.map +0 -1
  79. /package/dist/{chunk-Z7O6GO3C.js.map → chunk-UR3KSPDZ.js.map} +0 -0
  80. /package/dist/{chunk-JVP7HHFU.js.map → chunk-ZPDFK5VR.js.map} +0 -0
package/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # @mshindi-labs/google
2
2
 
3
3
  Multi-tenant Google API utilities for TypeScript. Each tenant brings its own Google
4
- OAuth client; tokens are envelope-encrypted at rest; v1 sends email through Gmail.
4
+ OAuth client; tokens are envelope-encrypted at rest; it sends email through Gmail and books
5
+ interviews on Google Calendar.
5
6
 
6
7
  ```sh
7
8
  npm i @mshindi-labs/google @googleapis/gmail nodemailer html-to-text
9
+ npm i @mshindi-labs/google @googleapis/sheets@^14 # Sheets, on Node 18 / 20
8
10
  ```
9
11
 
10
12
  ## Quick start
@@ -53,8 +55,8 @@ await gmail.send({
53
55
  });
54
56
  ```
55
57
 
56
- Entry points: `/core`, `/gmail`, `/postgres`, `/testing` (there is no root import).
57
- Optional peers (`@googleapis/gmail`, `nodemailer`, `html-to-text`, KMS clients) are
58
+ Entry points: `/core`, `/gmail`, `/calendar`, `/sheets`, `/postgres`, `/testing` (there is no root import).
59
+ Optional peers (`@googleapis/gmail`, `@googleapis/calendar`, `@googleapis/sheets`, `nodemailer`, `html-to-text`, KMS clients) are
58
60
  loaded on first use; a missing one throws `MissingPeerDependencyError` with the
59
61
  `npm i` command to run.
60
62
 
@@ -67,6 +69,8 @@ own error classes and `instanceof` can be false for a genuine library error.
67
69
 
68
70
  - [Tenant setup](docs/guides/tenant-setup.md): for a tenant admin creating the Google OAuth client.
69
71
  - [Host integration](docs/guides/host-integration.md): wiring, routes, error messages, key providers.
72
+ - [Calendar scheduling](docs/guides/calendar-scheduling.md): idempotent interview booking, reschedule, cancel, free/busy.
73
+ - [Google Sheets](docs/guides/sheets.md): read rows as objects, append without duplicates, atomic batch formatting.
70
74
  - [Bulk sending](docs/guides/bulk-sending.md): a queue pattern that never double-sends.
71
75
  - [Prisma and TypeORM](docs/guides/orm-integration.md): plugging an ORM into the Postgres store.
72
76
  - [Postgres row-level security](docs/guides/postgres-rls.md): optional database-enforced tenant isolation.
@@ -82,7 +86,8 @@ own error classes and `instanceof` can be false for a genuine library error.
82
86
  - **Hardened OAuth.** Single-use hashed `state` bound to tenant and actor, PKCE S256, a
83
87
  fixed HTTPS redirect URI, and ID token checks (audience, verified email, hosted
84
88
  domain, intended account).
85
- - **Least privilege.** Only `openid email` and `gmail.send`. Tokens are revoked at
89
+ - **Least privilege.** Only `openid email`, `gmail.send` and, for Calendar, `calendar.events.owned` and
90
+ `calendar.events.freebusy`. Tokens are revoked at
86
91
  Google on a wrong-account or partial-scope consent, and when a tenant disconnects.
87
92
  - **No secrets in output.** Errors, events and logs are redacted; events never carry
88
93
  bodies, tokens or secrets, and recipients can be hashed (`redactRecipients`).