@dbx-tools/databricks 0.6.186 → 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.
package/src/_bindings.ts DELETED
@@ -1,2501 +0,0 @@
1
- // GENERATED by UniFFI binding generation - DO NOT EDIT.
2
- // Regenerated from the dbx-tools-databricks 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, type UniffiForeignFutureResultRustBuffer, type UniffiForeignFutureCompleterustBuffer, type UniffiForeignFutureResultVoid, type UniffiForeignFutureCompletevoid, type UniffiVTableCallbackInterfaceDbxToolsDatabricksStorageAdapter,
11
- } from "./_bindings-ffi.ts";
12
- import { type FfiConverter, type UniffiByteArray, type UniffiGcObject, type UniffiHandle, type UniffiObjectFactory, type UniffiReferenceHolder, type UniffiRustCallStatus, AbstractFfiConverterByteArray, Cursor, FfiConverterArray, FfiConverterBool, FfiConverterInt64, FfiConverterMap, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt64, FfiConverterUInt8, RustBuffer, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol, variantOrdinalSymbol,
13
- } from "@ubjs/core";
14
- const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
15
-
16
- const uniffiIsDebug =
17
- // @ts-ignore -- The process global might not be defined
18
- typeof process !== "object" ||
19
- // @ts-ignore -- The process global might not be defined
20
- process?.env?.NODE_ENV !== "production" ||
21
- false;
22
-
23
- // Public interface members begin here.
24
-
25
- /**
26
- * Trim, sort, and deduplicate scopes for requests and credential identities.
27
- */
28
- export function canonicalScopes(scopes: Array<string>): Array<string> {
29
- const __rb: Uint8Array = uniffiCaller.rustCall(
30
- /*caller:*/ (callStatus) => {
31
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_canonical_scopes(
32
- FfiConverterSequenceString.lower(scopes, nativeModule().rustbuffer_alloc),
33
- callStatus);
34
- },
35
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
36
- );
37
- try {
38
- return FfiConverterSequenceString.lift(__rb);
39
- } finally {
40
- nativeModule().rustbuffer_free(__rb);
41
- }
42
- }
43
-
44
- /**
45
- * Resolve a Databricks profile and open built-in credential storage.
46
- */
47
- export async function createPersistentAuth(options: DatabricksAuthOptions, storage: Storage | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<PersistentAuthLike> /*throws*/ {
48
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
49
- try {
50
- return await uniffiRustCallAsync(
51
- /*rustCaller:*/ uniffiCaller,
52
- /*rustFutureFunc:*/ () => {
53
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_create_persistent_auth(FfiConverterTypeDatabricksAuthOptions.lower(options, nativeModule().rustbuffer_alloc),FfiConverterOptionalTypeStorage.lower(storage, nativeModule().rustbuffer_alloc)
54
- );
55
- },
56
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_u64,
57
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_u64,
58
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_u64,
59
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_u64,
60
- // Async returns always go through the JS-side converter: the
61
- // FFI symbol returns the future handle (u64), and the user-level
62
- // RustBuffer comes back via the shared `rust_future_complete_*`
63
- // export. The bytes the runtime hands back must be deserialized
64
- // here using the per-callable return-type converter.
65
- /*liftFunc:*/ FfiConverterTypePersistentAuth.lift.bind(FfiConverterTypePersistentAuth),
66
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
67
- /*asyncOpts:*/ asyncOpts_,
68
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
69
- );
70
- } catch (__error: any) {
71
- if (uniffiIsDebug && __error instanceof Error) {
72
- __error.stack = __stack;
73
- }
74
- throw __error;
75
- }
76
- }
77
-
78
- /**
79
- * Resolve authentication with the current Databricks App request headers.
80
- */
81
- export async function createPersistentAuthForRequest(options: DatabricksAuthOptions, requestHeaders: Map<string, string>, storage: Storage | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<PersistentAuthLike> /*throws*/ {
82
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
83
- try {
84
- return await uniffiRustCallAsync(
85
- /*rustCaller:*/ uniffiCaller,
86
- /*rustFutureFunc:*/ () => {
87
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_create_persistent_auth_for_request(FfiConverterTypeDatabricksAuthOptions.lower(options, nativeModule().rustbuffer_alloc),FfiConverterMapStringString.lower(requestHeaders, nativeModule().rustbuffer_alloc),FfiConverterOptionalTypeStorage.lower(storage, nativeModule().rustbuffer_alloc)
88
- );
89
- },
90
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_u64,
91
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_u64,
92
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_u64,
93
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_u64,
94
- // Async returns always go through the JS-side converter: the
95
- // FFI symbol returns the future handle (u64), and the user-level
96
- // RustBuffer comes back via the shared `rust_future_complete_*`
97
- // export. The bytes the runtime hands back must be deserialized
98
- // here using the per-callable return-type converter.
99
- /*liftFunc:*/ FfiConverterTypePersistentAuth.lift.bind(FfiConverterTypePersistentAuth),
100
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
101
- /*asyncOpts:*/ asyncOpts_,
102
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
103
- );
104
- } catch (__error: any) {
105
- if (uniffiIsDebug && __error instanceof Error) {
106
- __error.stack = __stack;
107
- }
108
- throw __error;
109
- }
110
- }
111
-
112
- /**
113
- * Resolve a Databricks profile using a shared owning-library storage handle.
114
- */
115
- export async function createPersistentAuthWithStorage(options: DatabricksAuthOptions, storage: StorageHandleLike, asyncOpts_?: { signal: AbortSignal }): Promise<PersistentAuthLike> /*throws*/ {
116
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
117
- try {
118
- return await uniffiRustCallAsync(
119
- /*rustCaller:*/ uniffiCaller,
120
- /*rustFutureFunc:*/ () => {
121
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_create_persistent_auth_with_storage(FfiConverterTypeDatabricksAuthOptions.lower(options, nativeModule().rustbuffer_alloc),FfiConverterTypeStorageHandle.lower(storage, nativeModule().rustbuffer_alloc)
122
- );
123
- },
124
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_u64,
125
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_u64,
126
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_u64,
127
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_u64,
128
- // Async returns always go through the JS-side converter: the
129
- // FFI symbol returns the future handle (u64), and the user-level
130
- // RustBuffer comes back via the shared `rust_future_complete_*`
131
- // export. The bytes the runtime hands back must be deserialized
132
- // here using the per-callable return-type converter.
133
- /*liftFunc:*/ FfiConverterTypePersistentAuth.lift.bind(FfiConverterTypePersistentAuth),
134
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
135
- /*asyncOpts:*/ asyncOpts_,
136
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
137
- );
138
- } catch (__error: any) {
139
- if (uniffiIsDebug && __error instanceof Error) {
140
- __error.stack = __stack;
141
- }
142
- throw __error;
143
- }
144
- }
145
-
146
- /**
147
- * Construct a provider with built-in persistent storage and shared lifecycle defaults.
148
- */
149
- export async function createProviderAuth(options: ProviderOptions, asyncOpts_?: { signal: AbortSignal }): Promise<ProviderAuthLike> /*throws*/ {
150
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
151
- try {
152
- return await uniffiRustCallAsync(
153
- /*rustCaller:*/ uniffiCaller,
154
- /*rustFutureFunc:*/ () => {
155
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_create_provider_auth(FfiConverterTypeProviderOptions.lower(options, nativeModule().rustbuffer_alloc)
156
- );
157
- },
158
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_u64,
159
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_u64,
160
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_u64,
161
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_u64,
162
- // Async returns always go through the JS-side converter: the
163
- // FFI symbol returns the future handle (u64), and the user-level
164
- // RustBuffer comes back via the shared `rust_future_complete_*`
165
- // export. The bytes the runtime hands back must be deserialized
166
- // here using the per-callable return-type converter.
167
- /*liftFunc:*/ FfiConverterTypeProviderAuth.lift.bind(FfiConverterTypeProviderAuth),
168
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
169
- /*asyncOpts:*/ asyncOpts_,
170
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
171
- );
172
- } catch (__error: any) {
173
- if (uniffiIsDebug && __error instanceof Error) {
174
- __error.stack = __stack;
175
- }
176
- throw __error;
177
- }
178
- }
179
-
180
- /**
181
- * Construct a provider from the same owning-library storage handle used by Databricks auth.
182
- */
183
- export async function createProviderAuthWithStorage(options: ProviderOptions, storage: StorageHandleLike, asyncOpts_?: { signal: AbortSignal }): Promise<ProviderAuthLike> /*throws*/ {
184
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
185
- try {
186
- return await uniffiRustCallAsync(
187
- /*rustCaller:*/ uniffiCaller,
188
- /*rustFutureFunc:*/ () => {
189
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_create_provider_auth_with_storage(FfiConverterTypeProviderOptions.lower(options, nativeModule().rustbuffer_alloc),FfiConverterTypeStorageHandle.lower(storage, nativeModule().rustbuffer_alloc)
190
- );
191
- },
192
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_u64,
193
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_u64,
194
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_u64,
195
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_u64,
196
- // Async returns always go through the JS-side converter: the
197
- // FFI symbol returns the future handle (u64), and the user-level
198
- // RustBuffer comes back via the shared `rust_future_complete_*`
199
- // export. The bytes the runtime hands back must be deserialized
200
- // here using the per-callable return-type converter.
201
- /*liftFunc:*/ FfiConverterTypeProviderAuth.lift.bind(FfiConverterTypeProviderAuth),
202
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
203
- /*asyncOpts:*/ asyncOpts_,
204
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
205
- );
206
- } catch (__error: any) {
207
- if (uniffiIsDebug && __error instanceof Error) {
208
- __error.stack = __stack;
209
- }
210
- throw __error;
211
- }
212
- }
213
-
214
- /**
215
- * Wrap custom storage before passing it into another provider's native library.
216
- */
217
- export function createStorageHandle(storage: StorageAdapter): StorageHandleLike {
218
- return FfiConverterTypeStorageHandle.lift(uniffiCaller.rustCall(
219
- /*caller:*/ (callStatus) => {
220
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_create_storage_handle(
221
- FfiConverterTypeStorageAdapter.lower(storage, nativeModule().rustbuffer_alloc),
222
- callStatus);
223
- },
224
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
225
- ));
226
- }
227
-
228
- /**
229
- * Derive a stable provider/profile/scope-set identity without storing raw scopes in the key.
230
- */
231
- export function credentialKey(provider: string, profile: string | undefined, scopes: Array<string>): string {
232
- const __rb: Uint8Array = uniffiCaller.rustCall(
233
- /*caller:*/ (callStatus) => {
234
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_credential_key(
235
- FfiConverterString.lower(provider, nativeModule().rustbuffer_alloc),
236
- FfiConverterOptionalString.lower(profile, nativeModule().rustbuffer_alloc),
237
- FfiConverterSequenceString.lower(scopes, nativeModule().rustbuffer_alloc),
238
- callStatus);
239
- },
240
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
241
- );
242
- try {
243
- return FfiConverterString.lift(__rb);
244
- } finally {
245
- nativeModule().rustbuffer_free(__rb);
246
- }
247
- }
248
-
249
- /**
250
- * Whether `databricks auth --help` succeeds in this process environment.
251
- */
252
- export function databricksCliAvailable(): boolean {
253
- return FfiConverterBool.lift(uniffiCaller.rustCall(
254
- /*caller:*/ (callStatus) => {
255
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_databricks_cli_available(
256
- callStatus);
257
- },
258
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
259
- ));
260
- }
261
-
262
- /**
263
- * Detect whether the current process is running as a Databricks App.
264
- */
265
- export function isDatabricksApp(): boolean {
266
- return FfiConverterBool.lift(uniffiCaller.rustCall(
267
- /*caller:*/ (callStatus) => {
268
- return nativeModule().uniffi_dbx_tools_databricks_fn_func_is_databricks_app(
269
- callStatus);
270
- },
271
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
272
- ));
273
- }
274
-
275
- const stringConverter = (() => {
276
- const encoder = new TextEncoder();
277
- const decoder = new TextDecoder();
278
- return {
279
- stringToBytes: (s: string) => encoder.encode(s),
280
- bytesToString: (ab: UniffiByteArray) => decoder.decode(ab),
281
- stringByteLength: (s: string) => encoder.encode(s).byteLength,
282
- writeStringIntoBuffer: (s: string, buf: any, offset: number): number => {
283
- const view = new Uint8Array(
284
- buf.arrayBuffer,
285
- offset,
286
- buf.arrayBuffer.byteLength - offset,
287
- );
288
- return encoder.encodeInto(s, view).written;
289
- },
290
- readStringFromBuffer: (buf: any, offset: number, length: number): string =>
291
- decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length)),
292
- };
293
- })();
294
- const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
295
-
296
- /**
297
- * Public credential result; deliberately excludes the refresh token.
298
- */
299
- export type AccessToken = {
300
- accessToken: string,
301
- tokenType: string,
302
- expiry?: string,
303
- scopes: Array<string>
304
- }
305
-
306
- /**
307
- * Generated factory for {@link AccessToken} record objects.
308
- */
309
- export const AccessToken = (() => {
310
- const defaults = () => ({
311
- });
312
- const create = (() => {
313
- return uniffiCreateRecord<AccessToken, ReturnType<typeof defaults>>(defaults);
314
- })();
315
- return Object.freeze({
316
- create,
317
- new: create,
318
- defaults: () => Object.freeze(defaults()) as Partial<AccessToken>,
319
- });
320
- })();
321
-
322
- const FfiConverterTypeAccessToken = (() => {
323
- type TypeName = AccessToken;
324
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
325
- readFromCursor(c: Cursor): TypeName {
326
- return {
327
- accessToken: FfiConverterString.readFromCursor(c),
328
- tokenType: FfiConverterString.readFromCursor(c),
329
- expiry: FfiConverterOptionalString.readFromCursor(c),
330
- scopes: FfiConverterSequenceString.readFromCursor(c)
331
- };
332
- }
333
- writeIntoCursor(value: TypeName, c: Cursor): void {
334
- FfiConverterString.writeIntoCursor(value.accessToken, c);
335
- FfiConverterString.writeIntoCursor(value.tokenType, c);
336
- FfiConverterOptionalString.writeIntoCursor(value.expiry, c);
337
- FfiConverterSequenceString.writeIntoCursor(value.scopes, c);
338
- }
339
- allocationSize(value: TypeName): number {
340
- return FfiConverterString.allocationSize(value.accessToken) +
341
- FfiConverterString.allocationSize(value.tokenType) +
342
- FfiConverterOptionalString.allocationSize(value.expiry) +
343
- FfiConverterSequenceString.allocationSize(value.scopes);
344
-
345
- }
346
- };
347
- return new FFIConverter();
348
- })();
349
-
350
- /**
351
- * Shared lifecycle configuration embedded by every provider's binding options.
352
- */
353
- export type AuthOptions = {
354
- /**
355
- * Renew credentials this many seconds before expiry; negative values are allowed.
356
- */
357
- refreshBufferSeconds: bigint,
358
- /**
359
- * Maximum time spent waiting for the credential store's refresh lock.
360
- */
361
- lockTimeoutSeconds: bigint,
362
- /**
363
- * Maximum time allowed for a new interactive login.
364
- */
365
- loginTimeoutSeconds: bigint,
366
- /**
367
- * Logo URL or data URI displayed by the browser callback page.
368
- */
369
- callbackImageSrc?: string
370
- }
371
-
372
- /**
373
- * Generated factory for {@link AuthOptions} record objects.
374
- */
375
- export const AuthOptions = (() => {
376
- const defaults = () => ({
377
- refreshBufferSeconds: BigInt("300"),
378
- lockTimeoutSeconds: BigInt("30"),
379
- loginTimeoutSeconds: BigInt("3600"),
380
- callbackImageSrc: undefined
381
- });
382
- const create = (() => {
383
- return uniffiCreateRecord<AuthOptions, ReturnType<typeof defaults>>(defaults);
384
- })();
385
- return Object.freeze({
386
- create,
387
- new: create,
388
- defaults: () => Object.freeze(defaults()) as Partial<AuthOptions>,
389
- });
390
- })();
391
-
392
- const FfiConverterTypeAuthOptions = (() => {
393
- type TypeName = AuthOptions;
394
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
395
- readFromCursor(c: Cursor): TypeName {
396
- return {
397
- refreshBufferSeconds: FfiConverterInt64.readFromCursor(c),
398
- lockTimeoutSeconds: FfiConverterUInt64.readFromCursor(c),
399
- loginTimeoutSeconds: FfiConverterUInt64.readFromCursor(c),
400
- callbackImageSrc: FfiConverterOptionalString.readFromCursor(c)
401
- };
402
- }
403
- writeIntoCursor(value: TypeName, c: Cursor): void {
404
- FfiConverterInt64.writeIntoCursor(value.refreshBufferSeconds, c);
405
- FfiConverterUInt64.writeIntoCursor(value.lockTimeoutSeconds, c);
406
- FfiConverterUInt64.writeIntoCursor(value.loginTimeoutSeconds, c);
407
- FfiConverterOptionalString.writeIntoCursor(value.callbackImageSrc, c);
408
- }
409
- allocationSize(value: TypeName): number {
410
- return FfiConverterInt64.allocationSize(value.refreshBufferSeconds) +
411
- FfiConverterUInt64.allocationSize(value.lockTimeoutSeconds) +
412
- FfiConverterUInt64.allocationSize(value.loginTimeoutSeconds) +
413
- FfiConverterOptionalString.allocationSize(value.callbackImageSrc);
414
-
415
- }
416
- };
417
- return new FFIConverter();
418
- })();
419
-
420
- /**
421
- * Configuration shared by the generated Node and Python auth bindings.
422
- */
423
- export type DatabricksAuthOptions = {
424
- /**
425
- * Explicit profile name; explicit choices are never remapped to another profile.
426
- */
427
- profile?: string,
428
- /**
429
- * Override the workspace or account host.
430
- */
431
- host?: string,
432
- /**
433
- * Account identifier for account-scoped authentication.
434
- */
435
- accountId?: string,
436
- /**
437
- * Workspace identifier for unified authentication.
438
- */
439
- workspaceId?: string,
440
- /**
441
- * Override the Databricks CLI configuration file.
442
- */
443
- configFile?: string,
444
- /**
445
- * Override the OAuth application identifier.
446
- */
447
- clientId?: string,
448
- /**
449
- * Optional group role requested by M2M token generation.
450
- */
451
- groupId?: string,
452
- /**
453
- * Explicit Databricks authentication strategy.
454
- */
455
- authType?: string,
456
- /**
457
- * Override profile scopes; omission preserves profile/default scope resolution.
458
- */
459
- scopes?: Array<string>,
460
- /**
461
- * Target kind: workspace, account, or unified.
462
- */
463
- target?: string,
464
- /**
465
- * Override the directory containing the shared CLI token cache.
466
- */
467
- cacheDir?: string,
468
- /**
469
- * Shared lifecycle configuration; omission uses `AuthOptions::default()`.
470
- */
471
- auth?: AuthOptions,
472
- /**
473
- * Whether implicit M2M defaults should select one matching U2M profile.
474
- */
475
- preferUserToMachine: boolean
476
- }
477
-
478
- /**
479
- * Generated factory for {@link DatabricksAuthOptions} record objects.
480
- */
481
- export const DatabricksAuthOptions = (() => {
482
- const defaults = () => ({
483
- profile: undefined,
484
- host: undefined,
485
- accountId: undefined,
486
- workspaceId: undefined,
487
- configFile: undefined,
488
- clientId: undefined,
489
- groupId: undefined,
490
- authType: undefined,
491
- scopes: undefined,
492
- target: undefined,
493
- cacheDir: undefined,
494
- auth: undefined,
495
- preferUserToMachine: true
496
- });
497
- const create = (() => {
498
- return uniffiCreateRecord<DatabricksAuthOptions, ReturnType<typeof defaults>>(defaults);
499
- })();
500
- return Object.freeze({
501
- create,
502
- new: create,
503
- defaults: () => Object.freeze(defaults()) as Partial<DatabricksAuthOptions>,
504
- });
505
- })();
506
-
507
- const FfiConverterTypeDatabricksAuthOptions = (() => {
508
- type TypeName = DatabricksAuthOptions;
509
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
510
- readFromCursor(c: Cursor): TypeName {
511
- return {
512
- profile: FfiConverterOptionalString.readFromCursor(c),
513
- host: FfiConverterOptionalString.readFromCursor(c),
514
- accountId: FfiConverterOptionalString.readFromCursor(c),
515
- workspaceId: FfiConverterOptionalString.readFromCursor(c),
516
- configFile: FfiConverterOptionalString.readFromCursor(c),
517
- clientId: FfiConverterOptionalString.readFromCursor(c),
518
- groupId: FfiConverterOptionalString.readFromCursor(c),
519
- authType: FfiConverterOptionalString.readFromCursor(c),
520
- scopes: FfiConverterOptionalSequenceString.readFromCursor(c),
521
- target: FfiConverterOptionalString.readFromCursor(c),
522
- cacheDir: FfiConverterOptionalString.readFromCursor(c),
523
- auth: FfiConverterOptionalTypeAuthOptions.readFromCursor(c),
524
- preferUserToMachine: FfiConverterBool.readFromCursor(c)
525
- };
526
- }
527
- writeIntoCursor(value: TypeName, c: Cursor): void {
528
- FfiConverterOptionalString.writeIntoCursor(value.profile, c);
529
- FfiConverterOptionalString.writeIntoCursor(value.host, c);
530
- FfiConverterOptionalString.writeIntoCursor(value.accountId, c);
531
- FfiConverterOptionalString.writeIntoCursor(value.workspaceId, c);
532
- FfiConverterOptionalString.writeIntoCursor(value.configFile, c);
533
- FfiConverterOptionalString.writeIntoCursor(value.clientId, c);
534
- FfiConverterOptionalString.writeIntoCursor(value.groupId, c);
535
- FfiConverterOptionalString.writeIntoCursor(value.authType, c);
536
- FfiConverterOptionalSequenceString.writeIntoCursor(value.scopes, c);
537
- FfiConverterOptionalString.writeIntoCursor(value.target, c);
538
- FfiConverterOptionalString.writeIntoCursor(value.cacheDir, c);
539
- FfiConverterOptionalTypeAuthOptions.writeIntoCursor(value.auth, c);
540
- FfiConverterBool.writeIntoCursor(value.preferUserToMachine, c);
541
- }
542
- allocationSize(value: TypeName): number {
543
- return FfiConverterOptionalString.allocationSize(value.profile) +
544
- FfiConverterOptionalString.allocationSize(value.host) +
545
- FfiConverterOptionalString.allocationSize(value.accountId) +
546
- FfiConverterOptionalString.allocationSize(value.workspaceId) +
547
- FfiConverterOptionalString.allocationSize(value.configFile) +
548
- FfiConverterOptionalString.allocationSize(value.clientId) +
549
- FfiConverterOptionalString.allocationSize(value.groupId) +
550
- FfiConverterOptionalString.allocationSize(value.authType) +
551
- FfiConverterOptionalSequenceString.allocationSize(value.scopes) +
552
- FfiConverterOptionalString.allocationSize(value.target) +
553
- FfiConverterOptionalString.allocationSize(value.cacheDir) +
554
- FfiConverterOptionalTypeAuthOptions.allocationSize(value.auth) +
555
- FfiConverterBool.allocationSize(value.preferUserToMachine);
556
-
557
- }
558
- };
559
- return new FFIConverter();
560
- })();
561
-
562
- export enum Storage {
563
- Auto,
564
- Memory,
565
- File
566
- }
567
-
568
- const FfiConverterTypeStorage = (() => {
569
- type TypeName = Storage;
570
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
571
- readFromCursor(c: Cursor): TypeName {
572
- switch (c.readI32()) {
573
- case 1: return Storage.Auto;
574
- case 2: return Storage.Memory;
575
- case 3: return Storage.File;
576
- default: throw new UniffiInternalError.UnexpectedEnumCase();
577
- }
578
- }
579
- writeIntoCursor(value: TypeName, c: Cursor): void {
580
- switch (value) {
581
- case Storage.Auto: return c.writeI32(1);
582
- case Storage.Memory: return c.writeI32(2);
583
- case Storage.File: return c.writeI32(3);
584
- }
585
- }
586
- allocationSize(value: TypeName): number {
587
- return 4;
588
- }
589
- }
590
- return new FFIConverter();
591
- })();
592
-
593
- /**
594
- * Resolved Databricks identity and active storage backend.
595
- */
596
- export type DatabricksAuthStatus = {
597
- profile: string,
598
- host: string,
599
- storage: Storage
600
- }
601
-
602
- /**
603
- * Generated factory for {@link DatabricksAuthStatus} record objects.
604
- */
605
- export const DatabricksAuthStatus = (() => {
606
- const defaults = () => ({
607
- });
608
- const create = (() => {
609
- return uniffiCreateRecord<DatabricksAuthStatus, ReturnType<typeof defaults>>(defaults);
610
- })();
611
- return Object.freeze({
612
- create,
613
- new: create,
614
- defaults: () => Object.freeze(defaults()) as Partial<DatabricksAuthStatus>,
615
- });
616
- })();
617
-
618
- const FfiConverterTypeDatabricksAuthStatus = (() => {
619
- type TypeName = DatabricksAuthStatus;
620
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
621
- readFromCursor(c: Cursor): TypeName {
622
- return {
623
- profile: FfiConverterString.readFromCursor(c),
624
- host: FfiConverterString.readFromCursor(c),
625
- storage: FfiConverterTypeStorage.readFromCursor(c)
626
- };
627
- }
628
- writeIntoCursor(value: TypeName, c: Cursor): void {
629
- FfiConverterString.writeIntoCursor(value.profile, c);
630
- FfiConverterString.writeIntoCursor(value.host, c);
631
- FfiConverterTypeStorage.writeIntoCursor(value.storage, c);
632
- }
633
- allocationSize(value: TypeName): number {
634
- return FfiConverterString.allocationSize(value.profile) +
635
- FfiConverterString.allocationSize(value.host) +
636
- FfiConverterTypeStorage.allocationSize(value.storage);
637
-
638
- }
639
- };
640
- return new FFIConverter();
641
- })();
642
-
643
- /**
644
- * OAuth grant used to acquire and renew credentials.
645
- */
646
- export enum OAuthGrant {
647
- AuthorizationCode,
648
- ClientCredentials
649
- }
650
-
651
- const FfiConverterTypeOAuthGrant = (() => {
652
- type TypeName = OAuthGrant;
653
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
654
- readFromCursor(c: Cursor): TypeName {
655
- switch (c.readI32()) {
656
- case 1: return OAuthGrant.AuthorizationCode;
657
- case 2: return OAuthGrant.ClientCredentials;
658
- default: throw new UniffiInternalError.UnexpectedEnumCase();
659
- }
660
- }
661
- writeIntoCursor(value: TypeName, c: Cursor): void {
662
- switch (value) {
663
- case OAuthGrant.AuthorizationCode: return c.writeI32(1);
664
- case OAuthGrant.ClientCredentials: return c.writeI32(2);
665
- }
666
- }
667
- allocationSize(value: TypeName): number {
668
- return 4;
669
- }
670
- }
671
- return new FFIConverter();
672
- })();
673
-
674
- export enum FileLayout {
675
- Single,
676
- PerCredential
677
- }
678
-
679
- const FfiConverterTypeFileLayout = (() => {
680
- type TypeName = FileLayout;
681
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
682
- readFromCursor(c: Cursor): TypeName {
683
- switch (c.readI32()) {
684
- case 1: return FileLayout.Single;
685
- case 2: return FileLayout.PerCredential;
686
- default: throw new UniffiInternalError.UnexpectedEnumCase();
687
- }
688
- }
689
- writeIntoCursor(value: TypeName, c: Cursor): void {
690
- switch (value) {
691
- case FileLayout.Single: return c.writeI32(1);
692
- case FileLayout.PerCredential: return c.writeI32(2);
693
- }
694
- }
695
- allocationSize(value: TypeName): number {
696
- return 4;
697
- }
698
- }
699
- return new FFIConverter();
700
- })();
701
-
702
- /**
703
- * Provider-specific OAuth identity, endpoints, storage, and shared lifecycle options.
704
- */
705
- export type ProviderOptions = {
706
- /**
707
- * Stable provider identity used to isolate stored credentials.
708
- */
709
- provider: string,
710
- /**
711
- * OAuth application identifier.
712
- */
713
- clientId: string,
714
- /**
715
- * Provider's token exchange endpoint.
716
- */
717
- tokenEndpoint: string,
718
- /**
719
- * Required browser authorization endpoint for authorization-code grants.
720
- */
721
- authorizationEndpoint?: string,
722
- /**
723
- * Secret for confidential clients; never returned in access-token results.
724
- */
725
- clientSecret?: string,
726
- /**
727
- * Optional namespace for multiple accounts under one provider.
728
- */
729
- profile?: string,
730
- /**
731
- * Requested scopes, trimmed, sorted, and deduplicated before use.
732
- */
733
- scopes: Array<string>,
734
- /**
735
- * Defaults to authorization code with PKCE when omitted.
736
- */
737
- grant?: OAuthGrant,
738
- /**
739
- * Override the provider-neutral credential directory.
740
- */
741
- cacheDir?: string,
742
- /**
743
- * Select a built-in store; omission uses file storage.
744
- */
745
- storage?: Storage,
746
- /**
747
- * Select a shared cache file or independent credential files.
748
- */
749
- fileLayout?: FileLayout,
750
- /**
751
- * Shared lifecycle configuration; omission uses `AuthOptions::default()`.
752
- */
753
- auth?: AuthOptions
754
- }
755
-
756
- /**
757
- * Generated factory for {@link ProviderOptions} record objects.
758
- */
759
- export const ProviderOptions = (() => {
760
- const defaults = () => ({
761
- authorizationEndpoint: undefined,
762
- clientSecret: undefined,
763
- profile: undefined,
764
- scopes: [],
765
- grant: undefined,
766
- cacheDir: undefined,
767
- storage: undefined,
768
- fileLayout: undefined,
769
- auth: undefined
770
- });
771
- const create = (() => {
772
- return uniffiCreateRecord<ProviderOptions, ReturnType<typeof defaults>>(defaults);
773
- })();
774
- return Object.freeze({
775
- create,
776
- new: create,
777
- defaults: () => Object.freeze(defaults()) as Partial<ProviderOptions>,
778
- });
779
- })();
780
-
781
- const FfiConverterTypeProviderOptions = (() => {
782
- type TypeName = ProviderOptions;
783
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
784
- readFromCursor(c: Cursor): TypeName {
785
- return {
786
- provider: FfiConverterString.readFromCursor(c),
787
- clientId: FfiConverterString.readFromCursor(c),
788
- tokenEndpoint: FfiConverterString.readFromCursor(c),
789
- authorizationEndpoint: FfiConverterOptionalString.readFromCursor(c),
790
- clientSecret: FfiConverterOptionalString.readFromCursor(c),
791
- profile: FfiConverterOptionalString.readFromCursor(c),
792
- scopes: FfiConverterSequenceString.readFromCursor(c),
793
- grant: FfiConverterOptionalTypeOAuthGrant.readFromCursor(c),
794
- cacheDir: FfiConverterOptionalString.readFromCursor(c),
795
- storage: FfiConverterOptionalTypeStorage.readFromCursor(c),
796
- fileLayout: FfiConverterOptionalTypeFileLayout.readFromCursor(c),
797
- auth: FfiConverterOptionalTypeAuthOptions.readFromCursor(c)
798
- };
799
- }
800
- writeIntoCursor(value: TypeName, c: Cursor): void {
801
- FfiConverterString.writeIntoCursor(value.provider, c);
802
- FfiConverterString.writeIntoCursor(value.clientId, c);
803
- FfiConverterString.writeIntoCursor(value.tokenEndpoint, c);
804
- FfiConverterOptionalString.writeIntoCursor(value.authorizationEndpoint, c);
805
- FfiConverterOptionalString.writeIntoCursor(value.clientSecret, c);
806
- FfiConverterOptionalString.writeIntoCursor(value.profile, c);
807
- FfiConverterSequenceString.writeIntoCursor(value.scopes, c);
808
- FfiConverterOptionalTypeOAuthGrant.writeIntoCursor(value.grant, c);
809
- FfiConverterOptionalString.writeIntoCursor(value.cacheDir, c);
810
- FfiConverterOptionalTypeStorage.writeIntoCursor(value.storage, c);
811
- FfiConverterOptionalTypeFileLayout.writeIntoCursor(value.fileLayout, c);
812
- FfiConverterOptionalTypeAuthOptions.writeIntoCursor(value.auth, c);
813
- }
814
- allocationSize(value: TypeName): number {
815
- return FfiConverterString.allocationSize(value.provider) +
816
- FfiConverterString.allocationSize(value.clientId) +
817
- FfiConverterString.allocationSize(value.tokenEndpoint) +
818
- FfiConverterOptionalString.allocationSize(value.authorizationEndpoint) +
819
- FfiConverterOptionalString.allocationSize(value.clientSecret) +
820
- FfiConverterOptionalString.allocationSize(value.profile) +
821
- FfiConverterSequenceString.allocationSize(value.scopes) +
822
- FfiConverterOptionalTypeOAuthGrant.allocationSize(value.grant) +
823
- FfiConverterOptionalString.allocationSize(value.cacheDir) +
824
- FfiConverterOptionalTypeStorage.allocationSize(value.storage) +
825
- FfiConverterOptionalTypeFileLayout.allocationSize(value.fileLayout) +
826
- FfiConverterOptionalTypeAuthOptions.allocationSize(value.auth);
827
-
828
- }
829
- };
830
- return new FFIConverter();
831
- })();
832
-
833
-
834
- // Error type: AuthError
835
- export enum AuthError_Tags {
836
- Failure = "Failure"
837
- }
838
- export const AuthError = (() => {
839
-
840
- type Failure__interface = {
841
- tag: AuthError_Tags.Failure;
842
- inner:
843
- Readonly<{message: string}>
844
- };
845
- class Failure_ extends UniffiError implements Failure__interface {
846
- /**
847
- * @private
848
- * This field is private and should not be used, use `tag` instead.
849
- */
850
- readonly [uniffiTypeNameSymbol] = "AuthError";
851
- readonly tag = AuthError_Tags.Failure;
852
- readonly inner:
853
- Readonly<{message: string}>;
854
- constructor(
855
- inner: {message: string }) {
856
- super("AuthError", "Failure");
857
-
858
- this.inner = Object.freeze(inner);
859
- }
860
- static new(
861
- inner: {message: string }): Failure_ {
862
- return new Failure_(inner);
863
- }
864
-
865
- static instanceOf(obj: any): obj is Failure_ {
866
- return obj.tag === AuthError_Tags.Failure;
867
- }
868
- static hasInner(obj: any): obj is Failure_ {
869
- return Failure_.instanceOf(obj);
870
- }
871
-
872
- static getInner(obj: Failure_):
873
- Readonly<{message: string}> {
874
- return obj.inner;
875
- }
876
-
877
- }
878
-
879
- function instanceOf(obj: any): obj is AuthError {
880
- return obj[uniffiTypeNameSymbol] === "AuthError";
881
- }
882
-
883
- return Object.freeze({
884
- instanceOf,
885
- Failure: Failure_
886
- });
887
-
888
- })();
889
- export type AuthError = InstanceType<
890
- typeof AuthError['Failure']
891
- >;
892
-
893
- // FfiConverter for enum AuthError
894
- const FfiConverterTypeAuthError = (() => {
895
- type TypeName = AuthError;
896
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
897
- readFromCursor(c: Cursor): TypeName {
898
- switch (c.readI32()) {
899
- case 1: return new AuthError.Failure({message: FfiConverterString.readFromCursor(c) });
900
- default: throw new UniffiInternalError.UnexpectedEnumCase();
901
- }
902
- }
903
- writeIntoCursor(value: TypeName, c: Cursor): void {
904
- switch (value.tag) {
905
- case AuthError_Tags.Failure: {
906
- c.writeI32(1);
907
- const inner = value.inner;
908
- FfiConverterString.writeIntoCursor(inner.message, c);
909
- return;
910
- }
911
- default:
912
- // Throwing from here means that AuthError_Tags hasn't matched an ordinal.
913
- throw new UniffiInternalError.UnexpectedEnumCase();
914
- }
915
- }
916
- allocationSize(value: TypeName): number {
917
- switch (value.tag) {
918
- case AuthError_Tags.Failure: {
919
- const inner = value.inner;
920
- let size = 4;
921
- size += FfiConverterString.allocationSize(inner.message);
922
- return size;
923
- }
924
- default: throw new UniffiInternalError.UnexpectedEnumCase();
925
- }
926
- }
927
- }
928
- return new FFIConverter();
929
- })();
930
-
931
- /**
932
- * Databricks binding facade over the shared persistent authentication lifecycle.
933
- */
934
- export interface PersistentAuthLike {
935
-
936
- /**
937
- * Start an explicit login and persist the resulting credential.
938
- */
939
- challenge(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
940
- /**
941
- * Renew the stored credential even before its refresh window.
942
- */
943
- forceRefreshToken(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
944
- /**
945
- * Delete the credential while holding the store's refresh lock.
946
- */
947
- logout(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
948
- /**
949
- * Reuse another caller's replacement or renew the rejected token.
950
- */
951
- refreshRejectedToken(staleAccessToken: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
952
- /**
953
- * Return the resolved identity and active built-in storage backend.
954
- */
955
- status(): DatabricksAuthStatus;
956
- /**
957
- * True forces login, false forbids interactive login, and omission permits missing-token login.
958
- */
959
- token(login?: boolean | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
960
- }
961
- /**
962
- * @deprecated Use `PersistentAuthLike` instead.
963
- */
964
- export type PersistentAuthInterface = PersistentAuthLike;
965
-
966
-
967
- /**
968
- * Databricks binding facade over the shared persistent authentication lifecycle.
969
- */
970
- export class PersistentAuth extends UniffiAbstractObject implements PersistentAuthLike {
971
-
972
- readonly [uniffiTypeNameSymbol] = "PersistentAuth";
973
- readonly [destructorGuardSymbol]: UniffiGcObject;
974
- readonly [pointerLiteralSymbol]: UniffiHandle;
975
- // No primary constructor declared for this class.
976
- private constructor(pointer: UniffiHandle) {
977
- super();
978
- this[pointerLiteralSymbol] = pointer;
979
- this[destructorGuardSymbol] = uniffiTypePersistentAuthObjectFactory.bless(pointer);
980
- }
981
-
982
-
983
-
984
-
985
- /**
986
- * Start an explicit login and persist the resulting credential.
987
- */
988
- async challenge(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
989
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
990
- try {
991
- return await uniffiRustCallAsync(
992
- /*rustCaller:*/ uniffiCaller,
993
- /*rustFutureFunc:*/ () => {
994
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_persistentauth_challenge(
995
- uniffiTypePersistentAuthObjectFactory.clonePointer(this)
996
- );
997
- },
998
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
999
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1000
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1001
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1002
- /*liftFunc:*/ (_v) => {},
1003
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1004
- /*asyncOpts:*/ asyncOpts_,
1005
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1006
- );
1007
- } catch (__error: any) {
1008
- if (uniffiIsDebug && __error instanceof Error) {
1009
- __error.stack = __stack;
1010
- }
1011
- throw __error;
1012
- }
1013
- }
1014
-
1015
- /**
1016
- * Renew the stored credential even before its refresh window.
1017
- */
1018
- async forceRefreshToken(asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
1019
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1020
- try {
1021
- return await uniffiRustCallAsync(
1022
- /*rustCaller:*/ uniffiCaller,
1023
- /*rustFutureFunc:*/ () => {
1024
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_persistentauth_force_refresh_token(
1025
- uniffiTypePersistentAuthObjectFactory.clonePointer(this)
1026
- );
1027
- },
1028
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1029
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1030
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1031
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1032
- // Async returns always go through the JS-side converter: the
1033
- // FFI symbol returns the future handle (u64), and the user-level
1034
- // RustBuffer comes back via the shared `rust_future_complete_*`
1035
- // export. The bytes the runtime hands back must be deserialized
1036
- // here using the per-callable return-type converter.
1037
- // Borrowed view over foreign memory: the call site owns the free,
1038
- // as on the sync paths. Unconditional — a no-op where buffers are
1039
- // already JS-owned.
1040
- /*liftFunc:*/ (__rb) => {
1041
- try {
1042
- return FfiConverterTypeAccessToken.lift(__rb);
1043
- } finally {
1044
- nativeModule().rustbuffer_free(__rb);
1045
- }
1046
- },
1047
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1048
- /*asyncOpts:*/ asyncOpts_,
1049
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1050
- );
1051
- } catch (__error: any) {
1052
- if (uniffiIsDebug && __error instanceof Error) {
1053
- __error.stack = __stack;
1054
- }
1055
- throw __error;
1056
- }
1057
- }
1058
-
1059
- /**
1060
- * Delete the credential while holding the store's refresh lock.
1061
- */
1062
- async logout(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
1063
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1064
- try {
1065
- return await uniffiRustCallAsync(
1066
- /*rustCaller:*/ uniffiCaller,
1067
- /*rustFutureFunc:*/ () => {
1068
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_persistentauth_logout(
1069
- uniffiTypePersistentAuthObjectFactory.clonePointer(this)
1070
- );
1071
- },
1072
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
1073
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1074
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1075
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1076
- /*liftFunc:*/ (_v) => {},
1077
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1078
- /*asyncOpts:*/ asyncOpts_,
1079
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1080
- );
1081
- } catch (__error: any) {
1082
- if (uniffiIsDebug && __error instanceof Error) {
1083
- __error.stack = __stack;
1084
- }
1085
- throw __error;
1086
- }
1087
- }
1088
-
1089
- /**
1090
- * Reuse another caller's replacement or renew the rejected token.
1091
- */
1092
- async refreshRejectedToken(staleAccessToken: string, asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
1093
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1094
- try {
1095
- return await uniffiRustCallAsync(
1096
- /*rustCaller:*/ uniffiCaller,
1097
- /*rustFutureFunc:*/ () => {
1098
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_persistentauth_refresh_rejected_token(
1099
- uniffiTypePersistentAuthObjectFactory.clonePointer(this),FfiConverterString.lower(staleAccessToken, nativeModule().rustbuffer_alloc)
1100
- );
1101
- },
1102
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1103
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1104
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1105
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1106
- // Async returns always go through the JS-side converter: the
1107
- // FFI symbol returns the future handle (u64), and the user-level
1108
- // RustBuffer comes back via the shared `rust_future_complete_*`
1109
- // export. The bytes the runtime hands back must be deserialized
1110
- // here using the per-callable return-type converter.
1111
- // Borrowed view over foreign memory: the call site owns the free,
1112
- // as on the sync paths. Unconditional — a no-op where buffers are
1113
- // already JS-owned.
1114
- /*liftFunc:*/ (__rb) => {
1115
- try {
1116
- return FfiConverterTypeAccessToken.lift(__rb);
1117
- } finally {
1118
- nativeModule().rustbuffer_free(__rb);
1119
- }
1120
- },
1121
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1122
- /*asyncOpts:*/ asyncOpts_,
1123
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1124
- );
1125
- } catch (__error: any) {
1126
- if (uniffiIsDebug && __error instanceof Error) {
1127
- __error.stack = __stack;
1128
- }
1129
- throw __error;
1130
- }
1131
- }
1132
-
1133
- /**
1134
- * Return the resolved identity and active built-in storage backend.
1135
- */
1136
- status(): DatabricksAuthStatus {
1137
- const __rb: Uint8Array = uniffiCaller.rustCall(
1138
- /*caller:*/ (callStatus) => {
1139
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_persistentauth_status(
1140
- uniffiTypePersistentAuthObjectFactory.clonePointer(this),
1141
- callStatus);
1142
- },
1143
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1144
- );
1145
- try {
1146
- return FfiConverterTypeDatabricksAuthStatus.lift(__rb);
1147
- } finally {
1148
- nativeModule().rustbuffer_free(__rb);
1149
- }
1150
- }
1151
-
1152
- /**
1153
- * True forces login, false forbids interactive login, and omission permits missing-token login.
1154
- */
1155
- async token(login: boolean | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
1156
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1157
- try {
1158
- return await uniffiRustCallAsync(
1159
- /*rustCaller:*/ uniffiCaller,
1160
- /*rustFutureFunc:*/ () => {
1161
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_persistentauth_token(
1162
- uniffiTypePersistentAuthObjectFactory.clonePointer(this),FfiConverterOptionalBoolean.lower(login, nativeModule().rustbuffer_alloc)
1163
- );
1164
- },
1165
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1166
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1167
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1168
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1169
- // Async returns always go through the JS-side converter: the
1170
- // FFI symbol returns the future handle (u64), and the user-level
1171
- // RustBuffer comes back via the shared `rust_future_complete_*`
1172
- // export. The bytes the runtime hands back must be deserialized
1173
- // here using the per-callable return-type converter.
1174
- // Borrowed view over foreign memory: the call site owns the free,
1175
- // as on the sync paths. Unconditional — a no-op where buffers are
1176
- // already JS-owned.
1177
- /*liftFunc:*/ (__rb) => {
1178
- try {
1179
- return FfiConverterTypeAccessToken.lift(__rb);
1180
- } finally {
1181
- nativeModule().rustbuffer_free(__rb);
1182
- }
1183
- },
1184
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1185
- /*asyncOpts:*/ asyncOpts_,
1186
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1187
- );
1188
- } catch (__error: any) {
1189
- if (uniffiIsDebug && __error instanceof Error) {
1190
- __error.stack = __stack;
1191
- }
1192
- throw __error;
1193
- }
1194
- }
1195
-
1196
-
1197
- uniffiDestroy(): void {
1198
- const ptr = (this as any)[destructorGuardSymbol];
1199
- if (ptr !== undefined) {
1200
- const pointer = uniffiTypePersistentAuthObjectFactory.pointer(this);
1201
- uniffiTypePersistentAuthObjectFactory.freePointer(pointer);
1202
- uniffiTypePersistentAuthObjectFactory.unbless(ptr);
1203
- delete (this as any)[destructorGuardSymbol];
1204
- }
1205
- }
1206
-
1207
- static instanceOf(obj_: any): obj_ is PersistentAuth {
1208
- return uniffiTypePersistentAuthObjectFactory.isConcreteType(obj_);
1209
- }
1210
-
1211
-
1212
- }
1213
-
1214
- const uniffiTypePersistentAuthObjectFactory: UniffiObjectFactory<PersistentAuthLike> = (() => {
1215
-
1216
- /// <reference lib="es2021" />
1217
- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {
1218
- uniffiTypePersistentAuthObjectFactory.freePointer(heldValue);
1219
- }) : null;
1220
-
1221
- return {
1222
- create(pointer: UniffiHandle): PersistentAuthLike {
1223
- const instance = Object.create(PersistentAuth.prototype);
1224
- instance[pointerLiteralSymbol] = pointer;
1225
- instance[destructorGuardSymbol] = this.bless(pointer);
1226
- instance[uniffiTypeNameSymbol] = "PersistentAuth";
1227
- return instance;
1228
- },
1229
-
1230
-
1231
- bless(p: UniffiHandle): UniffiGcObject {
1232
- const ptr = {
1233
- p, // make sure this object doesn't get optimized away.
1234
- markDestroyed: () => undefined,
1235
- };
1236
- if (registry) {
1237
- registry.register(ptr, p, ptr);
1238
- }
1239
- return ptr;
1240
- },
1241
-
1242
- unbless(ptr_: UniffiGcObject) {
1243
- if (registry) {
1244
- registry.unregister(ptr_);
1245
- }
1246
- },
1247
-
1248
- pointer(obj_: PersistentAuthLike): UniffiHandle {
1249
- if ((obj_ as any)[destructorGuardSymbol] === undefined) {
1250
- throw new UniffiInternalError.UnexpectedNullPointer();
1251
- }
1252
- return (obj_ as any)[pointerLiteralSymbol];
1253
- },
1254
-
1255
- clonePointer(obj_: PersistentAuthLike): UniffiHandle {
1256
- const pointer = this.pointer(obj_);
1257
- return uniffiCaller.rustCall(
1258
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_clone_persistentauth(pointer, callStatus),
1259
- /*liftString:*/ FfiConverterString.lift
1260
- );
1261
- },
1262
-
1263
- freePointer(pointer: UniffiHandle): void {
1264
- uniffiCaller.rustCall(
1265
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_free_persistentauth(pointer, callStatus),
1266
- /*liftString:*/ FfiConverterString.lift
1267
- );
1268
- },
1269
-
1270
- isConcreteType(obj_: any): obj_ is PersistentAuthLike {
1271
- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "PersistentAuth";
1272
- },
1273
- }})();
1274
- const FfiConverterTypePersistentAuth = new FfiConverterObject(uniffiTypePersistentAuthObjectFactory);
1275
-
1276
- /**
1277
- * Generic OAuth provider using the shared persistent credential lifecycle.
1278
- */
1279
- export interface ProviderAuthLike {
1280
-
1281
- /**
1282
- * Renew the credential even if it has not entered its refresh window.
1283
- */
1284
- forceRefreshToken(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
1285
- /**
1286
- * Delete the stored credential while holding its refresh lock.
1287
- */
1288
- logout(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
1289
- /**
1290
- * Reuse a concurrent replacement or renew the rejected access token.
1291
- */
1292
- refreshRejectedToken(staleAccessToken: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
1293
- /**
1294
- * True forces login, false forbids interactive login, and omission permits missing-token login.
1295
- */
1296
- token(login?: boolean | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<AccessToken>;
1297
- }
1298
- /**
1299
- * @deprecated Use `ProviderAuthLike` instead.
1300
- */
1301
- export type ProviderAuthInterface = ProviderAuthLike;
1302
-
1303
-
1304
- /**
1305
- * Generic OAuth provider using the shared persistent credential lifecycle.
1306
- */
1307
- export class ProviderAuth extends UniffiAbstractObject implements ProviderAuthLike {
1308
-
1309
- readonly [uniffiTypeNameSymbol] = "ProviderAuth";
1310
- readonly [destructorGuardSymbol]: UniffiGcObject;
1311
- readonly [pointerLiteralSymbol]: UniffiHandle;
1312
- // No primary constructor declared for this class.
1313
- private constructor(pointer: UniffiHandle) {
1314
- super();
1315
- this[pointerLiteralSymbol] = pointer;
1316
- this[destructorGuardSymbol] = uniffiTypeProviderAuthObjectFactory.bless(pointer);
1317
- }
1318
-
1319
-
1320
-
1321
-
1322
- /**
1323
- * Renew the credential even if it has not entered its refresh window.
1324
- */
1325
- async forceRefreshToken(asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
1326
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1327
- try {
1328
- return await uniffiRustCallAsync(
1329
- /*rustCaller:*/ uniffiCaller,
1330
- /*rustFutureFunc:*/ () => {
1331
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_providerauth_force_refresh_token(
1332
- uniffiTypeProviderAuthObjectFactory.clonePointer(this)
1333
- );
1334
- },
1335
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1336
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1337
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1338
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1339
- // Async returns always go through the JS-side converter: the
1340
- // FFI symbol returns the future handle (u64), and the user-level
1341
- // RustBuffer comes back via the shared `rust_future_complete_*`
1342
- // export. The bytes the runtime hands back must be deserialized
1343
- // here using the per-callable return-type converter.
1344
- // Borrowed view over foreign memory: the call site owns the free,
1345
- // as on the sync paths. Unconditional — a no-op where buffers are
1346
- // already JS-owned.
1347
- /*liftFunc:*/ (__rb) => {
1348
- try {
1349
- return FfiConverterTypeAccessToken.lift(__rb);
1350
- } finally {
1351
- nativeModule().rustbuffer_free(__rb);
1352
- }
1353
- },
1354
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1355
- /*asyncOpts:*/ asyncOpts_,
1356
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1357
- );
1358
- } catch (__error: any) {
1359
- if (uniffiIsDebug && __error instanceof Error) {
1360
- __error.stack = __stack;
1361
- }
1362
- throw __error;
1363
- }
1364
- }
1365
-
1366
- /**
1367
- * Delete the stored credential while holding its refresh lock.
1368
- */
1369
- async logout(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
1370
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1371
- try {
1372
- return await uniffiRustCallAsync(
1373
- /*rustCaller:*/ uniffiCaller,
1374
- /*rustFutureFunc:*/ () => {
1375
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_providerauth_logout(
1376
- uniffiTypeProviderAuthObjectFactory.clonePointer(this)
1377
- );
1378
- },
1379
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
1380
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1381
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1382
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1383
- /*liftFunc:*/ (_v) => {},
1384
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1385
- /*asyncOpts:*/ asyncOpts_,
1386
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1387
- );
1388
- } catch (__error: any) {
1389
- if (uniffiIsDebug && __error instanceof Error) {
1390
- __error.stack = __stack;
1391
- }
1392
- throw __error;
1393
- }
1394
- }
1395
-
1396
- /**
1397
- * Reuse a concurrent replacement or renew the rejected access token.
1398
- */
1399
- async refreshRejectedToken(staleAccessToken: string, asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
1400
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1401
- try {
1402
- return await uniffiRustCallAsync(
1403
- /*rustCaller:*/ uniffiCaller,
1404
- /*rustFutureFunc:*/ () => {
1405
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_providerauth_refresh_rejected_token(
1406
- uniffiTypeProviderAuthObjectFactory.clonePointer(this),FfiConverterString.lower(staleAccessToken, nativeModule().rustbuffer_alloc)
1407
- );
1408
- },
1409
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1410
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1411
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1412
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1413
- // Async returns always go through the JS-side converter: the
1414
- // FFI symbol returns the future handle (u64), and the user-level
1415
- // RustBuffer comes back via the shared `rust_future_complete_*`
1416
- // export. The bytes the runtime hands back must be deserialized
1417
- // here using the per-callable return-type converter.
1418
- // Borrowed view over foreign memory: the call site owns the free,
1419
- // as on the sync paths. Unconditional — a no-op where buffers are
1420
- // already JS-owned.
1421
- /*liftFunc:*/ (__rb) => {
1422
- try {
1423
- return FfiConverterTypeAccessToken.lift(__rb);
1424
- } finally {
1425
- nativeModule().rustbuffer_free(__rb);
1426
- }
1427
- },
1428
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1429
- /*asyncOpts:*/ asyncOpts_,
1430
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1431
- );
1432
- } catch (__error: any) {
1433
- if (uniffiIsDebug && __error instanceof Error) {
1434
- __error.stack = __stack;
1435
- }
1436
- throw __error;
1437
- }
1438
- }
1439
-
1440
- /**
1441
- * True forces login, false forbids interactive login, and omission permits missing-token login.
1442
- */
1443
- async token(login: boolean | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<AccessToken> /*throws*/ {
1444
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1445
- try {
1446
- return await uniffiRustCallAsync(
1447
- /*rustCaller:*/ uniffiCaller,
1448
- /*rustFutureFunc:*/ () => {
1449
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_providerauth_token(
1450
- uniffiTypeProviderAuthObjectFactory.clonePointer(this),FfiConverterOptionalBoolean.lower(login, nativeModule().rustbuffer_alloc)
1451
- );
1452
- },
1453
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1454
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1455
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1456
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1457
- // Async returns always go through the JS-side converter: the
1458
- // FFI symbol returns the future handle (u64), and the user-level
1459
- // RustBuffer comes back via the shared `rust_future_complete_*`
1460
- // export. The bytes the runtime hands back must be deserialized
1461
- // here using the per-callable return-type converter.
1462
- // Borrowed view over foreign memory: the call site owns the free,
1463
- // as on the sync paths. Unconditional — a no-op where buffers are
1464
- // already JS-owned.
1465
- /*liftFunc:*/ (__rb) => {
1466
- try {
1467
- return FfiConverterTypeAccessToken.lift(__rb);
1468
- } finally {
1469
- nativeModule().rustbuffer_free(__rb);
1470
- }
1471
- },
1472
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1473
- /*asyncOpts:*/ asyncOpts_,
1474
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1475
- );
1476
- } catch (__error: any) {
1477
- if (uniffiIsDebug && __error instanceof Error) {
1478
- __error.stack = __stack;
1479
- }
1480
- throw __error;
1481
- }
1482
- }
1483
-
1484
-
1485
- uniffiDestroy(): void {
1486
- const ptr = (this as any)[destructorGuardSymbol];
1487
- if (ptr !== undefined) {
1488
- const pointer = uniffiTypeProviderAuthObjectFactory.pointer(this);
1489
- uniffiTypeProviderAuthObjectFactory.freePointer(pointer);
1490
- uniffiTypeProviderAuthObjectFactory.unbless(ptr);
1491
- delete (this as any)[destructorGuardSymbol];
1492
- }
1493
- }
1494
-
1495
- static instanceOf(obj_: any): obj_ is ProviderAuth {
1496
- return uniffiTypeProviderAuthObjectFactory.isConcreteType(obj_);
1497
- }
1498
-
1499
-
1500
- }
1501
-
1502
- const uniffiTypeProviderAuthObjectFactory: UniffiObjectFactory<ProviderAuthLike> = (() => {
1503
-
1504
- /// <reference lib="es2021" />
1505
- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {
1506
- uniffiTypeProviderAuthObjectFactory.freePointer(heldValue);
1507
- }) : null;
1508
-
1509
- return {
1510
- create(pointer: UniffiHandle): ProviderAuthLike {
1511
- const instance = Object.create(ProviderAuth.prototype);
1512
- instance[pointerLiteralSymbol] = pointer;
1513
- instance[destructorGuardSymbol] = this.bless(pointer);
1514
- instance[uniffiTypeNameSymbol] = "ProviderAuth";
1515
- return instance;
1516
- },
1517
-
1518
-
1519
- bless(p: UniffiHandle): UniffiGcObject {
1520
- const ptr = {
1521
- p, // make sure this object doesn't get optimized away.
1522
- markDestroyed: () => undefined,
1523
- };
1524
- if (registry) {
1525
- registry.register(ptr, p, ptr);
1526
- }
1527
- return ptr;
1528
- },
1529
-
1530
- unbless(ptr_: UniffiGcObject) {
1531
- if (registry) {
1532
- registry.unregister(ptr_);
1533
- }
1534
- },
1535
-
1536
- pointer(obj_: ProviderAuthLike): UniffiHandle {
1537
- if ((obj_ as any)[destructorGuardSymbol] === undefined) {
1538
- throw new UniffiInternalError.UnexpectedNullPointer();
1539
- }
1540
- return (obj_ as any)[pointerLiteralSymbol];
1541
- },
1542
-
1543
- clonePointer(obj_: ProviderAuthLike): UniffiHandle {
1544
- const pointer = this.pointer(obj_);
1545
- return uniffiCaller.rustCall(
1546
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_clone_providerauth(pointer, callStatus),
1547
- /*liftString:*/ FfiConverterString.lift
1548
- );
1549
- },
1550
-
1551
- freePointer(pointer: UniffiHandle): void {
1552
- uniffiCaller.rustCall(
1553
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_free_providerauth(pointer, callStatus),
1554
- /*liftString:*/ FfiConverterString.lift
1555
- );
1556
- },
1557
-
1558
- isConcreteType(obj_: any): obj_ is ProviderAuthLike {
1559
- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "ProviderAuth";
1560
- },
1561
- }})();
1562
- const FfiConverterTypeProviderAuth = new FfiConverterObject(uniffiTypeProviderAuthObjectFactory);
1563
-
1564
- /**
1565
- * Foreign-language persistence contract; implement every method in Node or Python.
1566
- *
1567
- * UniFFI callback interfaces do not inherit Rust default method bodies. A store
1568
- * must explicitly implement locking and may implement `prepare_write` as a no-op
1569
- * when writes need no preflight. Credential JSON can contain refresh tokens.
1570
- */
1571
- export interface StorageAdapter {
1572
-
1573
- /**
1574
- * Load credential JSON, returning None when the key does not exist.
1575
- */
1576
- load(profile: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<string | undefined>;
1577
- /**
1578
- * Check write readiness before a provider rotates a refresh token.
1579
- */
1580
- prepareWrite(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
1581
- /**
1582
- * Persist credential JSON without discarding unrelated keys.
1583
- */
1584
- save(profile: string, token: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
1585
- /**
1586
- * Delete only the specified credential.
1587
- */
1588
- remove(profile: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
1589
- /**
1590
- * Acquire an exclusive refresh lease or fail within the timeout.
1591
- */
1592
- acquireLock(profile: string, timeoutMillis: bigint, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<string>;
1593
- /**
1594
- * Release the lease returned by `acquire_lock`.
1595
- */
1596
- releaseLock(lease: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
1597
- /**
1598
- * Return a human-readable backend identifier.
1599
- */
1600
- name(): string;
1601
- }
1602
-
1603
-
1604
- /**
1605
- * Foreign-language persistence contract; implement every method in Node or Python.
1606
- *
1607
- * UniFFI callback interfaces do not inherit Rust default method bodies. A store
1608
- * must explicitly implement locking and may implement `prepare_write` as a no-op
1609
- * when writes need no preflight. Credential JSON can contain refresh tokens.
1610
- */
1611
- export class StorageAdapterImpl extends UniffiAbstractObject implements StorageAdapter {
1612
-
1613
- readonly [uniffiTypeNameSymbol] = "StorageAdapterImpl";
1614
- readonly [destructorGuardSymbol]: UniffiGcObject;
1615
- readonly [pointerLiteralSymbol]: UniffiHandle;
1616
- // No primary constructor declared for this class.
1617
- private constructor(pointer: UniffiHandle) {
1618
- super();
1619
- this[pointerLiteralSymbol] = pointer;
1620
- this[destructorGuardSymbol] = uniffiTypeStorageAdapterImplObjectFactory.bless(pointer);
1621
- }
1622
-
1623
-
1624
-
1625
-
1626
- /**
1627
- * Load credential JSON, returning None when the key does not exist.
1628
- */
1629
- async load(profile: string, asyncOpts_?: { signal: AbortSignal }): Promise<string | undefined> /*throws*/ {
1630
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1631
- try {
1632
- return await uniffiRustCallAsync(
1633
- /*rustCaller:*/ uniffiCaller,
1634
- /*rustFutureFunc:*/ () => {
1635
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_load(
1636
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this),FfiConverterString.lower(profile, nativeModule().rustbuffer_alloc)
1637
- );
1638
- },
1639
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1640
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1641
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1642
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1643
- // Async returns always go through the JS-side converter: the
1644
- // FFI symbol returns the future handle (u64), and the user-level
1645
- // RustBuffer comes back via the shared `rust_future_complete_*`
1646
- // export. The bytes the runtime hands back must be deserialized
1647
- // here using the per-callable return-type converter.
1648
- // Borrowed view over foreign memory: the call site owns the free,
1649
- // as on the sync paths. Unconditional — a no-op where buffers are
1650
- // already JS-owned.
1651
- /*liftFunc:*/ (__rb) => {
1652
- try {
1653
- return FfiConverterOptionalString.lift(__rb);
1654
- } finally {
1655
- nativeModule().rustbuffer_free(__rb);
1656
- }
1657
- },
1658
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1659
- /*asyncOpts:*/ asyncOpts_,
1660
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1661
- );
1662
- } catch (__error: any) {
1663
- if (uniffiIsDebug && __error instanceof Error) {
1664
- __error.stack = __stack;
1665
- }
1666
- throw __error;
1667
- }
1668
- }
1669
-
1670
- /**
1671
- * Check write readiness before a provider rotates a refresh token.
1672
- */
1673
- async prepareWrite(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
1674
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1675
- try {
1676
- return await uniffiRustCallAsync(
1677
- /*rustCaller:*/ uniffiCaller,
1678
- /*rustFutureFunc:*/ () => {
1679
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_prepare_write(
1680
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this)
1681
- );
1682
- },
1683
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
1684
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1685
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1686
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1687
- /*liftFunc:*/ (_v) => {},
1688
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1689
- /*asyncOpts:*/ asyncOpts_,
1690
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1691
- );
1692
- } catch (__error: any) {
1693
- if (uniffiIsDebug && __error instanceof Error) {
1694
- __error.stack = __stack;
1695
- }
1696
- throw __error;
1697
- }
1698
- }
1699
-
1700
- /**
1701
- * Persist credential JSON without discarding unrelated keys.
1702
- */
1703
- async save(profile: string, token: string, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
1704
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1705
- try {
1706
- return await uniffiRustCallAsync(
1707
- /*rustCaller:*/ uniffiCaller,
1708
- /*rustFutureFunc:*/ () => {
1709
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_save(
1710
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this),FfiConverterString.lower(profile, nativeModule().rustbuffer_alloc),FfiConverterString.lower(token, nativeModule().rustbuffer_alloc)
1711
- );
1712
- },
1713
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
1714
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1715
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1716
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1717
- /*liftFunc:*/ (_v) => {},
1718
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1719
- /*asyncOpts:*/ asyncOpts_,
1720
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1721
- );
1722
- } catch (__error: any) {
1723
- if (uniffiIsDebug && __error instanceof Error) {
1724
- __error.stack = __stack;
1725
- }
1726
- throw __error;
1727
- }
1728
- }
1729
-
1730
- /**
1731
- * Delete only the specified credential.
1732
- */
1733
- async remove(profile: string, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
1734
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1735
- try {
1736
- return await uniffiRustCallAsync(
1737
- /*rustCaller:*/ uniffiCaller,
1738
- /*rustFutureFunc:*/ () => {
1739
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_remove(
1740
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this),FfiConverterString.lower(profile, nativeModule().rustbuffer_alloc)
1741
- );
1742
- },
1743
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
1744
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1745
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1746
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1747
- /*liftFunc:*/ (_v) => {},
1748
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1749
- /*asyncOpts:*/ asyncOpts_,
1750
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1751
- );
1752
- } catch (__error: any) {
1753
- if (uniffiIsDebug && __error instanceof Error) {
1754
- __error.stack = __stack;
1755
- }
1756
- throw __error;
1757
- }
1758
- }
1759
-
1760
- /**
1761
- * Acquire an exclusive refresh lease or fail within the timeout.
1762
- */
1763
- async acquireLock(profile: string, timeoutMillis: bigint, asyncOpts_?: { signal: AbortSignal }): Promise<string> /*throws*/ {
1764
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1765
- try {
1766
- return await uniffiRustCallAsync(
1767
- /*rustCaller:*/ uniffiCaller,
1768
- /*rustFutureFunc:*/ () => {
1769
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_acquire_lock(
1770
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this),FfiConverterString.lower(profile, nativeModule().rustbuffer_alloc),FfiConverterUInt64.lower(timeoutMillis, nativeModule().rustbuffer_alloc)
1771
- );
1772
- },
1773
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_rust_buffer,
1774
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_rust_buffer,
1775
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_rust_buffer,
1776
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_rust_buffer,
1777
- // Async returns always go through the JS-side converter: the
1778
- // FFI symbol returns the future handle (u64), and the user-level
1779
- // RustBuffer comes back via the shared `rust_future_complete_*`
1780
- // export. The bytes the runtime hands back must be deserialized
1781
- // here using the per-callable return-type converter.
1782
- // Borrowed view over foreign memory: the call site owns the free,
1783
- // as on the sync paths. Unconditional — a no-op where buffers are
1784
- // already JS-owned.
1785
- /*liftFunc:*/ (__rb) => {
1786
- try {
1787
- return FfiConverterString.lift(__rb);
1788
- } finally {
1789
- nativeModule().rustbuffer_free(__rb);
1790
- }
1791
- },
1792
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1793
- /*asyncOpts:*/ asyncOpts_,
1794
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1795
- );
1796
- } catch (__error: any) {
1797
- if (uniffiIsDebug && __error instanceof Error) {
1798
- __error.stack = __stack;
1799
- }
1800
- throw __error;
1801
- }
1802
- }
1803
-
1804
- /**
1805
- * Release the lease returned by `acquire_lock`.
1806
- */
1807
- async releaseLock(lease: string, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
1808
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
1809
- try {
1810
- return await uniffiRustCallAsync(
1811
- /*rustCaller:*/ uniffiCaller,
1812
- /*rustFutureFunc:*/ () => {
1813
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_release_lock(
1814
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this),FfiConverterString.lower(lease, nativeModule().rustbuffer_alloc)
1815
- );
1816
- },
1817
- /*pollFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_poll_void,
1818
- /*cancelFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_cancel_void,
1819
- /*completeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_complete_void,
1820
- /*freeFunc:*/ nativeModule().ffi_dbx_tools_databricks_rust_future_free_void,
1821
- /*liftFunc:*/ (_v) => {},
1822
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1823
- /*asyncOpts:*/ asyncOpts_,
1824
- /*errorHandler:*/ FfiConverterTypeAuthError.lift.bind(FfiConverterTypeAuthError)
1825
- );
1826
- } catch (__error: any) {
1827
- if (uniffiIsDebug && __error instanceof Error) {
1828
- __error.stack = __stack;
1829
- }
1830
- throw __error;
1831
- }
1832
- }
1833
-
1834
- /**
1835
- * Return a human-readable backend identifier.
1836
- */
1837
- name(): string {
1838
- const __rb: Uint8Array = uniffiCaller.rustCall(
1839
- /*caller:*/ (callStatus) => {
1840
- return nativeModule().uniffi_dbx_tools_databricks_fn_method_storageadapter_name(
1841
- uniffiTypeStorageAdapterImplObjectFactory.clonePointer(this),
1842
- callStatus);
1843
- },
1844
- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1845
- );
1846
- try {
1847
- return FfiConverterString.lift(__rb);
1848
- } finally {
1849
- nativeModule().rustbuffer_free(__rb);
1850
- }
1851
- }
1852
-
1853
-
1854
- uniffiDestroy(): void {
1855
- const ptr = (this as any)[destructorGuardSymbol];
1856
- if (ptr !== undefined) {
1857
- const pointer = uniffiTypeStorageAdapterImplObjectFactory.pointer(this);
1858
- uniffiTypeStorageAdapterImplObjectFactory.freePointer(pointer);
1859
- uniffiTypeStorageAdapterImplObjectFactory.unbless(ptr);
1860
- delete (this as any)[destructorGuardSymbol];
1861
- }
1862
- }
1863
-
1864
- static instanceOf(obj_: any): obj_ is StorageAdapterImpl {
1865
- return uniffiTypeStorageAdapterImplObjectFactory.isConcreteType(obj_);
1866
- }
1867
-
1868
-
1869
- }
1870
-
1871
- const uniffiTypeStorageAdapterImplObjectFactory: UniffiObjectFactory<StorageAdapter> = (() => {
1872
-
1873
- /// <reference lib="es2021" />
1874
- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {
1875
- uniffiTypeStorageAdapterImplObjectFactory.freePointer(heldValue);
1876
- }) : null;
1877
-
1878
- return {
1879
- create(pointer: UniffiHandle): StorageAdapter {
1880
- const instance = Object.create(StorageAdapterImpl.prototype);
1881
- instance[pointerLiteralSymbol] = pointer;
1882
- instance[destructorGuardSymbol] = this.bless(pointer);
1883
- instance[uniffiTypeNameSymbol] = "StorageAdapterImpl";
1884
- return instance;
1885
- },
1886
-
1887
-
1888
- bless(p: UniffiHandle): UniffiGcObject {
1889
- const ptr = {
1890
- p, // make sure this object doesn't get optimized away.
1891
- markDestroyed: () => undefined,
1892
- };
1893
- if (registry) {
1894
- registry.register(ptr, p, ptr);
1895
- }
1896
- return ptr;
1897
- },
1898
-
1899
- unbless(ptr_: UniffiGcObject) {
1900
- if (registry) {
1901
- registry.unregister(ptr_);
1902
- }
1903
- },
1904
-
1905
- pointer(obj_: StorageAdapter): UniffiHandle {
1906
- if ((obj_ as any)[destructorGuardSymbol] === undefined) {
1907
- throw new UniffiInternalError.UnexpectedNullPointer();
1908
- }
1909
- return (obj_ as any)[pointerLiteralSymbol];
1910
- },
1911
-
1912
- clonePointer(obj_: StorageAdapter): UniffiHandle {
1913
- const pointer = this.pointer(obj_);
1914
- return uniffiCaller.rustCall(
1915
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_clone_storageadapter(pointer, callStatus),
1916
- /*liftString:*/ FfiConverterString.lift
1917
- );
1918
- },
1919
-
1920
- freePointer(pointer: UniffiHandle): void {
1921
- uniffiCaller.rustCall(
1922
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_free_storageadapter(pointer, callStatus),
1923
- /*liftString:*/ FfiConverterString.lift
1924
- );
1925
- },
1926
-
1927
- isConcreteType(obj_: any): obj_ is StorageAdapter {
1928
- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "StorageAdapterImpl";
1929
- },
1930
- }})();
1931
- const FfiConverterTypeStorageAdapter = new FfiConverterObjectWithCallbacks(uniffiTypeStorageAdapterImplObjectFactory);
1932
-
1933
- // Add a vtable for the callbacks that go in StorageAdapter.
1934
-
1935
- // Put the implementation in a struct so we don't pollute the top-level namespace
1936
- const uniffiCallbackInterfaceStorageAdapter: { vtable: any; register: () => void; } = {
1937
- // Create the VTable using a series of closures.
1938
- // ts automatically converts these into C callback functions.
1939
- vtable: {
1940
- load: (
1941
- uniffiHandle: bigint,
1942
- profile: Uint8Array,
1943
- uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,
1944
- uniffiCallbackData: bigint) => {
1945
- const uniffiMakeCall =
1946
- async (signal: AbortSignal)
1947
- : Promise<string | undefined> => {
1948
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
1949
- return await jsCallback.load(
1950
- FfiConverterString.lift(profile), { signal }
1951
- )
1952
- };
1953
- const uniffiHandleSuccess = (returnValue: string | undefined) => {
1954
- uniffiFutureCallback.call(
1955
- uniffiFutureCallback,
1956
- uniffiCallbackData,
1957
- /* UniffiForeignFutureResultRustBuffer */{
1958
- return_value: FfiConverterOptionalString.lower(returnValue, nativeModule().rustbuffer_alloc),
1959
- call_status: uniffiCaller.createCallStatus()
1960
- }
1961
- );
1962
- };
1963
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
1964
- uniffiFutureCallback.call(
1965
- uniffiFutureCallback,
1966
- uniffiCallbackData,
1967
- /* UniffiForeignFutureResultRustBuffer */{
1968
- return_value: /*empty*/ new Uint8Array(0),
1969
- // TODO create callstatus with error.
1970
- call_status: uniffiCaller.createErrorStatus(code, errorBuf),
1971
- }
1972
- );
1973
- };
1974
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
1975
- /*makeCall:*/ uniffiMakeCall,
1976
- /*handleSuccess:*/ uniffiHandleSuccess,
1977
- /*handleError:*/ uniffiHandleError,
1978
- /*isErrorType:*/ AuthError.instanceOf,
1979
- /*lowerError:*/ FfiConverterTypeAuthError.lower.bind(FfiConverterTypeAuthError),
1980
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1981
- /*alloc:*/ nativeModule().rustbuffer_alloc,
1982
- );
1983
- return uniffiForeignFuture;
1984
- },
1985
- prepare_write: (
1986
- uniffiHandle: bigint,
1987
- uniffiFutureCallback: UniffiForeignFutureCompletevoid,
1988
- uniffiCallbackData: bigint) => {
1989
- const uniffiMakeCall =
1990
- async (signal: AbortSignal)
1991
- : Promise<void> => {
1992
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
1993
- return await jsCallback.prepareWrite({ signal }
1994
- )
1995
- };
1996
- const uniffiHandleSuccess = (returnValue: void) => {
1997
- uniffiFutureCallback.call(
1998
- uniffiFutureCallback,
1999
- uniffiCallbackData,
2000
- /* UniffiForeignFutureResultVoid */{
2001
- call_status: uniffiCaller.createCallStatus()
2002
- }
2003
- );
2004
- };
2005
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
2006
- uniffiFutureCallback.call(
2007
- uniffiFutureCallback,
2008
- uniffiCallbackData,
2009
- /* UniffiForeignFutureResultVoid */{
2010
- // TODO create callstatus with error.
2011
- call_status: uniffiCaller.createErrorStatus(code, errorBuf),
2012
- }
2013
- );
2014
- };
2015
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
2016
- /*makeCall:*/ uniffiMakeCall,
2017
- /*handleSuccess:*/ uniffiHandleSuccess,
2018
- /*handleError:*/ uniffiHandleError,
2019
- /*isErrorType:*/ AuthError.instanceOf,
2020
- /*lowerError:*/ FfiConverterTypeAuthError.lower.bind(FfiConverterTypeAuthError),
2021
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
2022
- /*alloc:*/ nativeModule().rustbuffer_alloc,
2023
- );
2024
- return uniffiForeignFuture;
2025
- },
2026
- save: (
2027
- uniffiHandle: bigint,
2028
- profile: Uint8Array,
2029
- token: Uint8Array,
2030
- uniffiFutureCallback: UniffiForeignFutureCompletevoid,
2031
- uniffiCallbackData: bigint) => {
2032
- const uniffiMakeCall =
2033
- async (signal: AbortSignal)
2034
- : Promise<void> => {
2035
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
2036
- return await jsCallback.save(
2037
- FfiConverterString.lift(profile),
2038
- FfiConverterString.lift(token), { signal }
2039
- )
2040
- };
2041
- const uniffiHandleSuccess = (returnValue: void) => {
2042
- uniffiFutureCallback.call(
2043
- uniffiFutureCallback,
2044
- uniffiCallbackData,
2045
- /* UniffiForeignFutureResultVoid */{
2046
- call_status: uniffiCaller.createCallStatus()
2047
- }
2048
- );
2049
- };
2050
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
2051
- uniffiFutureCallback.call(
2052
- uniffiFutureCallback,
2053
- uniffiCallbackData,
2054
- /* UniffiForeignFutureResultVoid */{
2055
- // TODO create callstatus with error.
2056
- call_status: uniffiCaller.createErrorStatus(code, errorBuf),
2057
- }
2058
- );
2059
- };
2060
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
2061
- /*makeCall:*/ uniffiMakeCall,
2062
- /*handleSuccess:*/ uniffiHandleSuccess,
2063
- /*handleError:*/ uniffiHandleError,
2064
- /*isErrorType:*/ AuthError.instanceOf,
2065
- /*lowerError:*/ FfiConverterTypeAuthError.lower.bind(FfiConverterTypeAuthError),
2066
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
2067
- /*alloc:*/ nativeModule().rustbuffer_alloc,
2068
- );
2069
- return uniffiForeignFuture;
2070
- },
2071
- remove: (
2072
- uniffiHandle: bigint,
2073
- profile: Uint8Array,
2074
- uniffiFutureCallback: UniffiForeignFutureCompletevoid,
2075
- uniffiCallbackData: bigint) => {
2076
- const uniffiMakeCall =
2077
- async (signal: AbortSignal)
2078
- : Promise<void> => {
2079
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
2080
- return await jsCallback.remove(
2081
- FfiConverterString.lift(profile), { signal }
2082
- )
2083
- };
2084
- const uniffiHandleSuccess = (returnValue: void) => {
2085
- uniffiFutureCallback.call(
2086
- uniffiFutureCallback,
2087
- uniffiCallbackData,
2088
- /* UniffiForeignFutureResultVoid */{
2089
- call_status: uniffiCaller.createCallStatus()
2090
- }
2091
- );
2092
- };
2093
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
2094
- uniffiFutureCallback.call(
2095
- uniffiFutureCallback,
2096
- uniffiCallbackData,
2097
- /* UniffiForeignFutureResultVoid */{
2098
- // TODO create callstatus with error.
2099
- call_status: uniffiCaller.createErrorStatus(code, errorBuf),
2100
- }
2101
- );
2102
- };
2103
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
2104
- /*makeCall:*/ uniffiMakeCall,
2105
- /*handleSuccess:*/ uniffiHandleSuccess,
2106
- /*handleError:*/ uniffiHandleError,
2107
- /*isErrorType:*/ AuthError.instanceOf,
2108
- /*lowerError:*/ FfiConverterTypeAuthError.lower.bind(FfiConverterTypeAuthError),
2109
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
2110
- /*alloc:*/ nativeModule().rustbuffer_alloc,
2111
- );
2112
- return uniffiForeignFuture;
2113
- },
2114
- acquire_lock: (
2115
- uniffiHandle: bigint,
2116
- profile: Uint8Array,
2117
- timeoutMillis: bigint,
2118
- uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,
2119
- uniffiCallbackData: bigint) => {
2120
- const uniffiMakeCall =
2121
- async (signal: AbortSignal)
2122
- : Promise<string> => {
2123
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
2124
- return await jsCallback.acquireLock(
2125
- FfiConverterString.lift(profile),
2126
- FfiConverterUInt64.lift(timeoutMillis), { signal }
2127
- )
2128
- };
2129
- const uniffiHandleSuccess = (returnValue: string) => {
2130
- uniffiFutureCallback.call(
2131
- uniffiFutureCallback,
2132
- uniffiCallbackData,
2133
- /* UniffiForeignFutureResultRustBuffer */{
2134
- return_value: FfiConverterString.lower(returnValue, nativeModule().rustbuffer_alloc),
2135
- call_status: uniffiCaller.createCallStatus()
2136
- }
2137
- );
2138
- };
2139
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
2140
- uniffiFutureCallback.call(
2141
- uniffiFutureCallback,
2142
- uniffiCallbackData,
2143
- /* UniffiForeignFutureResultRustBuffer */{
2144
- return_value: /*empty*/ new Uint8Array(0),
2145
- // TODO create callstatus with error.
2146
- call_status: uniffiCaller.createErrorStatus(code, errorBuf),
2147
- }
2148
- );
2149
- };
2150
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
2151
- /*makeCall:*/ uniffiMakeCall,
2152
- /*handleSuccess:*/ uniffiHandleSuccess,
2153
- /*handleError:*/ uniffiHandleError,
2154
- /*isErrorType:*/ AuthError.instanceOf,
2155
- /*lowerError:*/ FfiConverterTypeAuthError.lower.bind(FfiConverterTypeAuthError),
2156
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
2157
- /*alloc:*/ nativeModule().rustbuffer_alloc,
2158
- );
2159
- return uniffiForeignFuture;
2160
- },
2161
- release_lock: (
2162
- uniffiHandle: bigint,
2163
- lease: Uint8Array,
2164
- uniffiFutureCallback: UniffiForeignFutureCompletevoid,
2165
- uniffiCallbackData: bigint) => {
2166
- const uniffiMakeCall =
2167
- async (signal: AbortSignal)
2168
- : Promise<void> => {
2169
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
2170
- return await jsCallback.releaseLock(
2171
- FfiConverterString.lift(lease), { signal }
2172
- )
2173
- };
2174
- const uniffiHandleSuccess = (returnValue: void) => {
2175
- uniffiFutureCallback.call(
2176
- uniffiFutureCallback,
2177
- uniffiCallbackData,
2178
- /* UniffiForeignFutureResultVoid */{
2179
- call_status: uniffiCaller.createCallStatus()
2180
- }
2181
- );
2182
- };
2183
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
2184
- uniffiFutureCallback.call(
2185
- uniffiFutureCallback,
2186
- uniffiCallbackData,
2187
- /* UniffiForeignFutureResultVoid */{
2188
- // TODO create callstatus with error.
2189
- call_status: uniffiCaller.createErrorStatus(code, errorBuf),
2190
- }
2191
- );
2192
- };
2193
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
2194
- /*makeCall:*/ uniffiMakeCall,
2195
- /*handleSuccess:*/ uniffiHandleSuccess,
2196
- /*handleError:*/ uniffiHandleError,
2197
- /*isErrorType:*/ AuthError.instanceOf,
2198
- /*lowerError:*/ FfiConverterTypeAuthError.lower.bind(FfiConverterTypeAuthError),
2199
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
2200
- /*alloc:*/ nativeModule().rustbuffer_alloc,
2201
- );
2202
- return uniffiForeignFuture;
2203
- },
2204
- name: (
2205
- uniffiHandle: bigint,) => {
2206
- const uniffiMakeCall =
2207
- ()
2208
- : string => {
2209
- const jsCallback = FfiConverterTypeStorageAdapter.lift(uniffiHandle);
2210
- return jsCallback.name(
2211
- )
2212
- };
2213
- const uniffiResult = UniffiResult.ready<Uint8Array>();
2214
- const uniffiHandleSuccess = (obj: any) => {
2215
- UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj, nativeModule().rustbuffer_alloc));
2216
- };
2217
- const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
2218
- UniffiResult.writeError(uniffiResult, code, errBuf);
2219
- };
2220
- uniffiTraitInterfaceCall(
2221
- /*makeCall:*/ uniffiMakeCall,
2222
- /*handleSuccess:*/ uniffiHandleSuccess,
2223
- /*handleError:*/ uniffiHandleError,
2224
- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
2225
- /*alloc:*/ nativeModule().rustbuffer_alloc,
2226
- )
2227
- return uniffiResult;
2228
- },
2229
- uniffi_free: (uniffiHandle: UniffiHandle): void => {
2230
- // this will throw a stale handle error if the handle isn't found.
2231
- FfiConverterTypeStorageAdapter.drop(uniffiHandle);
2232
- },
2233
- uniffi_clone: (uniffiHandle: UniffiHandle): UniffiHandle => {
2234
- return FfiConverterTypeStorageAdapter.clone(uniffiHandle);
2235
- }
2236
- },
2237
- register: () => {nativeModule().uniffi_dbx_tools_databricks_fn_init_callback_vtable_storageadapter(
2238
- uniffiCallbackInterfaceStorageAdapter.vtable
2239
- );
2240
- },
2241
- };
2242
-
2243
- /**
2244
- * Keeps storage callbacks in the native library that owns their converters.
2245
- */
2246
- export interface StorageHandleLike {
2247
-
2248
- }
2249
- /**
2250
- * @deprecated Use `StorageHandleLike` instead.
2251
- */
2252
- export type StorageHandleInterface = StorageHandleLike;
2253
-
2254
-
2255
- /**
2256
- * Keeps storage callbacks in the native library that owns their converters.
2257
- */
2258
- export class StorageHandle extends UniffiAbstractObject implements StorageHandleLike {
2259
-
2260
- readonly [uniffiTypeNameSymbol] = "StorageHandle";
2261
- readonly [destructorGuardSymbol]: UniffiGcObject;
2262
- readonly [pointerLiteralSymbol]: UniffiHandle;
2263
- // No primary constructor declared for this class.
2264
- private constructor(pointer: UniffiHandle) {
2265
- super();
2266
- this[pointerLiteralSymbol] = pointer;
2267
- this[destructorGuardSymbol] = uniffiTypeStorageHandleObjectFactory.bless(pointer);
2268
- }
2269
-
2270
-
2271
-
2272
-
2273
-
2274
- uniffiDestroy(): void {
2275
- const ptr = (this as any)[destructorGuardSymbol];
2276
- if (ptr !== undefined) {
2277
- const pointer = uniffiTypeStorageHandleObjectFactory.pointer(this);
2278
- uniffiTypeStorageHandleObjectFactory.freePointer(pointer);
2279
- uniffiTypeStorageHandleObjectFactory.unbless(ptr);
2280
- delete (this as any)[destructorGuardSymbol];
2281
- }
2282
- }
2283
-
2284
- static instanceOf(obj_: any): obj_ is StorageHandle {
2285
- return uniffiTypeStorageHandleObjectFactory.isConcreteType(obj_);
2286
- }
2287
-
2288
-
2289
- }
2290
-
2291
- const uniffiTypeStorageHandleObjectFactory: UniffiObjectFactory<StorageHandleLike> = (() => {
2292
-
2293
- /// <reference lib="es2021" />
2294
- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {
2295
- uniffiTypeStorageHandleObjectFactory.freePointer(heldValue);
2296
- }) : null;
2297
-
2298
- return {
2299
- create(pointer: UniffiHandle): StorageHandleLike {
2300
- const instance = Object.create(StorageHandle.prototype);
2301
- instance[pointerLiteralSymbol] = pointer;
2302
- instance[destructorGuardSymbol] = this.bless(pointer);
2303
- instance[uniffiTypeNameSymbol] = "StorageHandle";
2304
- return instance;
2305
- },
2306
-
2307
-
2308
- bless(p: UniffiHandle): UniffiGcObject {
2309
- const ptr = {
2310
- p, // make sure this object doesn't get optimized away.
2311
- markDestroyed: () => undefined,
2312
- };
2313
- if (registry) {
2314
- registry.register(ptr, p, ptr);
2315
- }
2316
- return ptr;
2317
- },
2318
-
2319
- unbless(ptr_: UniffiGcObject) {
2320
- if (registry) {
2321
- registry.unregister(ptr_);
2322
- }
2323
- },
2324
-
2325
- pointer(obj_: StorageHandleLike): UniffiHandle {
2326
- if ((obj_ as any)[destructorGuardSymbol] === undefined) {
2327
- throw new UniffiInternalError.UnexpectedNullPointer();
2328
- }
2329
- return (obj_ as any)[pointerLiteralSymbol];
2330
- },
2331
-
2332
- clonePointer(obj_: StorageHandleLike): UniffiHandle {
2333
- const pointer = this.pointer(obj_);
2334
- return uniffiCaller.rustCall(
2335
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_clone_storagehandle(pointer, callStatus),
2336
- /*liftString:*/ FfiConverterString.lift
2337
- );
2338
- },
2339
-
2340
- freePointer(pointer: UniffiHandle): void {
2341
- uniffiCaller.rustCall(
2342
- /*caller:*/ (callStatus) => nativeModule().uniffi_dbx_tools_databricks_fn_free_storagehandle(pointer, callStatus),
2343
- /*liftString:*/ FfiConverterString.lift
2344
- );
2345
- },
2346
-
2347
- isConcreteType(obj_: any): obj_ is StorageHandleLike {
2348
- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "StorageHandle";
2349
- },
2350
- }})();
2351
- const FfiConverterTypeStorageHandle = new FfiConverterObject(uniffiTypeStorageHandleObjectFactory);
2352
-
2353
- // FfiConverter for string | undefined
2354
- const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
2355
-
2356
- // FfiConverter for Array<string>
2357
- const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
2358
-
2359
- // FfiConverter for Array<string> | undefined
2360
- const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
2361
-
2362
- // FfiConverter for AuthOptions | undefined
2363
- const FfiConverterOptionalTypeAuthOptions = new FfiConverterOptional(FfiConverterTypeAuthOptions);
2364
-
2365
- // FfiConverter for OAuthGrant | undefined
2366
- const FfiConverterOptionalTypeOAuthGrant = new FfiConverterOptional(FfiConverterTypeOAuthGrant);
2367
-
2368
- // FfiConverter for Storage | undefined
2369
- const FfiConverterOptionalTypeStorage = new FfiConverterOptional(FfiConverterTypeStorage);
2370
-
2371
- // FfiConverter for FileLayout | undefined
2372
- const FfiConverterOptionalTypeFileLayout = new FfiConverterOptional(FfiConverterTypeFileLayout);
2373
-
2374
- // FfiConverter for boolean | undefined
2375
- const FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);
2376
-
2377
- // FfiConverter for Map<string, string>
2378
- const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);
2379
-
2380
-
2381
- /**
2382
- * This should be called before anything else.
2383
- *
2384
- * It is likely that this is being done for you by the library's `index.ts`.
2385
- *
2386
- * It checks versions of uniffi between when the Rust scaffolding was generated
2387
- * and when the bindings were generated.
2388
- *
2389
- * It also initializes the machinery to enable Rust to talk back to Javascript.
2390
- */
2391
- function uniffiEnsureInitialized() {
2392
- // Get the bindings contract version from our ComponentInterface
2393
- const bindingsContractVersion = 30;
2394
- // Get the scaffolding contract version by calling the into the dylib
2395
- const scaffoldingContractVersion = nativeModule().ffi_dbx_tools_databricks_uniffi_contract_version();
2396
- if (bindingsContractVersion !== scaffoldingContractVersion) {
2397
- throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
2398
- }
2399
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_canonical_scopes() !== 45586) {
2400
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_canonical_scopes");
2401
- }
2402
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_create_persistent_auth() !== 24006) {
2403
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_create_persistent_auth");
2404
- }
2405
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_create_persistent_auth_for_request() !== 30718) {
2406
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_create_persistent_auth_for_request");
2407
- }
2408
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_create_persistent_auth_with_storage() !== 38756) {
2409
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_create_persistent_auth_with_storage");
2410
- }
2411
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_create_provider_auth() !== 37733) {
2412
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_create_provider_auth");
2413
- }
2414
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_create_provider_auth_with_storage() !== 51588) {
2415
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_create_provider_auth_with_storage");
2416
- }
2417
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_create_storage_handle() !== 14044) {
2418
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_create_storage_handle");
2419
- }
2420
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_credential_key() !== 60678) {
2421
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_credential_key");
2422
- }
2423
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_databricks_cli_available() !== 19375) {
2424
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_databricks_cli_available");
2425
- }
2426
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_func_is_databricks_app() !== 65309) {
2427
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_func_is_databricks_app");
2428
- }
2429
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_persistentauth_challenge() !== 16856) {
2430
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_persistentauth_challenge");
2431
- }
2432
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_persistentauth_force_refresh_token() !== 64316) {
2433
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_persistentauth_force_refresh_token");
2434
- }
2435
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_persistentauth_logout() !== 7691) {
2436
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_persistentauth_logout");
2437
- }
2438
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_persistentauth_refresh_rejected_token() !== 58164) {
2439
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_persistentauth_refresh_rejected_token");
2440
- }
2441
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_persistentauth_status() !== 36346) {
2442
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_persistentauth_status");
2443
- }
2444
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_persistentauth_token() !== 41040) {
2445
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_persistentauth_token");
2446
- }
2447
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_providerauth_force_refresh_token() !== 51438) {
2448
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_providerauth_force_refresh_token");
2449
- }
2450
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_providerauth_logout() !== 52272) {
2451
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_providerauth_logout");
2452
- }
2453
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_providerauth_refresh_rejected_token() !== 8782) {
2454
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_providerauth_refresh_rejected_token");
2455
- }
2456
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_providerauth_token() !== 12412) {
2457
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_providerauth_token");
2458
- }
2459
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_load() !== 10075) {
2460
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_load");
2461
- }
2462
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_prepare_write() !== 61599) {
2463
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_prepare_write");
2464
- }
2465
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_save() !== 34302) {
2466
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_save");
2467
- }
2468
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_remove() !== 51385) {
2469
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_remove");
2470
- }
2471
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_acquire_lock() !== 40754) {
2472
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_acquire_lock");
2473
- }
2474
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_release_lock() !== 61506) {
2475
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_release_lock");
2476
- }
2477
- if (nativeModule().uniffi_dbx_tools_databricks_checksum_method_storageadapter_name() !== 45802) {
2478
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_databricks_checksum_method_storageadapter_name");
2479
- }
2480
-
2481
- uniffiCallbackInterfaceStorageAdapter.register();
2482
- }
2483
-
2484
- export default Object.freeze({
2485
- initialize: uniffiEnsureInitialized,
2486
- converters: {
2487
- FfiConverterTypeAccessToken,
2488
- FfiConverterTypeAuthError,
2489
- FfiConverterTypeAuthOptions,
2490
- FfiConverterTypeDatabricksAuthOptions,
2491
- FfiConverterTypeDatabricksAuthStatus,
2492
- FfiConverterTypeFileLayout,
2493
- FfiConverterTypeOAuthGrant,
2494
- FfiConverterTypePersistentAuth,
2495
- FfiConverterTypeProviderAuth,
2496
- FfiConverterTypeProviderOptions,
2497
- FfiConverterTypeStorage,
2498
- FfiConverterTypeStorageAdapter,
2499
- FfiConverterTypeStorageHandle,
2500
- }
2501
- });