@mshindi-labs/google 1.2.1 → 1.3.1

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 (76) hide show
  1. package/README.md +4 -2
  2. package/dist/calendar.cjs +118 -166
  3. package/dist/calendar.cjs.map +1 -1
  4. package/dist/calendar.d.cts +1 -1
  5. package/dist/calendar.d.ts +1 -1
  6. package/dist/calendar.js +49 -97
  7. package/dist/calendar.js.map +1 -1
  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-FCHXM22B.js → chunk-6VGR73PY.js} +45 -2
  13. package/dist/{chunk-FCHXM22B.js.map → chunk-6VGR73PY.js.map} +1 -1
  14. package/dist/{chunk-6RDWEYXZ.js → chunk-7YVRJ3GY.js} +5 -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-JA2JLBNN.js +119 -0
  21. package/dist/chunk-JA2JLBNN.js.map +1 -0
  22. package/dist/{chunk-DPAPYMB3.cjs → chunk-KFQ4O6MT.cjs} +57 -56
  23. package/dist/chunk-KFQ4O6MT.cjs.map +1 -0
  24. package/dist/chunk-LWCB3V7V.js +20 -0
  25. package/dist/chunk-LWCB3V7V.js.map +1 -0
  26. package/dist/{chunk-S357VL5V.cjs → chunk-MFVFONV7.cjs} +58 -17
  27. package/dist/chunk-MFVFONV7.cjs.map +1 -0
  28. package/dist/{chunk-6PMJ6VB6.cjs → chunk-RWRVNSQG.cjs} +6 -6
  29. package/dist/{chunk-6PMJ6VB6.cjs.map → chunk-RWRVNSQG.cjs.map} +1 -1
  30. package/dist/chunk-TXOTIP4G.js +97 -0
  31. package/dist/chunk-TXOTIP4G.js.map +1 -0
  32. package/dist/{chunk-SXD5K23S.js → chunk-UR3KSPDZ.js} +2 -2
  33. package/dist/{chunk-JZVDD4DL.cjs → chunk-UUXXCUIB.cjs} +45 -2
  34. package/dist/chunk-UUXXCUIB.cjs.map +1 -0
  35. package/dist/{chunk-JDA3ZRUY.cjs → chunk-V5Q6XSYZ.cjs} +3 -3
  36. package/dist/{chunk-JDA3ZRUY.cjs.map → chunk-V5Q6XSYZ.cjs.map} +1 -1
  37. package/dist/{chunk-4V5ZJNPI.js → chunk-ZPDFK5VR.js} +2 -2
  38. package/dist/core.cjs +28 -18
  39. package/dist/core.cjs.map +1 -1
  40. package/dist/core.d.cts +19 -2
  41. package/dist/core.d.ts +19 -2
  42. package/dist/core.js +14 -4
  43. package/dist/core.js.map +1 -1
  44. package/dist/{create-google-Bo8_Nc1C.d.cts → create-google-B0fX1ixG.d.cts} +1 -0
  45. package/dist/{create-google-snvkHaEk.d.ts → create-google-CjsKhktN.d.ts} +1 -0
  46. package/dist/gmail.cjs +47 -45
  47. package/dist/gmail.cjs.map +1 -1
  48. package/dist/gmail.d.cts +1 -1
  49. package/dist/gmail.d.ts +1 -1
  50. package/dist/gmail.js +13 -11
  51. package/dist/gmail.js.map +1 -1
  52. package/dist/postgres.cjs +8 -8
  53. package/dist/postgres.js +1 -1
  54. package/dist/sheets.cjs +1317 -0
  55. package/dist/sheets.cjs.map +1 -0
  56. package/dist/sheets.d.cts +292 -0
  57. package/dist/sheets.d.ts +292 -0
  58. package/dist/sheets.js +1317 -0
  59. package/dist/sheets.js.map +1 -0
  60. package/dist/testing.cjs +905 -38
  61. package/dist/testing.cjs.map +1 -1
  62. package/dist/testing.d.cts +133 -1
  63. package/dist/testing.d.ts +133 -1
  64. package/dist/testing.js +897 -30
  65. package/dist/testing.js.map +1 -1
  66. package/dist/transport-uuotQ13Y.d.cts +137 -0
  67. package/dist/transport-uuotQ13Y.d.ts +137 -0
  68. package/package.json +18 -1
  69. package/dist/chunk-6RDWEYXZ.js.map +0 -1
  70. package/dist/chunk-AMBBE4TW.js +0 -56
  71. package/dist/chunk-AMBBE4TW.js.map +0 -1
  72. package/dist/chunk-DPAPYMB3.cjs.map +0 -1
  73. package/dist/chunk-JZVDD4DL.cjs.map +0 -1
  74. package/dist/chunk-S357VL5V.cjs.map +0 -1
  75. /package/dist/{chunk-SXD5K23S.js.map → chunk-UR3KSPDZ.js.map} +0 -0
  76. /package/dist/{chunk-4V5ZJNPI.js.map → chunk-ZPDFK5VR.js.map} +0 -0
