@adaptive-ai/sdk 0.1.20 → 0.1.22
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/dist/client/index.d.ts +151 -0
- package/dist/client/index.js +15 -8
- package/dist/server/index.d.ts +20 -631
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare const AuthProvider: {
|
|
|
17
17
|
readonly YAHOO: "YAHOO";
|
|
18
18
|
readonly FIGMA: "FIGMA";
|
|
19
19
|
readonly PLAID: "PLAID";
|
|
20
|
+
readonly WHOOP: "WHOOP";
|
|
20
21
|
};
|
|
21
22
|
export type AuthProvider = (typeof AuthProvider)[keyof typeof AuthProvider];
|
|
22
23
|
export type SignInInput = {
|
|
@@ -76,6 +77,156 @@ export declare function useAuth(input: {
|
|
|
76
77
|
required: false;
|
|
77
78
|
}): AuthenticatedResult | UnauthenticatedResult | LoadingAuthResult;
|
|
78
79
|
export declare function useAuth(): AuthenticatedResult | UnauthenticatedResult | LoadingAuthResult;
|
|
80
|
+
/**
|
|
81
|
+
* Google Drive Picker SDK - provides a native-like API for showing
|
|
82
|
+
* Google Drive file picker from sandboxed applications.
|
|
83
|
+
*
|
|
84
|
+
* Usage:
|
|
85
|
+
* ```ts
|
|
86
|
+
* const picker = new PickerBuilder(connectionToken)
|
|
87
|
+
* .setTitle('Select a file')
|
|
88
|
+
* .addView(ViewId.DOCS)
|
|
89
|
+
* .enableFeature(Feature.MULTISELECT_ENABLED)
|
|
90
|
+
* .setCallback((response) => {
|
|
91
|
+
* if (response.action === 'picked') {
|
|
92
|
+
* console.log('Selected files:', response.docs);
|
|
93
|
+
* }
|
|
94
|
+
* })
|
|
95
|
+
* .build();
|
|
96
|
+
*
|
|
97
|
+
* picker.setVisible(true);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export interface PickerDocument {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
mimeType: string;
|
|
104
|
+
url: string;
|
|
105
|
+
iconUrl?: string;
|
|
106
|
+
description?: string;
|
|
107
|
+
lastEditedUtc?: number;
|
|
108
|
+
sizeBytes?: number;
|
|
109
|
+
parentId?: string;
|
|
110
|
+
serviceId?: string;
|
|
111
|
+
embedUrl?: string;
|
|
112
|
+
isShared?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface PickerResponse {
|
|
115
|
+
action: "picked" | "cancel";
|
|
116
|
+
docs?: PickerDocument[];
|
|
117
|
+
}
|
|
118
|
+
export type PickerBuilderCall = [
|
|
119
|
+
method: string,
|
|
120
|
+
args: unknown[]
|
|
121
|
+
];
|
|
122
|
+
export declare const ViewId: {
|
|
123
|
+
readonly DOCS: "DOCS";
|
|
124
|
+
readonly DOCS_IMAGES: "DOCS_IMAGES";
|
|
125
|
+
readonly DOCS_IMAGES_AND_VIDEOS: "DOCS_IMAGES_AND_VIDEOS";
|
|
126
|
+
readonly DOCS_VIDEOS: "DOCS_VIDEOS";
|
|
127
|
+
readonly DOCUMENTS: "DOCUMENTS";
|
|
128
|
+
readonly DRAWINGS: "DRAWINGS";
|
|
129
|
+
readonly FOLDERS: "FOLDERS";
|
|
130
|
+
readonly FORMS: "FORMS";
|
|
131
|
+
readonly PDFS: "PDFS";
|
|
132
|
+
readonly PHOTOS: "PHOTOS";
|
|
133
|
+
readonly PRESENTATIONS: "PRESENTATIONS";
|
|
134
|
+
readonly RECENTLY_PICKED: "RECENTLY_PICKED";
|
|
135
|
+
readonly SPREADSHEETS: "SPREADSHEETS";
|
|
136
|
+
};
|
|
137
|
+
export type ViewIdType = (typeof ViewId)[keyof typeof ViewId];
|
|
138
|
+
export declare const Feature: {
|
|
139
|
+
readonly MINE_ONLY: "MINE_ONLY";
|
|
140
|
+
readonly MULTISELECT_ENABLED: "MULTISELECT_ENABLED";
|
|
141
|
+
readonly NAV_HIDDEN: "NAV_HIDDEN";
|
|
142
|
+
readonly SIMPLE_UPLOAD_ENABLED: "SIMPLE_UPLOAD_ENABLED";
|
|
143
|
+
readonly SUPPORT_DRIVES: "SUPPORT_DRIVES";
|
|
144
|
+
};
|
|
145
|
+
export type FeatureType = (typeof Feature)[keyof typeof Feature];
|
|
146
|
+
export declare const Action: {
|
|
147
|
+
readonly PICKED: "picked";
|
|
148
|
+
readonly CANCEL: "cancel";
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* View configuration for creating custom DocsView instances
|
|
152
|
+
*/
|
|
153
|
+
export interface DocsViewConfig {
|
|
154
|
+
type: ViewIdType | "DocsUploadView";
|
|
155
|
+
calls?: PickerBuilderCall[];
|
|
156
|
+
}
|
|
157
|
+
declare class DocsViewBuilder {
|
|
158
|
+
private viewType;
|
|
159
|
+
private viewCalls;
|
|
160
|
+
constructor(viewId?: ViewIdType);
|
|
161
|
+
setMimeTypes(mimeTypes: string): this;
|
|
162
|
+
setIncludeFolders(include: boolean): this;
|
|
163
|
+
setSelectFolderEnabled(enabled: boolean): this;
|
|
164
|
+
setParent(folderId: string): this;
|
|
165
|
+
setQuery(query: string): this;
|
|
166
|
+
setOwnedByMe(ownedByMe: boolean): this;
|
|
167
|
+
setStarred(starred: boolean): this;
|
|
168
|
+
/** @internal */
|
|
169
|
+
_toConfig(): DocsViewConfig;
|
|
170
|
+
}
|
|
171
|
+
declare class DocsUploadViewBuilder {
|
|
172
|
+
private viewCalls;
|
|
173
|
+
setParent(folderId: string): this;
|
|
174
|
+
/** @internal */
|
|
175
|
+
_toConfig(): DocsViewConfig;
|
|
176
|
+
}
|
|
177
|
+
declare class Picker {
|
|
178
|
+
private connectionToken;
|
|
179
|
+
private builderCalls;
|
|
180
|
+
private callback?;
|
|
181
|
+
constructor(connectionToken: string, builderCalls: PickerBuilderCall[], callback?: ((data: PickerResponse) => void) | undefined);
|
|
182
|
+
/**
|
|
183
|
+
* Shows or hides the picker.
|
|
184
|
+
* When visible is true, opens a popup with the Google Drive Picker.
|
|
185
|
+
*/
|
|
186
|
+
setVisible(visible: boolean): void;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* PickerBuilder - mimics Google's native PickerBuilder API.
|
|
190
|
+
* Uses a Proxy to capture method calls and replay them in the platform iframe.
|
|
191
|
+
*/
|
|
192
|
+
export declare class PickerBuilder {
|
|
193
|
+
private connectionToken;
|
|
194
|
+
private calls;
|
|
195
|
+
private pickerCallback?;
|
|
196
|
+
constructor(connectionToken: string);
|
|
197
|
+
/** @internal */
|
|
198
|
+
private _build;
|
|
199
|
+
/** Sets the title displayed in the picker dialog */
|
|
200
|
+
setTitle(_title: string): this;
|
|
201
|
+
/** Sets the locale for the picker interface */
|
|
202
|
+
setLocale(_locale: string): this;
|
|
203
|
+
/** Enables a picker feature */
|
|
204
|
+
enableFeature(_feature: FeatureType): this;
|
|
205
|
+
/** Disables a picker feature */
|
|
206
|
+
disableFeature(_feature: FeatureType): this;
|
|
207
|
+
/** Adds a view to the picker (ViewId string, DocsViewBuilder, or DocsUploadViewBuilder) */
|
|
208
|
+
addView(_view: ViewIdType | DocsViewBuilder | DocsUploadViewBuilder): this;
|
|
209
|
+
/** Hides the title bar */
|
|
210
|
+
hideTitleBar(): this;
|
|
211
|
+
/** Sets the picker dialog size */
|
|
212
|
+
setSize(_width: number, _height: number): this;
|
|
213
|
+
/** Sets the maximum number of items that can be selected */
|
|
214
|
+
setMaxItems(_max: number): this;
|
|
215
|
+
/** Sets selectable MIME types */
|
|
216
|
+
setSelectableMimeTypes(_mimeTypes: string): this;
|
|
217
|
+
/** Sets the callback function that receives picker results */
|
|
218
|
+
setCallback(_callback: (data: PickerResponse) => void): this;
|
|
219
|
+
/** Builds the picker instance */
|
|
220
|
+
build(): Picker;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Create a new DocsView for a specific view type
|
|
224
|
+
*/
|
|
225
|
+
export declare function DocsView(viewId?: ViewIdType): DocsViewBuilder;
|
|
226
|
+
/**
|
|
227
|
+
* Create a new DocsUploadView for upload functionality
|
|
228
|
+
*/
|
|
229
|
+
export declare function DocsUploadView(): DocsUploadViewBuilder;
|
|
79
230
|
export declare function connectToRealtimeStore<T extends object>({ channelId, initialData, broadcastOnly, onUpdate, }: {
|
|
80
231
|
channelId: string;
|
|
81
232
|
initialData: T;
|