@dbx-tools/google-rs 0.6.188

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.
@@ -0,0 +1,554 @@
1
+ // GENERATED by UniFFI binding generation - DO NOT EDIT.
2
+ // Regenerated from the dbx-tools-google Rust exports.
3
+ // Hand edits are overwritten on the next watch; this file is read-only.
4
+
5
+ /* eslint-disable */
6
+ // @ts-nocheck
7
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
8
+ // Trust me, you don't want to mess with it!
9
+ import nativeModule from "./_bindings-ffi.ts";
10
+ import { type UniffiRustFutureContinuationCallback, type UniffiForeignFutureDroppedCallback, type UniffiForeignFutureDroppedCallbackStruct,
11
+ } from "./_bindings-ffi.ts";
12
+ import { type AccessToken, type AuthOptions, AuthError,
13
+ } from "@dbx-tools/core-rs";
14
+ import { type FfiConverter, type UniffiByteArray, type UniffiGcObject, type UniffiHandle, type UniffiObjectFactory, AbstractFfiConverterByteArray, Cursor, FfiConverterObject, FfiConverterOptional, FfiConverterUInt64, RustBuffer, UniffiAbstractObject, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTypeNameSymbol,
15
+ } from "@ubjs/core";
16
+ import { uniffiModule as uniffiDbxToolsCoreModule } from "@dbx-tools/core-rs";
17
+ const { FfiConverterTypeAccessToken, FfiConverterTypeAuthError, FfiConverterTypeAuthOptions } = uniffiDbxToolsCoreModule.converters;
18
+ const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
19
+
20
+ const uniffiIsDebug =
21
+ // @ts-ignore -- The process global might not be defined
22
+ typeof process !== "object" ||
23
+ // @ts-ignore -- The process global might not be defined
24
+ process?.env?.NODE_ENV !== "production" ||
25
+ false;
26
+
27
+ // Public interface members begin here.
28
+
29
+ /**
30
+ * Load Google ADC from its standard source without invoking gcloud.
31
+ */
32
+ export async function createGoogleAuth(options: GoogleAuthOptions, asyncOpts_?: { signal: AbortSignal }): Promise<GoogleAuthLike> /*throws*/ {
33
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
34
+ try {
35
+ return await uniffiRustCallAsync(
36
+ /*rustCaller:*/ uniffiCaller,
37
+ /*rustFutureFunc:*/ () => {
38
+ return nativeModule().uniffi_dbx_tools_google_fn_func_create_google_auth(FfiConverterTypeGoogleAuthOptions.lower(options, nativeModule().rustbuffer_alloc)
39
+ );
40
+ },
41
+ /*pollFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_poll_u64,
42
+ /*cancelFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_cancel_u64,
43
+ /*completeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_complete_u64,
44
+ /*freeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_free_u64,
45
+ // Async returns always go through the JS-side converter: the
46
+ // FFI symbol returns the future handle (u64), and the user-level
47
+ // RustBuffer comes back via the shared `rust_future_complete_*`
48
+ // export. The bytes the runtime hands back must be deserialized
49
+ // here using the per-callable return-type converter.
50
+ /*liftFunc:*/ FfiConverterTypeGoogleAuth.lift.bind(FfiConverterTypeGoogleAuth),
51
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
52
+ /*asyncOpts:*/ asyncOpts_,
53
+ /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
54
+ );
55
+ } catch (__error: any) {
56
+ if (uniffiIsDebug && __error instanceof Error) {
57
+ __error.stack = __stack;
58
+ }
59
+ throw __error;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Options for Google Application Default Credentials.
65
+ */
66
+ export type GoogleAuthOptions = {
67
+ /**
68
+ * Shared token lifetime and lock configuration.
69
+ */
70
+ auth?: AuthOptions,
71
+ /**
72
+ * Conservative lifetime used when the ADC provider omits token expiry.
73
+ */
74
+ accessTokenTtlSeconds: bigint
75
+ }
76
+
77
+ /**
78
+ * Generated factory for {@link GoogleAuthOptions} record objects.
79
+ */
80
+ export const GoogleAuthOptions = (() => {
81
+ const defaults = () => ({
82
+ auth: undefined,
83
+ accessTokenTtlSeconds: BigInt("3600")
84
+ });
85
+ const create = (() => {
86
+ return uniffiCreateRecord<GoogleAuthOptions, ReturnType<typeof defaults>>(defaults);
87
+ })();
88
+ return Object.freeze({
89
+ create,
90
+ new: create,
91
+ defaults: () => Object.freeze(defaults()) as Partial<GoogleAuthOptions>,
92
+ });
93
+ })();
94
+
95
+ const FfiConverterTypeGoogleAuthOptions = (() => {
96
+ type TypeName = GoogleAuthOptions;
97
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
98
+ readFromCursor(c: Cursor): TypeName {
99
+ return {
100
+ auth: FfiConverterOptionalTypeAuthOptions.readFromCursor(c),
101
+ accessTokenTtlSeconds: FfiConverterUInt64.readFromCursor(c)
102
+ };
103
+ }
104
+ writeIntoCursor(value: TypeName, c: Cursor): void {
105
+ FfiConverterOptionalTypeAuthOptions.writeIntoCursor(value.auth, c);
106
+ FfiConverterUInt64.writeIntoCursor(value.accessTokenTtlSeconds, c);
107
+ }
108
+ allocationSize(value: TypeName): number {
109
+ return FfiConverterOptionalTypeAuthOptions.allocationSize(value.auth) +
110
+ FfiConverterUInt64.allocationSize(value.accessTokenTtlSeconds);
111
+
112
+ }
113
+ };
114
+ return new FFIConverter();
115
+ })();
116
+
117
+ const stringConverter = (() => {
118
+ const encoder = new TextEncoder();
119
+ const decoder = new TextDecoder();
120
+ return {
121
+ stringToBytes: (s: string) => encoder.encode(s),
122
+ bytesToString: (ab: UniffiByteArray) => decoder.decode(ab),
123
+ stringByteLength: (s: string) => encoder.encode(s).byteLength,
124
+ writeStringIntoBuffer: (s: string, buf: any, offset: number): number => {
125
+ const view = new Uint8Array(
126
+ buf.arrayBuffer,
127
+ offset,
128
+ buf.arrayBuffer.byteLength - offset,
129
+ );
130
+ return encoder.encodeInto(s, view).written;
131
+ },
132
+ readStringFromBuffer: (buf: any, offset: number, length: number): string =>
133
+ decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length)),
134
+ };
135
+ })();
136
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
137
+
138
+ /**
139
+ * Active Google ADC source and access-token cache information.
140
+ */
141
+ export type GoogleAuthStatus = {
142
+ /**
143
+ * ADC file selected through `GOOGLE_APPLICATION_CREDENTIALS` or gcloud's well-known path.
144
+ */
145
+ credentialsPath?: string,
146
+ /**
147
+ * Short-lived access tokens are retained only in process memory.
148
+ */
149
+ storage: string
150
+ }
151
+
152
+ /**
153
+ * Generated factory for {@link GoogleAuthStatus} record objects.
154
+ */
155
+ export const GoogleAuthStatus = (() => {
156
+ const defaults = () => ({
157
+ });
158
+ const create = (() => {
159
+ return uniffiCreateRecord<GoogleAuthStatus, ReturnType<typeof defaults>>(defaults);
160
+ })();
161
+ return Object.freeze({
162
+ create,
163
+ new: create,
164
+ defaults: () => Object.freeze(defaults()) as Partial<GoogleAuthStatus>,
165
+ });
166
+ })();
167
+
168
+ const FfiConverterTypeGoogleAuthStatus = (() => {
169
+ type TypeName = GoogleAuthStatus;
170
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
171
+ readFromCursor(c: Cursor): TypeName {
172
+ return {
173
+ credentialsPath: FfiConverterOptionalString.readFromCursor(c),
174
+ storage: FfiConverterString.readFromCursor(c)
175
+ };
176
+ }
177
+ writeIntoCursor(value: TypeName, c: Cursor): void {
178
+ FfiConverterOptionalString.writeIntoCursor(value.credentialsPath, c);
179
+ FfiConverterString.writeIntoCursor(value.storage, c);
180
+ }
181
+ allocationSize(value: TypeName): number {
182
+ return FfiConverterOptionalString.allocationSize(value.credentialsPath) +
183
+ FfiConverterString.allocationSize(value.storage);
184
+
185
+ }
186
+ };
187
+ return new FFIConverter();
188
+ })();
189
+
190
+ /**
191
+ * Google ADC binding facade over the shared in-process token lifecycle.
192
+ */
193
+ export interface GoogleAuthLike {
194
+
195
+ /**
196
+ * Refresh ADC even when the current token is outside its refresh window.
197
+ */
198
+ forceRefreshToken(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
199
+ /**
200
+ * Clear the in-process access-token cache without modifying ADC.
201
+ */
202
+ logout(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
203
+ /**
204
+ * Reuse a concurrent replacement or refresh the rejected access token.
205
+ */
206
+ refreshRejectedToken(staleAccessToken: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
207
+ /**
208
+ * Return the selected ADC path and short-lived token storage mode.
209
+ */
210
+ status(): GoogleAuthStatus;
211
+ /**
212
+ * Return a cached token or refresh it from ADC.
213
+ */
214
+ token(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
215
+ }
216
+ /**
217
+ * @deprecated Use `GoogleAuthLike` instead.
218
+ */
219
+ export type GoogleAuthInterface = GoogleAuthLike;
220
+
221
+
222
+ /**
223
+ * Google ADC binding facade over the shared in-process token lifecycle.
224
+ */
225
+ export class GoogleAuth extends UniffiAbstractObject implements GoogleAuthLike {
226
+
227
+ readonly [uniffiTypeNameSymbol] = "GoogleAuth";
228
+ readonly [destructorGuardSymbol]: UniffiGcObject;
229
+ readonly [pointerLiteralSymbol]: UniffiHandle;
230
+ // No primary constructor declared for this class.
231
+ private constructor(pointer: UniffiHandle) {
232
+ super();
233
+ this[pointerLiteralSymbol] = pointer;
234
+ this[destructorGuardSymbol] = uniffiTypeGoogleAuthObjectFactory.bless(pointer);
235
+ }
236
+
237
+
238
+
239
+
240
+ /**
241
+ * Refresh ADC even when the current token is outside its refresh window.
242
+ */
243
+ async forceRefreshToken(asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
244
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
245
+ try {
246
+ return await uniffiRustCallAsync(
247
+ /*rustCaller:*/ uniffiCaller,
248
+ /*rustFutureFunc:*/ () => {
249
+ return nativeModule().uniffi_dbx_tools_google_fn_method_googleauth_force_refresh_token(
250
+ uniffiTypeGoogleAuthObjectFactory.clonePointer(this)
251
+ );
252
+ },
253
+ /*pollFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_poll_rust_buffer,
254
+ /*cancelFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_cancel_rust_buffer,
255
+ /*completeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_complete_rust_buffer,
256
+ /*freeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_free_rust_buffer,
257
+ // Async returns always go through the JS-side converter: the
258
+ // FFI symbol returns the future handle (u64), and the user-level
259
+ // RustBuffer comes back via the shared `rust_future_complete_*`
260
+ // export. The bytes the runtime hands back must be deserialized
261
+ // here using the per-callable return-type converter.
262
+ // Borrowed view over foreign memory: the call site owns the free,
263
+ // as on the sync paths. Unconditional — a no-op where buffers are
264
+ // already JS-owned.
265
+ /*liftFunc:*/ (__rb) => {
266
+ try {
267
+ return FfiConverterTypeAccessToken.lift(__rb);
268
+ } finally {
269
+ nativeModule().rustbuffer_free(__rb);
270
+ }
271
+ },
272
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
273
+ /*asyncOpts:*/ asyncOpts_,
274
+ /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
275
+ );
276
+ } catch (__error: any) {
277
+ if (uniffiIsDebug && __error instanceof Error) {
278
+ __error.stack = __stack;
279
+ }
280
+ throw __error;
281
+ }
282
+ }
283
+
284
+ /**
285
+ * Clear the in-process access-token cache without modifying ADC.
286
+ */
287
+ async logout(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
288
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
289
+ try {
290
+ return await uniffiRustCallAsync(
291
+ /*rustCaller:*/ uniffiCaller,
292
+ /*rustFutureFunc:*/ () => {
293
+ return nativeModule().uniffi_dbx_tools_google_fn_method_googleauth_logout(
294
+ uniffiTypeGoogleAuthObjectFactory.clonePointer(this)
295
+ );
296
+ },
297
+ /*pollFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_poll_void,
298
+ /*cancelFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_cancel_void,
299
+ /*completeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_complete_void,
300
+ /*freeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_free_void,
301
+ /*liftFunc:*/ (_v) => {},
302
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
303
+ /*asyncOpts:*/ asyncOpts_,
304
+ /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
305
+ );
306
+ } catch (__error: any) {
307
+ if (uniffiIsDebug && __error instanceof Error) {
308
+ __error.stack = __stack;
309
+ }
310
+ throw __error;
311
+ }
312
+ }
313
+
314
+ /**
315
+ * Reuse a concurrent replacement or refresh the rejected access token.
316
+ */
317
+ async refreshRejectedToken(staleAccessToken: string, asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
318
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
319
+ try {
320
+ return await uniffiRustCallAsync(
321
+ /*rustCaller:*/ uniffiCaller,
322
+ /*rustFutureFunc:*/ () => {
323
+ return nativeModule().uniffi_dbx_tools_google_fn_method_googleauth_refresh_rejected_token(
324
+ uniffiTypeGoogleAuthObjectFactory.clonePointer(this),FfiConverterString.lower(staleAccessToken, nativeModule().rustbuffer_alloc)
325
+ );
326
+ },
327
+ /*pollFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_poll_rust_buffer,
328
+ /*cancelFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_cancel_rust_buffer,
329
+ /*completeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_complete_rust_buffer,
330
+ /*freeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_free_rust_buffer,
331
+ // Async returns always go through the JS-side converter: the
332
+ // FFI symbol returns the future handle (u64), and the user-level
333
+ // RustBuffer comes back via the shared `rust_future_complete_*`
334
+ // export. The bytes the runtime hands back must be deserialized
335
+ // here using the per-callable return-type converter.
336
+ // Borrowed view over foreign memory: the call site owns the free,
337
+ // as on the sync paths. Unconditional — a no-op where buffers are
338
+ // already JS-owned.
339
+ /*liftFunc:*/ (__rb) => {
340
+ try {
341
+ return FfiConverterTypeAccessToken.lift(__rb);
342
+ } finally {
343
+ nativeModule().rustbuffer_free(__rb);
344
+ }
345
+ },
346
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
347
+ /*asyncOpts:*/ asyncOpts_,
348
+ /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
349
+ );
350
+ } catch (__error: any) {
351
+ if (uniffiIsDebug && __error instanceof Error) {
352
+ __error.stack = __stack;
353
+ }
354
+ throw __error;
355
+ }
356
+ }
357
+
358
+ /**
359
+ * Return the selected ADC path and short-lived token storage mode.
360
+ */
361
+ status(): GoogleAuthStatus {
362
+ const __rb: Uint8Array = uniffiCaller.rustCall(
363
+ /*caller:*/ (callStatus) => {
364
+ return nativeModule().uniffi_dbx_tools_google_fn_method_googleauth_status(
365
+ uniffiTypeGoogleAuthObjectFactory.clonePointer(this),
366
+ callStatus);
367
+ },
368
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
369
+ );
370
+ try {
371
+ return FfiConverterTypeGoogleAuthStatus.lift(__rb);
372
+ } finally {
373
+ nativeModule().rustbuffer_free(__rb);
374
+ }
375
+ }
376
+
377
+ /**
378
+ * Return a cached token or refresh it from ADC.
379
+ */
380
+ async token(asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
381
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
382
+ try {
383
+ return await uniffiRustCallAsync(
384
+ /*rustCaller:*/ uniffiCaller,
385
+ /*rustFutureFunc:*/ () => {
386
+ return nativeModule().uniffi_dbx_tools_google_fn_method_googleauth_token(
387
+ uniffiTypeGoogleAuthObjectFactory.clonePointer(this)
388
+ );
389
+ },
390
+ /*pollFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_poll_rust_buffer,
391
+ /*cancelFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_cancel_rust_buffer,
392
+ /*completeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_complete_rust_buffer,
393
+ /*freeFunc:*/ nativeModule().ffi_dbx_tools_google_rust_future_free_rust_buffer,
394
+ // Async returns always go through the JS-side converter: the
395
+ // FFI symbol returns the future handle (u64), and the user-level
396
+ // RustBuffer comes back via the shared `rust_future_complete_*`
397
+ // export. The bytes the runtime hands back must be deserialized
398
+ // here using the per-callable return-type converter.
399
+ // Borrowed view over foreign memory: the call site owns the free,
400
+ // as on the sync paths. Unconditional — a no-op where buffers are
401
+ // already JS-owned.
402
+ /*liftFunc:*/ (__rb) => {
403
+ try {
404
+ return FfiConverterTypeAccessToken.lift(__rb);
405
+ } finally {
406
+ nativeModule().rustbuffer_free(__rb);
407
+ }
408
+ },
409
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
410
+ /*asyncOpts:*/ asyncOpts_,
411
+ /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
412
+ );
413
+ } catch (__error: any) {
414
+ if (uniffiIsDebug && __error instanceof Error) {
415
+ __error.stack = __stack;
416
+ }
417
+ throw __error;
418
+ }
419
+ }
420
+
421
+
422
+ uniffiDestroy(): void {
423
+ const ptr = (this as any)[destructorGuardSymbol];
424
+ if (ptr !== undefined) {
425
+ const pointer = uniffiTypeGoogleAuthObjectFactory.pointer(this);
426
+ uniffiTypeGoogleAuthObjectFactory.freePointer(pointer);
427
+ uniffiTypeGoogleAuthObjectFactory.unbless(ptr);
428
+ delete (this as any)[destructorGuardSymbol];
429
+ }
430
+ }
431
+
432
+ static instanceOf(obj_: any): obj_ is GoogleAuth {
433
+ return uniffiTypeGoogleAuthObjectFactory.isConcreteType(obj_);
434
+ }
435
+
436
+
437
+ }
438
+
439
+ const uniffiTypeGoogleAuthObjectFactory: UniffiObjectFactory<GoogleAuthLike> = (() => {
440
+
441
+ /// <reference lib="es2021" />
442
+ const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {
443
+ uniffiTypeGoogleAuthObjectFactory.freePointer(heldValue);
444
+ }) : null;
445
+
446
+ return {
447
+ create(pointer: UniffiHandle): GoogleAuthLike {
448
+ const instance = Object.create(GoogleAuth.prototype);
449
+ instance[pointerLiteralSymbol] = pointer;
450
+ instance[destructorGuardSymbol] = this.bless(pointer);
451
+ instance[uniffiTypeNameSymbol] = "GoogleAuth";
452
+ return instance;
453
+ },
454
+
455
+
456
+ bless(p: UniffiHandle): UniffiGcObject {
457
+ const ptr = {
458
+ p, // make sure this object doesn't get optimized away.
459
+ markDestroyed: () => undefined,
460
+ };
461
+ if (registry) {
462
+ registry.register(ptr, p, ptr);
463
+ }
464
+ return ptr;
465
+ },
466
+
467
+ unbless(ptr_: UniffiGcObject) {
468
+ if (registry) {
469
+ registry.unregister(ptr_);
470
+ }
471
+ },
472
+
473
+ pointer(obj_: GoogleAuthLike): UniffiHandle {
474
+ if ((obj_ as any)[destructorGuardSymbol] === undefined) {
475
+ throw new UniffiInternalError.UnexpectedNullPointer();
476
+ }
477
+ return (obj_ as any)[pointerLiteralSymbol];
478
+ },
479
+
480
+ clonePointer(obj_: GoogleAuthLike): UniffiHandle {
481
+ const pointer = this.pointer(obj_);
482
+ return uniffiCaller.rustCall(
483
+ /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_google_fn_clone_googleauth(pointer, callStatus),
484
+ /*liftString:*/ FfiConverterString.lift
485
+ );
486
+ },
487
+
488
+ freePointer(pointer: UniffiHandle): void {
489
+ uniffiCaller.rustCall(
490
+ /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_google_fn_free_googleauth(pointer, callStatus),
491
+ /*liftString:*/ FfiConverterString.lift
492
+ );
493
+ },
494
+
495
+ isConcreteType(obj_: any): obj_ is GoogleAuthLike {
496
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "GoogleAuth";
497
+ },
498
+ }})();
499
+ const FfiConverterTypeGoogleAuth = new FfiConverterObject(uniffiTypeGoogleAuthObjectFactory);
500
+
501
+ // FfiConverter for AuthOptions | undefined
502
+ const FfiConverterOptionalTypeAuthOptions = new FfiConverterOptional(FfiConverterTypeAuthOptions);
503
+
504
+ // FfiConverter for string | undefined
505
+ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
506
+
507
+
508
+ /**
509
+ * This should be called before anything else.
510
+ *
511
+ * It is likely that this is being done for you by the library's `index.ts`.
512
+ *
513
+ * It checks versions of uniffi between when the Rust scaffolding was generated
514
+ * and when the bindings were generated.
515
+ *
516
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
517
+ */
518
+ function uniffiEnsureInitialized() {
519
+ // Get the bindings contract version from our ComponentInterface
520
+ const bindingsContractVersion = 30;
521
+ // Get the scaffolding contract version by calling the into the dylib
522
+ const scaffoldingContractVersion = nativeModule().ffi_dbx_tools_google_uniffi_contract_version();
523
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
524
+ throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
525
+ }
526
+ if (nativeModule().uniffi_dbx_tools_google_checksum_func_create_google_auth() !== 8482) {
527
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_google_checksum_func_create_google_auth");
528
+ }
529
+ if (nativeModule().uniffi_dbx_tools_google_checksum_method_googleauth_force_refresh_token() !== 40538) {
530
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_google_checksum_method_googleauth_force_refresh_token");
531
+ }
532
+ if (nativeModule().uniffi_dbx_tools_google_checksum_method_googleauth_logout() !== 28220) {
533
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_google_checksum_method_googleauth_logout");
534
+ }
535
+ if (nativeModule().uniffi_dbx_tools_google_checksum_method_googleauth_refresh_rejected_token() !== 56472) {
536
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_google_checksum_method_googleauth_refresh_rejected_token");
537
+ }
538
+ if (nativeModule().uniffi_dbx_tools_google_checksum_method_googleauth_status() !== 21388) {
539
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_google_checksum_method_googleauth_status");
540
+ }
541
+ if (nativeModule().uniffi_dbx_tools_google_checksum_method_googleauth_token() !== 20454) {
542
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_google_checksum_method_googleauth_token");
543
+ }
544
+
545
+ }
546
+
547
+ export default Object.freeze({
548
+ initialize: uniffiEnsureInitialized,
549
+ converters: {
550
+ FfiConverterTypeGoogleAuth,
551
+ FfiConverterTypeGoogleAuthOptions,
552
+ FfiConverterTypeGoogleAuthStatus,
553
+ }
554
+ });
@@ -0,0 +1,12 @@
1
+ // GENERATED by UniFFI binding generation - DO NOT EDIT.
2
+ // Regenerated from the dbx-tools-google Rust exports.
3
+ // Hand edits are overwritten on the next watch; this file is read-only.
4
+
5
+ /* eslint-disable */
6
+ // @ts-nocheck
7
+ export * from './_bindings.ts';
8
+ import uniffiModule from './_bindings.ts';
9
+ uniffiModule.initialize();
10
+ export { uniffiModule };
11
+ export async function uniffiInitAsync() {}
12
+ export type { GoogleAuthLike } from './_bindings.ts';