package/dist/testing.d.ts CHANGED
@@ -3,6 +3,7 @@ import { C as CredentialStore, O as OAuthClientRecord, a as ConnectionRecord, b
3
3
  import { O as OAuthGateway } from './key-provider-Cq_14Bh6.js';
4
4
  import { G as GmailTransport } from './transport-CVOgr9XP.js';
5
5
  import { C as CalendarTransport, G as GEvent, a as GoogleSendUpdates } from './transport-DHApc5oq.js';
6
+ import { S as SheetsTransport, a as GRequest, b as GSpreadsheet, R as RenderOption, G as GValueRange, I as InputOption, d as GResponse } from './transport-uuotQ13Y.js';
6
7
 
7
8
  /** Dev/test key provider (kid `static:local`). Refuses NODE_ENV=production. */
8
9
  declare class LocalKeyProvider extends StaticKeyProvider {
@@ -233,4 +234,135 @@ declare class FakeCalendar implements CalendarTransport {
233
234
  private addEntryPoint;
234
235
  }
235
236
 
236
- export { CaptureTransport, type CapturedMessage, type ContractTestApi, FakeCalendar, type FakeCall, FakeGoogleOAuth, type FakeNotification, InMemoryStore, LocalKeyProvider, runStoreContractTests };
237
+ type Target = {
238
+ accessToken: string;
239
+ spreadsheetId: string;
240
+ };
241
+ type FakeSheetsTab = {
242
+ title: string;
243
+ sheetId?: number;
244
+ rows?: (string | number | boolean)[][];
245
+ };
246
+ type FakeSheetsCall = {
247
+ op: keyof SheetsTransport;
248
+ ranges?: string[];
249
+ valueInputOption?: string;
250
+ requests?: number;
251
+ /** The field mask of a `getSpreadsheet` call. */
252
+ fields?: string;
253
+ };
254
+ /** A gaxios-shaped HTTP error, as the googleapis client throws it. */
255
+ declare function sheetsHttpError(status: number, reason: string, message: string): Error;
256
+ /**
257
+ * In-memory Google Sheets transport for tests: one spreadsheet with tabs, cell
258
+ * values and formulas, named and protected ranges. Every operation runs on a
259
+ * copy of the state that is committed only if it succeeds, so a failing
260
+ * `batchUpdate` applies nothing.
261
+ *
262
+ * Simplifications to know about:
263
+ * - `valuesAppend` table detection is "after the last row with any stored cell"
264
+ * (from the range's start column), not Google's full table heuristics.
265
+ * - USER_ENTERED parses only `'`-literals, `=`/`+`/`-` formulas, plain numbers,
266
+ * percents, TRUE/FALSE and `M/D[/Y]` dates (year-less → {@link FIXED_YEAR}).
267
+ * ISO dates, `1,000`, `$5`, `1e5`, times and padded text stay text. Formulas
268
+ * are not evaluated: they read as `""` except under `FORMULA`.
269
+ * - Requests that would change values but are recorded only (cells untouched):
270
+ * copyPaste, cutPaste, moveDimension, insertRange/deleteRange, updateCells,
271
+ * appendCells, appendDimension, autoFill, findReplace, sortRange and the rest
272
+ * outside the structural set.
273
+ */
274
+ declare class FakeSheets implements SheetsTransport {
275
+ readonly calls: FakeSheetsCall[];
276
+ /** Every request of each committed `batchUpdate`, in order. */
277
+ readonly appliedRequests: GRequest[];
278
+ private readonly spreadsheetId;
279
+ private readonly title;
280
+ private state;
281
+ private readonly failures;
282
+ constructor(opts?: {
283
+ spreadsheetId?: string;
284
+ title?: string;
285
+ tabs?: FakeSheetsTab[];
286
+ });
287
+ tab(title: string): {
288
+ sheetId: number;
289
+ hidden: boolean;
290
+ frozenRows: number;
291
+ frozenColumns: number;
292
+ index: number;
293
+ } | undefined;
294
+ /** The tab's values (formulas read as `""`), trailing empty cells and rows trimmed. */
295
+ values(title: string): (string | number | boolean)[][];
296
+ /** The formula stored at `cell` (e.g. `"C2"`), or null if the cell holds none. */
297
+ formulaAt(title: string, cell: string): string | null;
298
+ failNext(op: keyof SheetsTransport, error: unknown, opts?: {
299
+ afterApply?: boolean;
300
+ }): void;
301
+ getSpreadsheet(p: Target & {
302
+ fields: string;
303
+ }): Promise<GSpreadsheet>;
304
+ valuesGet(p: Target & {
305
+ range: string;
306
+ valueRenderOption: RenderOption;
307
+ }): Promise<GValueRange>;
308
+ valuesBatchGet(p: Target & {
309
+ ranges: string[];
310
+ valueRenderOption: RenderOption;
311
+ }): Promise<{
312
+ valueRanges?: GValueRange[] | null;
313
+ }>;
314
+ valuesUpdate(p: Target & {
315
+ range: string;
316
+ values: unknown[][];
317
+ valueInputOption: InputOption;
318
+ }): Promise<{
319
+ updatedRange?: string | null;
320
+ updatedCells?: number | null;
321
+ }>;
322
+ valuesBatchUpdate(p: Target & {
323
+ data: {
324
+ range: string;
325
+ values: unknown[][];
326
+ }[];
327
+ valueInputOption: InputOption;
328
+ }): Promise<{
329
+ totalUpdatedCells?: number | null;
330
+ }>;
331
+ valuesAppend(p: Target & {
332
+ range: string;
333
+ values: unknown[][];
334
+ valueInputOption: InputOption;
335
+ insertDataOption: "INSERT_ROWS" | "OVERWRITE";
336
+ }): Promise<{
337
+ updates?: {
338
+ updatedRange?: string | null;
339
+ } | null;
340
+ }>;
341
+ valuesBatchClear(p: Target & {
342
+ ranges: string[];
343
+ }): Promise<void>;
344
+ batchUpdate(p: Target & {
345
+ requests: GRequest[];
346
+ }): Promise<{
347
+ replies?: GResponse[] | null;
348
+ }>;
349
+ /** Injected failure, 404 check, then `fn` on a draft that is committed on success. */
350
+ private run;
351
+ private mustTab;
352
+ /**
353
+ * Resolves an A1 ref to its tab and bounds (null bounds = whole tab), as Google
354
+ * does: `'quoted'` or unquoted title (no `'` in it) before `!`; a bare quoted
355
+ * title is the whole tab; a bare ref that parses as A1 addresses the first
356
+ * visible tab; any other bare text is a whole-tab title.
357
+ */
358
+ private resolve;
359
+ private read;
360
+ private write;
361
+ private writeAt;
362
+ private sheetProps;
363
+ private full;
364
+ private apply;
365
+ private checkSheetIds;
366
+ }
367
+
368
+ export { CaptureTransport, type CapturedMessage, type ContractTestApi, FakeCalendar, type FakeCall, FakeGoogleOAuth, type FakeNotification, FakeSheets, type FakeSheetsCall, type FakeSheetsTab, InMemoryStore, LocalKeyProvider, runStoreContractTests, sheetsHttpError };