@superdurable/connector-dropbox 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dex-connector.json +265 -2
- package/dist/{chunk-SWXGPJ62.js → chunk-RMQLFGNQ.js} +422 -21
- package/dist/{connection-CufXPwNo.d.ts → connection-Csm3tCeA.d.ts} +100 -1
- package/dist/index.d.ts +272 -7
- package/dist/index.js +493 -21
- package/dist/mock.d.ts +91 -2
- package/dist/mock.js +85 -1
- package/package.json +2 -2
|
@@ -9,40 +9,54 @@ var ConfigSchema = z.object({
|
|
|
9
9
|
"maxDownloadBytes": z.number().int().optional(),
|
|
10
10
|
"maxUploadBytes": z.number().int().optional()
|
|
11
11
|
});
|
|
12
|
+
var CredentialMaterialError = class extends TypeError {
|
|
13
|
+
constructor(message) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "CredentialMaterialError";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
|
|
19
|
+
"project credential decoding failed",
|
|
20
|
+
"shared project credential decoding failed",
|
|
21
|
+
"project credential decoding failed: this connector version does not support shared credentials"
|
|
22
|
+
]);
|
|
23
|
+
function isCredentialMaterialError(error) {
|
|
24
|
+
return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
|
|
25
|
+
}
|
|
12
26
|
function decodeCredentials(value) {
|
|
13
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new
|
|
27
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
|
|
14
28
|
const fields = value;
|
|
15
29
|
const allowed = /* @__PURE__ */ new Set(["access_token", "oauth_client_id", "oauth_client_secret", "refresh_token"]);
|
|
16
|
-
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new
|
|
17
|
-
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new
|
|
18
|
-
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new
|
|
19
|
-
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new
|
|
20
|
-
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new
|
|
30
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
|
|
31
|
+
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new CredentialMaterialError("credential access_token has an invalid type");
|
|
32
|
+
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new CredentialMaterialError("credential oauth_client_id has an invalid type");
|
|
33
|
+
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new CredentialMaterialError("credential oauth_client_secret has an invalid type");
|
|
34
|
+
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new CredentialMaterialError("credential refresh_token has an invalid type");
|
|
21
35
|
const credentials = {};
|
|
22
|
-
if (!fields["oauth_client_id"]) throw new
|
|
36
|
+
if (!fields["oauth_client_id"]) throw new CredentialMaterialError("credential oauth_client_id is required");
|
|
23
37
|
credentials.oauthClientId = fields["oauth_client_id"] ?? "";
|
|
24
|
-
if (!fields["oauth_client_secret"]) throw new
|
|
38
|
+
if (!fields["oauth_client_secret"]) throw new CredentialMaterialError("credential oauth_client_secret is required");
|
|
25
39
|
credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"] ?? "");
|
|
26
|
-
if (!fields["access_token"]) throw new
|
|
40
|
+
if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
|
|
27
41
|
credentials.accessToken = new SecretString(fields["access_token"] ?? "");
|
|
28
|
-
if (!fields["refresh_token"]) throw new
|
|
42
|
+
if (!fields["refresh_token"]) throw new CredentialMaterialError("credential refresh_token is required");
|
|
29
43
|
credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
|
|
30
44
|
return credentials;
|
|
31
45
|
}
|
|
32
46
|
function decodeSharedCredentials(value) {
|
|
33
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new
|
|
47
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
|
|
34
48
|
const fields = value;
|
|
35
49
|
const allowed = /* @__PURE__ */ new Set(["access_token", "oauth_client_id", "oauth_client_secret", "refresh_token"]);
|
|
36
|
-
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new
|
|
37
|
-
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new
|
|
38
|
-
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new
|
|
39
|
-
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new
|
|
40
|
-
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new
|
|
50
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
|
|
51
|
+
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new CredentialMaterialError("credential access_token has an invalid type");
|
|
52
|
+
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new CredentialMaterialError("credential oauth_client_id has an invalid type");
|
|
53
|
+
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new CredentialMaterialError("credential oauth_client_secret has an invalid type");
|
|
54
|
+
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new CredentialMaterialError("credential refresh_token has an invalid type");
|
|
41
55
|
const credentials = {};
|
|
42
|
-
if (!fields["oauth_client_id"]) throw new
|
|
56
|
+
if (!fields["oauth_client_id"]) throw new CredentialMaterialError("credential oauth_client_id is required");
|
|
43
57
|
credentials.oauthClientId = fields["oauth_client_id"] ?? "";
|
|
44
58
|
credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"] ?? "");
|
|
45
|
-
if (!fields["access_token"]) throw new
|
|
59
|
+
if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
|
|
46
60
|
credentials.accessToken = new SecretString(fields["access_token"] ?? "");
|
|
47
61
|
credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
|
|
48
62
|
return credentials;
|
|
@@ -83,6 +97,32 @@ var UploadFileInputSchema = z.strictObject({
|
|
|
83
97
|
var UploadedFileSchema = z.strictObject({
|
|
84
98
|
"file": EntryMetadataSchema
|
|
85
99
|
});
|
|
100
|
+
var SearchFilesInputSchema = z.strictObject({
|
|
101
|
+
"query": z.string(),
|
|
102
|
+
"path": z.string().optional(),
|
|
103
|
+
"maxResults": z.number().int().optional()
|
|
104
|
+
});
|
|
105
|
+
var SearchFilesPageSchema = z.strictObject({
|
|
106
|
+
"entries": z.array(EntryMetadataSchema).nullable(),
|
|
107
|
+
"cursor": z.string().optional(),
|
|
108
|
+
"hasMore": z.boolean()
|
|
109
|
+
});
|
|
110
|
+
var EnsureFolderInputSchema = z.strictObject({
|
|
111
|
+
"path": z.string()
|
|
112
|
+
});
|
|
113
|
+
var EnsuredFolderSchema = z.strictObject({
|
|
114
|
+
"path": z.string()
|
|
115
|
+
});
|
|
116
|
+
var DeletePathInputSchema = z.strictObject({
|
|
117
|
+
"path": z.string()
|
|
118
|
+
});
|
|
119
|
+
var DeletedPathSchema = z.strictObject({
|
|
120
|
+
"path": z.string()
|
|
121
|
+
});
|
|
122
|
+
var TransferPathInputSchema = z.strictObject({
|
|
123
|
+
"fromPath": z.string(),
|
|
124
|
+
"toPath": z.string()
|
|
125
|
+
});
|
|
86
126
|
|
|
87
127
|
// src/generated/definitions.ts
|
|
88
128
|
var ConnectorID = "dropbox";
|
|
@@ -201,12 +241,124 @@ var UploadFileDefinition = {
|
|
|
201
241
|
branches: [
|
|
202
242
|
{ id: "uploaded", description: "Dropbox stored the replacement file content." },
|
|
203
243
|
{ id: "providerRejected", description: "Dropbox conclusively rejected the upload.", optional: true },
|
|
204
|
-
{ id: "invalidResponse", description: "
|
|
244
|
+
{ id: "invalidResponse", description: "Retained for compatibility and no longer selected: malformed or oversized upload metadata now retries the overwrite.", optional: true },
|
|
205
245
|
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
206
246
|
],
|
|
207
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
247
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
248
|
+
repeatOnUnknown: "safe"
|
|
208
249
|
};
|
|
209
250
|
var UploadFileMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
251
|
+
var SearchFilesBranch = {
|
|
252
|
+
Found: "found",
|
|
253
|
+
ProviderRejected: "providerRejected",
|
|
254
|
+
InvalidResponse: "invalidResponse",
|
|
255
|
+
Defect: "defect"
|
|
256
|
+
};
|
|
257
|
+
var SearchFilesBranchFound = SearchFilesBranch.Found;
|
|
258
|
+
var SearchFilesBranchProviderRejected = SearchFilesBranch.ProviderRejected;
|
|
259
|
+
var SearchFilesBranchInvalidResponse = SearchFilesBranch.InvalidResponse;
|
|
260
|
+
var SearchFilesBranchDefect = SearchFilesBranch.Defect;
|
|
261
|
+
var SearchFilesDefinition = {
|
|
262
|
+
operation: { connectorId: ConnectorID, operationId: "searchFiles" },
|
|
263
|
+
branches: [
|
|
264
|
+
{ id: "found", description: "Dropbox returned a search page." },
|
|
265
|
+
{ id: "providerRejected", description: "Dropbox conclusively rejected the search.", optional: true },
|
|
266
|
+
{ id: "invalidResponse", description: "Dropbox returned malformed or oversized search results.", optional: true },
|
|
267
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
268
|
+
],
|
|
269
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
270
|
+
};
|
|
271
|
+
var SearchFilesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
272
|
+
var EnsureFolderBranch = {
|
|
273
|
+
Ensured: "ensured",
|
|
274
|
+
ProviderRejected: "providerRejected",
|
|
275
|
+
InvalidResponse: "invalidResponse",
|
|
276
|
+
Defect: "defect"
|
|
277
|
+
};
|
|
278
|
+
var EnsureFolderBranchEnsured = EnsureFolderBranch.Ensured;
|
|
279
|
+
var EnsureFolderBranchProviderRejected = EnsureFolderBranch.ProviderRejected;
|
|
280
|
+
var EnsureFolderBranchInvalidResponse = EnsureFolderBranch.InvalidResponse;
|
|
281
|
+
var EnsureFolderBranchDefect = EnsureFolderBranch.Defect;
|
|
282
|
+
var EnsureFolderDefinition = {
|
|
283
|
+
operation: { connectorId: ConnectorID, operationId: "ensureFolder" },
|
|
284
|
+
branches: [
|
|
285
|
+
{ id: "ensured", description: "Dropbox created the folder or confirmed it already exists." },
|
|
286
|
+
{ id: "providerRejected", description: "Dropbox conclusively rejected the folder request.", optional: true },
|
|
287
|
+
{ id: "invalidResponse", description: "Dropbox returned malformed or oversized folder metadata.", optional: true },
|
|
288
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
289
|
+
],
|
|
290
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
291
|
+
repeatOnUnknown: "safe"
|
|
292
|
+
};
|
|
293
|
+
var EnsureFolderMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
294
|
+
var DeletePathBranch = {
|
|
295
|
+
Deleted: "deleted",
|
|
296
|
+
ProviderRejected: "providerRejected",
|
|
297
|
+
InvalidResponse: "invalidResponse",
|
|
298
|
+
Defect: "defect"
|
|
299
|
+
};
|
|
300
|
+
var DeletePathBranchDeleted = DeletePathBranch.Deleted;
|
|
301
|
+
var DeletePathBranchProviderRejected = DeletePathBranch.ProviderRejected;
|
|
302
|
+
var DeletePathBranchInvalidResponse = DeletePathBranch.InvalidResponse;
|
|
303
|
+
var DeletePathBranchDefect = DeletePathBranch.Defect;
|
|
304
|
+
var DeletePathDefinition = {
|
|
305
|
+
operation: { connectorId: ConnectorID, operationId: "deletePath" },
|
|
306
|
+
branches: [
|
|
307
|
+
{ id: "deleted", description: "Dropbox deleted the path or confirmed it was already absent." },
|
|
308
|
+
{ id: "providerRejected", description: "Dropbox conclusively rejected the deletion.", optional: true },
|
|
309
|
+
{ id: "invalidResponse", description: "Dropbox returned malformed or oversized deletion metadata.", optional: true },
|
|
310
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
311
|
+
],
|
|
312
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
313
|
+
repeatOnUnknown: "safe"
|
|
314
|
+
};
|
|
315
|
+
var DeletePathMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
316
|
+
var CopyPathBranch = {
|
|
317
|
+
Copied: "copied",
|
|
318
|
+
ProviderRejected: "providerRejected",
|
|
319
|
+
Uncertain: "uncertain",
|
|
320
|
+
Defect: "defect"
|
|
321
|
+
};
|
|
322
|
+
var CopyPathBranchCopied = CopyPathBranch.Copied;
|
|
323
|
+
var CopyPathBranchProviderRejected = CopyPathBranch.ProviderRejected;
|
|
324
|
+
var CopyPathBranchUncertain = CopyPathBranch.Uncertain;
|
|
325
|
+
var CopyPathBranchDefect = CopyPathBranch.Defect;
|
|
326
|
+
var CopyPathDefinition = {
|
|
327
|
+
operation: { connectorId: ConnectorID, operationId: "copyPath" },
|
|
328
|
+
branches: [
|
|
329
|
+
{ id: "copied", description: "Dropbox confirmed the destination entry." },
|
|
330
|
+
{ id: "providerRejected", description: "Dropbox conclusively rejected the copy.", optional: true },
|
|
331
|
+
{ id: "uncertain", description: "A copy may have completed but its destination cannot be attributed to this call.", optional: true },
|
|
332
|
+
{ id: "defect", description: "Local paths, credentials, or dispatch checkpoint are invalid.", optional: true }
|
|
333
|
+
],
|
|
334
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
|
|
335
|
+
repeatOnUnknown: "limited",
|
|
336
|
+
maxSends: 3
|
|
337
|
+
};
|
|
338
|
+
var CopyPathMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
339
|
+
var MovePathBranch = {
|
|
340
|
+
Moved: "moved",
|
|
341
|
+
ProviderRejected: "providerRejected",
|
|
342
|
+
Uncertain: "uncertain",
|
|
343
|
+
Defect: "defect"
|
|
344
|
+
};
|
|
345
|
+
var MovePathBranchMoved = MovePathBranch.Moved;
|
|
346
|
+
var MovePathBranchProviderRejected = MovePathBranch.ProviderRejected;
|
|
347
|
+
var MovePathBranchUncertain = MovePathBranch.Uncertain;
|
|
348
|
+
var MovePathBranchDefect = MovePathBranch.Defect;
|
|
349
|
+
var MovePathDefinition = {
|
|
350
|
+
operation: { connectorId: ConnectorID, operationId: "movePath" },
|
|
351
|
+
branches: [
|
|
352
|
+
{ id: "moved", description: "Dropbox confirmed the destination entry." },
|
|
353
|
+
{ id: "providerRejected", description: "Dropbox conclusively rejected the move.", optional: true },
|
|
354
|
+
{ id: "uncertain", description: "A move may have completed but its destination cannot be attributed to this call.", optional: true },
|
|
355
|
+
{ id: "defect", description: "Local paths, credentials, or dispatch checkpoint are invalid.", optional: true }
|
|
356
|
+
],
|
|
357
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
|
|
358
|
+
repeatOnUnknown: "limited",
|
|
359
|
+
maxSends: 3
|
|
360
|
+
};
|
|
361
|
+
var MovePathMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
210
362
|
|
|
211
363
|
// src/generated/connection.ts
|
|
212
364
|
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
@@ -236,7 +388,7 @@ function newProjectCredentialProvider(project, connectionName, decode, encode, d
|
|
|
236
388
|
}
|
|
237
389
|
|
|
238
390
|
// src/generated/mock.ts
|
|
239
|
-
import { branchCase, retryCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
391
|
+
import { branchCase, retryCase, uncertainCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
240
392
|
var emptyListFolderInput = ListFolderInputSchema.parse({
|
|
241
393
|
"limit": 0
|
|
242
394
|
});
|
|
@@ -272,6 +424,29 @@ var emptyUploadFileInput = UploadFileInputSchema.parse({
|
|
|
272
424
|
var emptyUploadedFile = UploadedFileSchema.parse({
|
|
273
425
|
"file": emptyEntryMetadata
|
|
274
426
|
});
|
|
427
|
+
var emptySearchFilesInput = SearchFilesInputSchema.parse({
|
|
428
|
+
"query": ""
|
|
429
|
+
});
|
|
430
|
+
var emptySearchFilesPage = SearchFilesPageSchema.parse({
|
|
431
|
+
"entries": [],
|
|
432
|
+
"hasMore": false
|
|
433
|
+
});
|
|
434
|
+
var emptyEnsureFolderInput = EnsureFolderInputSchema.parse({
|
|
435
|
+
"path": ""
|
|
436
|
+
});
|
|
437
|
+
var emptyEnsuredFolder = EnsuredFolderSchema.parse({
|
|
438
|
+
"path": ""
|
|
439
|
+
});
|
|
440
|
+
var emptyDeletePathInput = DeletePathInputSchema.parse({
|
|
441
|
+
"path": ""
|
|
442
|
+
});
|
|
443
|
+
var emptyDeletedPath = DeletedPathSchema.parse({
|
|
444
|
+
"path": ""
|
|
445
|
+
});
|
|
446
|
+
var emptyTransferPathInput = TransferPathInputSchema.parse({
|
|
447
|
+
"fromPath": "",
|
|
448
|
+
"toPath": ""
|
|
449
|
+
});
|
|
275
450
|
function listFolderListed(value, failure) {
|
|
276
451
|
return branchCase("listed", value, failure);
|
|
277
452
|
}
|
|
@@ -397,12 +572,127 @@ function uploadFileUploadedDefault() {
|
|
|
397
572
|
function uploadFileDefault() {
|
|
398
573
|
return uploadFileUploadedDefault();
|
|
399
574
|
}
|
|
575
|
+
function searchFilesFound(value, failure) {
|
|
576
|
+
return branchCase("found", value, failure);
|
|
577
|
+
}
|
|
578
|
+
function searchFilesProviderRejected(value, failure) {
|
|
579
|
+
return branchCase("providerRejected", value, failure);
|
|
580
|
+
}
|
|
581
|
+
function searchFilesInvalidResponse(value, failure) {
|
|
582
|
+
return branchCase("invalidResponse", value, failure);
|
|
583
|
+
}
|
|
584
|
+
function searchFilesDefect(value, failure) {
|
|
585
|
+
return branchCase("defect", value, failure);
|
|
586
|
+
}
|
|
587
|
+
function searchFilesRetry(failure, retryAfterMs = 0) {
|
|
588
|
+
return retryCase(failure, retryAfterMs);
|
|
589
|
+
}
|
|
590
|
+
function searchFilesFoundDefault() {
|
|
591
|
+
const value = SearchFilesPageSchema.parse({ "entries": [{ "id": "id:example", "kind": "file", "name": "example.txt", "pathDisplay": "/example.txt" }], "hasMore": false });
|
|
592
|
+
return branchCase("found", value);
|
|
593
|
+
}
|
|
594
|
+
function searchFilesDefault() {
|
|
595
|
+
return searchFilesFoundDefault();
|
|
596
|
+
}
|
|
597
|
+
function ensureFolderEnsured(value, failure) {
|
|
598
|
+
return branchCase("ensured", value, failure);
|
|
599
|
+
}
|
|
600
|
+
function ensureFolderProviderRejected(value, failure) {
|
|
601
|
+
return branchCase("providerRejected", value, failure);
|
|
602
|
+
}
|
|
603
|
+
function ensureFolderInvalidResponse(value, failure) {
|
|
604
|
+
return branchCase("invalidResponse", value, failure);
|
|
605
|
+
}
|
|
606
|
+
function ensureFolderDefect(value, failure) {
|
|
607
|
+
return branchCase("defect", value, failure);
|
|
608
|
+
}
|
|
609
|
+
function ensureFolderRetry(failure, retryAfterMs = 0) {
|
|
610
|
+
return retryCase(failure, retryAfterMs);
|
|
611
|
+
}
|
|
612
|
+
function ensureFolderEnsuredDefault() {
|
|
613
|
+
const value = EnsuredFolderSchema.parse({ "path": "/example" });
|
|
614
|
+
return branchCase("ensured", value);
|
|
615
|
+
}
|
|
616
|
+
function ensureFolderDefault() {
|
|
617
|
+
return ensureFolderEnsuredDefault();
|
|
618
|
+
}
|
|
619
|
+
function deletePathDeleted(value, failure) {
|
|
620
|
+
return branchCase("deleted", value, failure);
|
|
621
|
+
}
|
|
622
|
+
function deletePathProviderRejected(value, failure) {
|
|
623
|
+
return branchCase("providerRejected", value, failure);
|
|
624
|
+
}
|
|
625
|
+
function deletePathInvalidResponse(value, failure) {
|
|
626
|
+
return branchCase("invalidResponse", value, failure);
|
|
627
|
+
}
|
|
628
|
+
function deletePathDefect(value, failure) {
|
|
629
|
+
return branchCase("defect", value, failure);
|
|
630
|
+
}
|
|
631
|
+
function deletePathRetry(failure, retryAfterMs = 0) {
|
|
632
|
+
return retryCase(failure, retryAfterMs);
|
|
633
|
+
}
|
|
634
|
+
function deletePathDeletedDefault() {
|
|
635
|
+
const value = DeletedPathSchema.parse({ "path": "/example.txt" });
|
|
636
|
+
return branchCase("deleted", value);
|
|
637
|
+
}
|
|
638
|
+
function deletePathDefault() {
|
|
639
|
+
return deletePathDeletedDefault();
|
|
640
|
+
}
|
|
641
|
+
function copyPathCopied(value, failure) {
|
|
642
|
+
return branchCase("copied", value, failure);
|
|
643
|
+
}
|
|
644
|
+
function copyPathProviderRejected(value, failure) {
|
|
645
|
+
return branchCase("providerRejected", value, failure);
|
|
646
|
+
}
|
|
647
|
+
function copyPathDefect(value, failure) {
|
|
648
|
+
return branchCase("defect", value, failure);
|
|
649
|
+
}
|
|
650
|
+
function copyPathRetry(failure, retryAfterMs = 0) {
|
|
651
|
+
return retryCase(failure, retryAfterMs);
|
|
652
|
+
}
|
|
653
|
+
function copyPathUncertain(value, failure) {
|
|
654
|
+
return uncertainCase(value, failure);
|
|
655
|
+
}
|
|
656
|
+
function copyPathCopiedDefault() {
|
|
657
|
+
const value = EntryMetadataSchema.parse({ "id": "id:copy", "kind": "file", "name": "copy.txt", "pathDisplay": "/copy.txt" });
|
|
658
|
+
return branchCase("copied", value);
|
|
659
|
+
}
|
|
660
|
+
function copyPathDefault() {
|
|
661
|
+
return copyPathCopiedDefault();
|
|
662
|
+
}
|
|
663
|
+
function movePathMoved(value, failure) {
|
|
664
|
+
return branchCase("moved", value, failure);
|
|
665
|
+
}
|
|
666
|
+
function movePathProviderRejected(value, failure) {
|
|
667
|
+
return branchCase("providerRejected", value, failure);
|
|
668
|
+
}
|
|
669
|
+
function movePathDefect(value, failure) {
|
|
670
|
+
return branchCase("defect", value, failure);
|
|
671
|
+
}
|
|
672
|
+
function movePathRetry(failure, retryAfterMs = 0) {
|
|
673
|
+
return retryCase(failure, retryAfterMs);
|
|
674
|
+
}
|
|
675
|
+
function movePathUncertain(value, failure) {
|
|
676
|
+
return uncertainCase(value, failure);
|
|
677
|
+
}
|
|
678
|
+
function movePathMovedDefault() {
|
|
679
|
+
const value = EntryMetadataSchema.parse({ "id": "id:example", "kind": "file", "name": "moved.txt", "pathDisplay": "/moved.txt" });
|
|
680
|
+
return branchCase("moved", value);
|
|
681
|
+
}
|
|
682
|
+
function movePathDefault() {
|
|
683
|
+
return movePathMovedDefault();
|
|
684
|
+
}
|
|
400
685
|
var GeneratedMock = class {
|
|
401
686
|
#listFolder;
|
|
402
687
|
#getMetadata;
|
|
403
688
|
#continueFolder;
|
|
404
689
|
#downloadFile;
|
|
405
690
|
#uploadFile;
|
|
691
|
+
#searchFiles;
|
|
692
|
+
#ensureFolder;
|
|
693
|
+
#deletePath;
|
|
694
|
+
#copyPath;
|
|
695
|
+
#movePath;
|
|
406
696
|
#connection;
|
|
407
697
|
constructor(connectionName) {
|
|
408
698
|
this.#listFolder = newQuery(ListFolderDefinition).default(listFolderDefault());
|
|
@@ -410,6 +700,11 @@ var GeneratedMock = class {
|
|
|
410
700
|
this.#continueFolder = newQuery(ContinueFolderDefinition).default(continueFolderDefault());
|
|
411
701
|
this.#downloadFile = newQuery(DownloadFileDefinition).default(downloadFileDefault());
|
|
412
702
|
this.#uploadFile = newMutation(UploadFileDefinition).default(uploadFileDefault());
|
|
703
|
+
this.#searchFiles = newQuery(SearchFilesDefinition).default(searchFilesDefault());
|
|
704
|
+
this.#ensureFolder = newMutation(EnsureFolderDefinition).default(ensureFolderDefault());
|
|
705
|
+
this.#deletePath = newMutation(DeletePathDefinition).default(deletePathDefault());
|
|
706
|
+
this.#copyPath = newMutation(CopyPathDefinition).default(copyPathDefault());
|
|
707
|
+
this.#movePath = newMutation(MovePathDefinition).default(movePathDefault());
|
|
413
708
|
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
414
709
|
}
|
|
415
710
|
connection() {
|
|
@@ -430,17 +725,39 @@ var GeneratedMock = class {
|
|
|
430
725
|
uploadFile() {
|
|
431
726
|
return this.#uploadFile;
|
|
432
727
|
}
|
|
728
|
+
searchFiles() {
|
|
729
|
+
return this.#searchFiles;
|
|
730
|
+
}
|
|
731
|
+
ensureFolder() {
|
|
732
|
+
return this.#ensureFolder;
|
|
733
|
+
}
|
|
734
|
+
deletePath() {
|
|
735
|
+
return this.#deletePath;
|
|
736
|
+
}
|
|
737
|
+
copyPath() {
|
|
738
|
+
return this.#copyPath;
|
|
739
|
+
}
|
|
740
|
+
movePath() {
|
|
741
|
+
return this.#movePath;
|
|
742
|
+
}
|
|
433
743
|
assertNoFailures() {
|
|
434
744
|
this.#listFolder.assertNoFailures();
|
|
435
745
|
this.#getMetadata.assertNoFailures();
|
|
436
746
|
this.#continueFolder.assertNoFailures();
|
|
437
747
|
this.#downloadFile.assertNoFailures();
|
|
438
748
|
this.#uploadFile.assertNoFailures();
|
|
749
|
+
this.#searchFiles.assertNoFailures();
|
|
750
|
+
this.#ensureFolder.assertNoFailures();
|
|
751
|
+
this.#deletePath.assertNoFailures();
|
|
752
|
+
this.#copyPath.assertNoFailures();
|
|
753
|
+
this.#movePath.assertNoFailures();
|
|
439
754
|
}
|
|
440
755
|
};
|
|
441
756
|
|
|
442
757
|
export {
|
|
443
758
|
ConfigSchema,
|
|
759
|
+
CredentialMaterialError,
|
|
760
|
+
isCredentialMaterialError,
|
|
444
761
|
decodeCredentials,
|
|
445
762
|
decodeSharedCredentials,
|
|
446
763
|
ListFolderInputSchema,
|
|
@@ -452,6 +769,13 @@ export {
|
|
|
452
769
|
DownloadedFileSchema,
|
|
453
770
|
UploadFileInputSchema,
|
|
454
771
|
UploadedFileSchema,
|
|
772
|
+
SearchFilesInputSchema,
|
|
773
|
+
SearchFilesPageSchema,
|
|
774
|
+
EnsureFolderInputSchema,
|
|
775
|
+
EnsuredFolderSchema,
|
|
776
|
+
DeletePathInputSchema,
|
|
777
|
+
DeletedPathSchema,
|
|
778
|
+
TransferPathInputSchema,
|
|
455
779
|
ConnectorID,
|
|
456
780
|
ProviderID,
|
|
457
781
|
ListFolderBranch,
|
|
@@ -494,6 +818,41 @@ export {
|
|
|
494
818
|
UploadFileBranchDefect,
|
|
495
819
|
UploadFileDefinition,
|
|
496
820
|
UploadFileMetadata,
|
|
821
|
+
SearchFilesBranch,
|
|
822
|
+
SearchFilesBranchFound,
|
|
823
|
+
SearchFilesBranchProviderRejected,
|
|
824
|
+
SearchFilesBranchInvalidResponse,
|
|
825
|
+
SearchFilesBranchDefect,
|
|
826
|
+
SearchFilesDefinition,
|
|
827
|
+
SearchFilesMetadata,
|
|
828
|
+
EnsureFolderBranch,
|
|
829
|
+
EnsureFolderBranchEnsured,
|
|
830
|
+
EnsureFolderBranchProviderRejected,
|
|
831
|
+
EnsureFolderBranchInvalidResponse,
|
|
832
|
+
EnsureFolderBranchDefect,
|
|
833
|
+
EnsureFolderDefinition,
|
|
834
|
+
EnsureFolderMetadata,
|
|
835
|
+
DeletePathBranch,
|
|
836
|
+
DeletePathBranchDeleted,
|
|
837
|
+
DeletePathBranchProviderRejected,
|
|
838
|
+
DeletePathBranchInvalidResponse,
|
|
839
|
+
DeletePathBranchDefect,
|
|
840
|
+
DeletePathDefinition,
|
|
841
|
+
DeletePathMetadata,
|
|
842
|
+
CopyPathBranch,
|
|
843
|
+
CopyPathBranchCopied,
|
|
844
|
+
CopyPathBranchProviderRejected,
|
|
845
|
+
CopyPathBranchUncertain,
|
|
846
|
+
CopyPathBranchDefect,
|
|
847
|
+
CopyPathDefinition,
|
|
848
|
+
CopyPathMetadata,
|
|
849
|
+
MovePathBranch,
|
|
850
|
+
MovePathBranchMoved,
|
|
851
|
+
MovePathBranchProviderRejected,
|
|
852
|
+
MovePathBranchUncertain,
|
|
853
|
+
MovePathBranchDefect,
|
|
854
|
+
MovePathDefinition,
|
|
855
|
+
MovePathMetadata,
|
|
497
856
|
Connection,
|
|
498
857
|
newConnection,
|
|
499
858
|
newConnectionWithOperations,
|
|
@@ -507,6 +866,13 @@ export {
|
|
|
507
866
|
emptyDownloadedFile,
|
|
508
867
|
emptyUploadFileInput,
|
|
509
868
|
emptyUploadedFile,
|
|
869
|
+
emptySearchFilesInput,
|
|
870
|
+
emptySearchFilesPage,
|
|
871
|
+
emptyEnsureFolderInput,
|
|
872
|
+
emptyEnsuredFolder,
|
|
873
|
+
emptyDeletePathInput,
|
|
874
|
+
emptyDeletedPath,
|
|
875
|
+
emptyTransferPathInput,
|
|
510
876
|
listFolderListed,
|
|
511
877
|
listFolderNotFound,
|
|
512
878
|
listFolderProviderRejected,
|
|
@@ -547,5 +913,40 @@ export {
|
|
|
547
913
|
uploadFileRetry,
|
|
548
914
|
uploadFileUploadedDefault,
|
|
549
915
|
uploadFileDefault,
|
|
916
|
+
searchFilesFound,
|
|
917
|
+
searchFilesProviderRejected,
|
|
918
|
+
searchFilesInvalidResponse,
|
|
919
|
+
searchFilesDefect,
|
|
920
|
+
searchFilesRetry,
|
|
921
|
+
searchFilesFoundDefault,
|
|
922
|
+
searchFilesDefault,
|
|
923
|
+
ensureFolderEnsured,
|
|
924
|
+
ensureFolderProviderRejected,
|
|
925
|
+
ensureFolderInvalidResponse,
|
|
926
|
+
ensureFolderDefect,
|
|
927
|
+
ensureFolderRetry,
|
|
928
|
+
ensureFolderEnsuredDefault,
|
|
929
|
+
ensureFolderDefault,
|
|
930
|
+
deletePathDeleted,
|
|
931
|
+
deletePathProviderRejected,
|
|
932
|
+
deletePathInvalidResponse,
|
|
933
|
+
deletePathDefect,
|
|
934
|
+
deletePathRetry,
|
|
935
|
+
deletePathDeletedDefault,
|
|
936
|
+
deletePathDefault,
|
|
937
|
+
copyPathCopied,
|
|
938
|
+
copyPathProviderRejected,
|
|
939
|
+
copyPathDefect,
|
|
940
|
+
copyPathRetry,
|
|
941
|
+
copyPathUncertain,
|
|
942
|
+
copyPathCopiedDefault,
|
|
943
|
+
copyPathDefault,
|
|
944
|
+
movePathMoved,
|
|
945
|
+
movePathProviderRejected,
|
|
946
|
+
movePathDefect,
|
|
947
|
+
movePathRetry,
|
|
948
|
+
movePathUncertain,
|
|
949
|
+
movePathMovedDefault,
|
|
950
|
+
movePathDefault,
|
|
550
951
|
GeneratedMock
|
|
551
952
|
};
|