@credal/sdk 0.1.3 → 0.1.6
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/cjs/Client.d.ts +2 -5
- package/dist/cjs/Client.js +6 -11
- package/dist/cjs/api/resources/{permissionsService/types/Group.d.ts → common/types/CustomMetadataValue.d.ts} +1 -4
- package/dist/cjs/api/resources/common/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/common/types/index.js +1 -0
- package/dist/cjs/api/resources/copilots/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/copilots/client/Client.js +9 -9
- package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +3 -3
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +5 -2
- package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/documentCollections/client/Client.js +7 -7
- package/dist/cjs/api/resources/index.d.ts +0 -3
- package/dist/cjs/api/resources/index.js +1 -4
- package/dist/cjs/api/resources/search/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/search/client/Client.js +1 -1
- package/dist/cjs/api/resources/users/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/users/client/Client.js +1 -1
- package/dist/cjs/core/auth/index.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.js +2 -2
- package/dist/cjs/core/fetcher/index.d.ts +5 -5
- package/dist/cjs/core/fetcher/index.js +5 -5
- package/dist/cjs/core/fetcher/requestWithRetries.js +34 -2
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +2 -5
- package/dist/esm/Client.mjs +2 -7
- package/dist/esm/api/resources/{permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.mjs → common/types/CustomMetadataValue.d.mts} +1 -1
- package/dist/esm/api/resources/common/types/index.d.mts +1 -0
- package/dist/esm/api/resources/common/types/index.mjs +1 -0
- package/dist/esm/api/resources/copilots/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/copilots/client/Client.mjs +9 -9
- package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +3 -3
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +5 -2
- package/dist/esm/api/resources/documentCollections/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +7 -7
- package/dist/esm/api/resources/index.d.mts +0 -3
- package/dist/esm/api/resources/index.mjs +0 -3
- package/dist/esm/api/resources/search/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/search/client/Client.mjs +1 -1
- package/dist/esm/api/resources/users/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/users/client/Client.mjs +1 -1
- package/dist/esm/core/auth/index.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -2
- package/dist/esm/core/fetcher/index.d.mts +5 -5
- package/dist/esm/core/fetcher/index.mjs +2 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +34 -2
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +0 -213
- package/dist/cjs/api/resources/permissionsService/client/Client.d.ts +0 -86
- package/dist/cjs/api/resources/permissionsService/client/Client.js +0 -260
- package/dist/cjs/api/resources/permissionsService/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/permissionsService/client/index.js +0 -17
- package/dist/cjs/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +0 -26
- package/dist/cjs/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +0 -23
- package/dist/cjs/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +0 -5
- package/dist/cjs/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +0 -20
- package/dist/cjs/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +0 -5
- package/dist/cjs/api/resources/permissionsService/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/permissionsService/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/permissionsService/index.d.ts +0 -2
- package/dist/cjs/api/resources/permissionsService/index.js +0 -18
- package/dist/cjs/api/resources/permissionsService/types/Action.d.ts +0 -7
- package/dist/cjs/api/resources/permissionsService/types/Action.js +0 -9
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResource.d.ts +0 -8
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResource.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +0 -5
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResourceListPage.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +0 -5
- package/dist/cjs/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.d.ts +0 -6
- package/dist/cjs/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/Group.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/Principal.d.ts +0 -13
- package/dist/cjs/api/resources/permissionsService/types/Principal.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/PrincipalListPage.d.ts +0 -8
- package/dist/cjs/api/resources/permissionsService/types/PrincipalListPage.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/ResourceAuthorizationResult.d.ts +0 -9
- package/dist/cjs/api/resources/permissionsService/types/ResourceAuthorizationResult.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/User.d.ts +0 -8
- package/dist/cjs/api/resources/permissionsService/types/User.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/index.d.ts +0 -10
- package/dist/cjs/api/resources/permissionsService/types/index.js +0 -26
- package/dist/esm/api/resources/permissionsService/client/Client.d.mts +0 -86
- package/dist/esm/api/resources/permissionsService/client/Client.mjs +0 -223
- package/dist/esm/api/resources/permissionsService/client/index.d.mts +0 -2
- package/dist/esm/api/resources/permissionsService/client/index.mjs +0 -1
- package/dist/esm/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.mts +0 -26
- package/dist/esm/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.mts +0 -23
- package/dist/esm/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.mts +0 -20
- package/dist/esm/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/permissionsService/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/permissionsService/index.d.mts +0 -2
- package/dist/esm/api/resources/permissionsService/index.mjs +0 -2
- package/dist/esm/api/resources/permissionsService/types/Action.d.mts +0 -7
- package/dist/esm/api/resources/permissionsService/types/Action.mjs +0 -6
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResource.d.mts +0 -8
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResource.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResourceListPage.d.mts +0 -5
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResourceListPage.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.mts +0 -5
- package/dist/esm/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.d.mts +0 -6
- package/dist/esm/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/Group.d.mts +0 -7
- package/dist/esm/api/resources/permissionsService/types/Group.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/Principal.d.mts +0 -13
- package/dist/esm/api/resources/permissionsService/types/Principal.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/PrincipalListPage.d.mts +0 -8
- package/dist/esm/api/resources/permissionsService/types/PrincipalListPage.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/ResourceAuthorizationResult.d.mts +0 -9
- package/dist/esm/api/resources/permissionsService/types/ResourceAuthorizationResult.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/User.d.mts +0 -8
- package/dist/esm/api/resources/permissionsService/types/User.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/index.d.mts +0 -10
- package/dist/esm/api/resources/permissionsService/types/index.mjs +0 -10
- /package/dist/cjs/api/resources/{permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js → common/types/CustomMetadataValue.js} +0 -0
- /package/dist/esm/api/resources/{permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.mjs → common/types/CustomMetadataValue.mjs} +0 -0
package/reference.md
CHANGED
|
@@ -1326,219 +1326,6 @@ await client.documentCollections.updateMongoCollectionSync({
|
|
|
1326
1326
|
</dl>
|
|
1327
1327
|
</details>
|
|
1328
1328
|
|
|
1329
|
-
## PermissionsService
|
|
1330
|
-
|
|
1331
|
-
<details><summary><code>client.permissionsService.<a href="/src/api/resources/permissionsService/client/Client.ts">checkResourceAuthorizationForUser</a>({ ...params }) -> Credal.CheckResourceAuthorizationResponse</code></summary>
|
|
1332
|
-
<dl>
|
|
1333
|
-
<dd>
|
|
1334
|
-
|
|
1335
|
-
#### 📝 Description
|
|
1336
|
-
|
|
1337
|
-
<dl>
|
|
1338
|
-
<dd>
|
|
1339
|
-
|
|
1340
|
-
<dl>
|
|
1341
|
-
<dd>
|
|
1342
|
-
|
|
1343
|
-
Admin endpoint to check whether the specified user is authorized to read the specified resource.
|
|
1344
|
-
|
|
1345
|
-
</dd>
|
|
1346
|
-
</dl>
|
|
1347
|
-
</dd>
|
|
1348
|
-
</dl>
|
|
1349
|
-
|
|
1350
|
-
#### 🔌 Usage
|
|
1351
|
-
|
|
1352
|
-
<dl>
|
|
1353
|
-
<dd>
|
|
1354
|
-
|
|
1355
|
-
<dl>
|
|
1356
|
-
<dd>
|
|
1357
|
-
|
|
1358
|
-
```typescript
|
|
1359
|
-
await client.permissionsService.checkResourceAuthorizationForUser({
|
|
1360
|
-
resourceIdentifier: {
|
|
1361
|
-
type: "external-resource-id",
|
|
1362
|
-
externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
1363
|
-
resourceType: "GOOGLE_DRIVE_ITEM",
|
|
1364
|
-
},
|
|
1365
|
-
userEmail: "john.smith@foo.com",
|
|
1366
|
-
});
|
|
1367
|
-
```
|
|
1368
|
-
|
|
1369
|
-
</dd>
|
|
1370
|
-
</dl>
|
|
1371
|
-
</dd>
|
|
1372
|
-
</dl>
|
|
1373
|
-
|
|
1374
|
-
#### ⚙️ Parameters
|
|
1375
|
-
|
|
1376
|
-
<dl>
|
|
1377
|
-
<dd>
|
|
1378
|
-
|
|
1379
|
-
<dl>
|
|
1380
|
-
<dd>
|
|
1381
|
-
|
|
1382
|
-
**request:** `Credal.CheckResourceAuthorizationForUserRequest`
|
|
1383
|
-
|
|
1384
|
-
</dd>
|
|
1385
|
-
</dl>
|
|
1386
|
-
|
|
1387
|
-
<dl>
|
|
1388
|
-
<dd>
|
|
1389
|
-
|
|
1390
|
-
**requestOptions:** `PermissionsService.RequestOptions`
|
|
1391
|
-
|
|
1392
|
-
</dd>
|
|
1393
|
-
</dl>
|
|
1394
|
-
</dd>
|
|
1395
|
-
</dl>
|
|
1396
|
-
|
|
1397
|
-
</dd>
|
|
1398
|
-
</dl>
|
|
1399
|
-
</details>
|
|
1400
|
-
|
|
1401
|
-
<details><summary><code>client.permissionsService.<a href="/src/api/resources/permissionsService/client/Client.ts">checkBulkResourcesAuthorizationForUser</a>({ ...params }) -> Credal.CheckBulkResourcesAuthorizationResponse</code></summary>
|
|
1402
|
-
<dl>
|
|
1403
|
-
<dd>
|
|
1404
|
-
|
|
1405
|
-
#### 📝 Description
|
|
1406
|
-
|
|
1407
|
-
<dl>
|
|
1408
|
-
<dd>
|
|
1409
|
-
|
|
1410
|
-
<dl>
|
|
1411
|
-
<dd>
|
|
1412
|
-
|
|
1413
|
-
Admin endpoint to check whether the specified user is authorized to read the specified set of resources.
|
|
1414
|
-
|
|
1415
|
-
</dd>
|
|
1416
|
-
</dl>
|
|
1417
|
-
</dd>
|
|
1418
|
-
</dl>
|
|
1419
|
-
|
|
1420
|
-
#### 🔌 Usage
|
|
1421
|
-
|
|
1422
|
-
<dl>
|
|
1423
|
-
<dd>
|
|
1424
|
-
|
|
1425
|
-
<dl>
|
|
1426
|
-
<dd>
|
|
1427
|
-
|
|
1428
|
-
```typescript
|
|
1429
|
-
await client.permissionsService.checkBulkResourcesAuthorizationForUser({
|
|
1430
|
-
resourceIdentifiers: [
|
|
1431
|
-
{
|
|
1432
|
-
type: "url",
|
|
1433
|
-
url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit",
|
|
1434
|
-
},
|
|
1435
|
-
{
|
|
1436
|
-
type: "external-resource-id",
|
|
1437
|
-
externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
|
|
1438
|
-
resourceType: "ZENDESK_TICKET",
|
|
1439
|
-
},
|
|
1440
|
-
],
|
|
1441
|
-
userEmail: "john.smith@foo.com",
|
|
1442
|
-
});
|
|
1443
|
-
```
|
|
1444
|
-
|
|
1445
|
-
</dd>
|
|
1446
|
-
</dl>
|
|
1447
|
-
</dd>
|
|
1448
|
-
</dl>
|
|
1449
|
-
|
|
1450
|
-
#### ⚙️ Parameters
|
|
1451
|
-
|
|
1452
|
-
<dl>
|
|
1453
|
-
<dd>
|
|
1454
|
-
|
|
1455
|
-
<dl>
|
|
1456
|
-
<dd>
|
|
1457
|
-
|
|
1458
|
-
**request:** `Credal.CheckBulkResourcesAuthorizationForUserRequest`
|
|
1459
|
-
|
|
1460
|
-
</dd>
|
|
1461
|
-
</dl>
|
|
1462
|
-
|
|
1463
|
-
<dl>
|
|
1464
|
-
<dd>
|
|
1465
|
-
|
|
1466
|
-
**requestOptions:** `PermissionsService.RequestOptions`
|
|
1467
|
-
|
|
1468
|
-
</dd>
|
|
1469
|
-
</dl>
|
|
1470
|
-
</dd>
|
|
1471
|
-
</dl>
|
|
1472
|
-
|
|
1473
|
-
</dd>
|
|
1474
|
-
</dl>
|
|
1475
|
-
</details>
|
|
1476
|
-
|
|
1477
|
-
<details><summary><code>client.permissionsService.<a href="/src/api/resources/permissionsService/client/Client.ts">listCachedAuthorizedResourcesForUser</a>({ ...params }) -> Credal.AuthorizedResourceListPage</code></summary>
|
|
1478
|
-
<dl>
|
|
1479
|
-
<dd>
|
|
1480
|
-
|
|
1481
|
-
#### 📝 Description
|
|
1482
|
-
|
|
1483
|
-
<dl>
|
|
1484
|
-
<dd>
|
|
1485
|
-
|
|
1486
|
-
<dl>
|
|
1487
|
-
<dd>
|
|
1488
|
-
|
|
1489
|
-
Admin endpoint to list all resources that the specified user is authorized to read. Note this endpoint returns cached results and may not be up-to-date. You can use the checkResourceAuthorizationForUser endpoint with disableCache set to true to get the most up-to-date results.
|
|
1490
|
-
|
|
1491
|
-
</dd>
|
|
1492
|
-
</dl>
|
|
1493
|
-
</dd>
|
|
1494
|
-
</dl>
|
|
1495
|
-
|
|
1496
|
-
#### 🔌 Usage
|
|
1497
|
-
|
|
1498
|
-
<dl>
|
|
1499
|
-
<dd>
|
|
1500
|
-
|
|
1501
|
-
<dl>
|
|
1502
|
-
<dd>
|
|
1503
|
-
|
|
1504
|
-
```typescript
|
|
1505
|
-
await client.permissionsService.listCachedAuthorizedResourcesForUser({
|
|
1506
|
-
userEmail: "john.smith@foo.com",
|
|
1507
|
-
});
|
|
1508
|
-
```
|
|
1509
|
-
|
|
1510
|
-
</dd>
|
|
1511
|
-
</dl>
|
|
1512
|
-
</dd>
|
|
1513
|
-
</dl>
|
|
1514
|
-
|
|
1515
|
-
#### ⚙️ Parameters
|
|
1516
|
-
|
|
1517
|
-
<dl>
|
|
1518
|
-
<dd>
|
|
1519
|
-
|
|
1520
|
-
<dl>
|
|
1521
|
-
<dd>
|
|
1522
|
-
|
|
1523
|
-
**request:** `Credal.ListCachedAuthorizedResourcesForUserRequest`
|
|
1524
|
-
|
|
1525
|
-
</dd>
|
|
1526
|
-
</dl>
|
|
1527
|
-
|
|
1528
|
-
<dl>
|
|
1529
|
-
<dd>
|
|
1530
|
-
|
|
1531
|
-
**requestOptions:** `PermissionsService.RequestOptions`
|
|
1532
|
-
|
|
1533
|
-
</dd>
|
|
1534
|
-
</dl>
|
|
1535
|
-
</dd>
|
|
1536
|
-
</dl>
|
|
1537
|
-
|
|
1538
|
-
</dd>
|
|
1539
|
-
</dl>
|
|
1540
|
-
</details>
|
|
1541
|
-
|
|
1542
1329
|
## Search
|
|
1543
1330
|
|
|
1544
1331
|
<details><summary><code>client.search.<a href="/src/api/resources/search/client/Client.ts">searchDocumentCollection</a>({ ...params }) -> Credal.SearchDocumentCollectionResponse</code></summary>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../environments.js";
|
|
5
|
-
import * as core from "../../../../core/index.js";
|
|
6
|
-
import * as Credal from "../../../index.js";
|
|
7
|
-
export declare namespace PermissionsService {
|
|
8
|
-
interface Options {
|
|
9
|
-
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
10
|
-
/** Specify a custom URL to connect the client to. */
|
|
11
|
-
baseUrl?: core.Supplier<string>;
|
|
12
|
-
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
-
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
|
-
fetcher?: core.FetchFunction;
|
|
16
|
-
}
|
|
17
|
-
interface RequestOptions {
|
|
18
|
-
/** The maximum time to wait for a response in seconds. */
|
|
19
|
-
timeoutInSeconds?: number;
|
|
20
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
-
maxRetries?: number;
|
|
22
|
-
/** A hook to abort the request. */
|
|
23
|
-
abortSignal?: AbortSignal;
|
|
24
|
-
/** Additional query string parameters to include in the request. */
|
|
25
|
-
queryParams?: Record<string, unknown>;
|
|
26
|
-
/** Additional headers to include in the request. */
|
|
27
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export declare class PermissionsService {
|
|
31
|
-
protected readonly _options: PermissionsService.Options;
|
|
32
|
-
constructor(_options?: PermissionsService.Options);
|
|
33
|
-
/**
|
|
34
|
-
* Admin endpoint to check whether the specified user is authorized to read the specified resource.
|
|
35
|
-
*
|
|
36
|
-
* @param {Credal.CheckResourceAuthorizationForUserRequest} request
|
|
37
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* await client.permissionsService.checkResourceAuthorizationForUser({
|
|
41
|
-
* resourceIdentifier: {
|
|
42
|
-
* type: "external-resource-id",
|
|
43
|
-
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
44
|
-
* resourceType: "GOOGLE_DRIVE_ITEM"
|
|
45
|
-
* },
|
|
46
|
-
* userEmail: "john.smith@foo.com"
|
|
47
|
-
* })
|
|
48
|
-
*/
|
|
49
|
-
checkResourceAuthorizationForUser(request: Credal.CheckResourceAuthorizationForUserRequest, requestOptions?: PermissionsService.RequestOptions): core.HttpResponsePromise<Credal.CheckResourceAuthorizationResponse>;
|
|
50
|
-
private __checkResourceAuthorizationForUser;
|
|
51
|
-
/**
|
|
52
|
-
* Admin endpoint to check whether the specified user is authorized to read the specified set of resources.
|
|
53
|
-
*
|
|
54
|
-
* @param {Credal.CheckBulkResourcesAuthorizationForUserRequest} request
|
|
55
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* await client.permissionsService.checkBulkResourcesAuthorizationForUser({
|
|
59
|
-
* resourceIdentifiers: [{
|
|
60
|
-
* type: "url",
|
|
61
|
-
* url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit"
|
|
62
|
-
* }, {
|
|
63
|
-
* type: "external-resource-id",
|
|
64
|
-
* externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
|
|
65
|
-
* resourceType: "ZENDESK_TICKET"
|
|
66
|
-
* }],
|
|
67
|
-
* userEmail: "john.smith@foo.com"
|
|
68
|
-
* })
|
|
69
|
-
*/
|
|
70
|
-
checkBulkResourcesAuthorizationForUser(request: Credal.CheckBulkResourcesAuthorizationForUserRequest, requestOptions?: PermissionsService.RequestOptions): core.HttpResponsePromise<Credal.CheckBulkResourcesAuthorizationResponse>;
|
|
71
|
-
private __checkBulkResourcesAuthorizationForUser;
|
|
72
|
-
/**
|
|
73
|
-
* Admin endpoint to list all resources that the specified user is authorized to read. Note this endpoint returns cached results and may not be up-to-date. You can use the checkResourceAuthorizationForUser endpoint with disableCache set to true to get the most up-to-date results.
|
|
74
|
-
*
|
|
75
|
-
* @param {Credal.ListCachedAuthorizedResourcesForUserRequest} request
|
|
76
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* await client.permissionsService.listCachedAuthorizedResourcesForUser({
|
|
80
|
-
* userEmail: "john.smith@foo.com"
|
|
81
|
-
* })
|
|
82
|
-
*/
|
|
83
|
-
listCachedAuthorizedResourcesForUser(request: Credal.ListCachedAuthorizedResourcesForUserRequest, requestOptions?: PermissionsService.RequestOptions): core.HttpResponsePromise<Credal.AuthorizedResourceListPage>;
|
|
84
|
-
private __listCachedAuthorizedResourcesForUser;
|
|
85
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
86
|
-
}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.PermissionsService = void 0;
|
|
49
|
-
const environments = __importStar(require("../../../../environments.js"));
|
|
50
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
51
|
-
const headers_js_1 = require("../../../../core/headers.js");
|
|
52
|
-
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
-
class PermissionsService {
|
|
54
|
-
constructor(_options = {}) {
|
|
55
|
-
this._options = _options;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Admin endpoint to check whether the specified user is authorized to read the specified resource.
|
|
59
|
-
*
|
|
60
|
-
* @param {Credal.CheckResourceAuthorizationForUserRequest} request
|
|
61
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* await client.permissionsService.checkResourceAuthorizationForUser({
|
|
65
|
-
* resourceIdentifier: {
|
|
66
|
-
* type: "external-resource-id",
|
|
67
|
-
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
68
|
-
* resourceType: "GOOGLE_DRIVE_ITEM"
|
|
69
|
-
* },
|
|
70
|
-
* userEmail: "john.smith@foo.com"
|
|
71
|
-
* })
|
|
72
|
-
*/
|
|
73
|
-
checkResourceAuthorizationForUser(request, requestOptions) {
|
|
74
|
-
return core.HttpResponsePromise.fromPromise(this.__checkResourceAuthorizationForUser(request, requestOptions));
|
|
75
|
-
}
|
|
76
|
-
__checkResourceAuthorizationForUser(request, requestOptions) {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
var _a, _b, _c, _d;
|
|
79
|
-
var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
80
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
81
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/permissions/checkResourceAuthorizationForUser"),
|
|
82
|
-
method: "POST",
|
|
83
|
-
headers: _headers,
|
|
84
|
-
contentType: "application/json",
|
|
85
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
86
|
-
requestType: "json",
|
|
87
|
-
body: request,
|
|
88
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
89
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
90
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
91
|
-
});
|
|
92
|
-
if (_response.ok) {
|
|
93
|
-
return {
|
|
94
|
-
data: _response.body,
|
|
95
|
-
rawResponse: _response.rawResponse,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (_response.error.reason === "status-code") {
|
|
99
|
-
throw new errors.CredalError({
|
|
100
|
-
statusCode: _response.error.statusCode,
|
|
101
|
-
body: _response.error.body,
|
|
102
|
-
rawResponse: _response.rawResponse,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
switch (_response.error.reason) {
|
|
106
|
-
case "non-json":
|
|
107
|
-
throw new errors.CredalError({
|
|
108
|
-
statusCode: _response.error.statusCode,
|
|
109
|
-
body: _response.error.rawBody,
|
|
110
|
-
rawResponse: _response.rawResponse,
|
|
111
|
-
});
|
|
112
|
-
case "timeout":
|
|
113
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/permissions/checkResourceAuthorizationForUser.");
|
|
114
|
-
case "unknown":
|
|
115
|
-
throw new errors.CredalError({
|
|
116
|
-
message: _response.error.errorMessage,
|
|
117
|
-
rawResponse: _response.rawResponse,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Admin endpoint to check whether the specified user is authorized to read the specified set of resources.
|
|
124
|
-
*
|
|
125
|
-
* @param {Credal.CheckBulkResourcesAuthorizationForUserRequest} request
|
|
126
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* await client.permissionsService.checkBulkResourcesAuthorizationForUser({
|
|
130
|
-
* resourceIdentifiers: [{
|
|
131
|
-
* type: "url",
|
|
132
|
-
* url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit"
|
|
133
|
-
* }, {
|
|
134
|
-
* type: "external-resource-id",
|
|
135
|
-
* externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
|
|
136
|
-
* resourceType: "ZENDESK_TICKET"
|
|
137
|
-
* }],
|
|
138
|
-
* userEmail: "john.smith@foo.com"
|
|
139
|
-
* })
|
|
140
|
-
*/
|
|
141
|
-
checkBulkResourcesAuthorizationForUser(request, requestOptions) {
|
|
142
|
-
return core.HttpResponsePromise.fromPromise(this.__checkBulkResourcesAuthorizationForUser(request, requestOptions));
|
|
143
|
-
}
|
|
144
|
-
__checkBulkResourcesAuthorizationForUser(request, requestOptions) {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
var _a, _b, _c, _d;
|
|
147
|
-
var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
148
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
149
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/permissions/checkBulkResourcesAuthorizationForUser"),
|
|
150
|
-
method: "POST",
|
|
151
|
-
headers: _headers,
|
|
152
|
-
contentType: "application/json",
|
|
153
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
154
|
-
requestType: "json",
|
|
155
|
-
body: request,
|
|
156
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
157
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
158
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
159
|
-
});
|
|
160
|
-
if (_response.ok) {
|
|
161
|
-
return {
|
|
162
|
-
data: _response.body,
|
|
163
|
-
rawResponse: _response.rawResponse,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
if (_response.error.reason === "status-code") {
|
|
167
|
-
throw new errors.CredalError({
|
|
168
|
-
statusCode: _response.error.statusCode,
|
|
169
|
-
body: _response.error.body,
|
|
170
|
-
rawResponse: _response.rawResponse,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
switch (_response.error.reason) {
|
|
174
|
-
case "non-json":
|
|
175
|
-
throw new errors.CredalError({
|
|
176
|
-
statusCode: _response.error.statusCode,
|
|
177
|
-
body: _response.error.rawBody,
|
|
178
|
-
rawResponse: _response.rawResponse,
|
|
179
|
-
});
|
|
180
|
-
case "timeout":
|
|
181
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/permissions/checkBulkResourcesAuthorizationForUser.");
|
|
182
|
-
case "unknown":
|
|
183
|
-
throw new errors.CredalError({
|
|
184
|
-
message: _response.error.errorMessage,
|
|
185
|
-
rawResponse: _response.rawResponse,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Admin endpoint to list all resources that the specified user is authorized to read. Note this endpoint returns cached results and may not be up-to-date. You can use the checkResourceAuthorizationForUser endpoint with disableCache set to true to get the most up-to-date results.
|
|
192
|
-
*
|
|
193
|
-
* @param {Credal.ListCachedAuthorizedResourcesForUserRequest} request
|
|
194
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
|
-
*
|
|
196
|
-
* @example
|
|
197
|
-
* await client.permissionsService.listCachedAuthorizedResourcesForUser({
|
|
198
|
-
* userEmail: "john.smith@foo.com"
|
|
199
|
-
* })
|
|
200
|
-
*/
|
|
201
|
-
listCachedAuthorizedResourcesForUser(request, requestOptions) {
|
|
202
|
-
return core.HttpResponsePromise.fromPromise(this.__listCachedAuthorizedResourcesForUser(request, requestOptions));
|
|
203
|
-
}
|
|
204
|
-
__listCachedAuthorizedResourcesForUser(request, requestOptions) {
|
|
205
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
-
var _a, _b, _c, _d;
|
|
207
|
-
var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
208
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
209
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/permissions/listCachedAuthorizedResourcesForUser"),
|
|
210
|
-
method: "POST",
|
|
211
|
-
headers: _headers,
|
|
212
|
-
contentType: "application/json",
|
|
213
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
214
|
-
requestType: "json",
|
|
215
|
-
body: request,
|
|
216
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
217
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
218
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
219
|
-
});
|
|
220
|
-
if (_response.ok) {
|
|
221
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
222
|
-
}
|
|
223
|
-
if (_response.error.reason === "status-code") {
|
|
224
|
-
throw new errors.CredalError({
|
|
225
|
-
statusCode: _response.error.statusCode,
|
|
226
|
-
body: _response.error.body,
|
|
227
|
-
rawResponse: _response.rawResponse,
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
switch (_response.error.reason) {
|
|
231
|
-
case "non-json":
|
|
232
|
-
throw new errors.CredalError({
|
|
233
|
-
statusCode: _response.error.statusCode,
|
|
234
|
-
body: _response.error.rawBody,
|
|
235
|
-
rawResponse: _response.rawResponse,
|
|
236
|
-
});
|
|
237
|
-
case "timeout":
|
|
238
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/permissions/listCachedAuthorizedResourcesForUser.");
|
|
239
|
-
case "unknown":
|
|
240
|
-
throw new errors.CredalError({
|
|
241
|
-
message: _response.error.errorMessage,
|
|
242
|
-
rawResponse: _response.rawResponse,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
_getAuthorizationHeader() {
|
|
248
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
-
var _a;
|
|
250
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["CREDAL_API_KEY"];
|
|
251
|
-
if (bearer == null) {
|
|
252
|
-
throw new errors.CredalError({
|
|
253
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
return `Bearer ${bearer}`;
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
exports.PermissionsService = PermissionsService;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Credal from "../../../../index.js";
|
|
5
|
-
/**
|
|
6
|
-
* @example
|
|
7
|
-
* {
|
|
8
|
-
* resourceIdentifiers: [{
|
|
9
|
-
* type: "url",
|
|
10
|
-
* url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit"
|
|
11
|
-
* }, {
|
|
12
|
-
* type: "external-resource-id",
|
|
13
|
-
* externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
|
|
14
|
-
* resourceType: "ZENDESK_TICKET"
|
|
15
|
-
* }],
|
|
16
|
-
* userEmail: "john.smith@foo.com"
|
|
17
|
-
* }
|
|
18
|
-
*/
|
|
19
|
-
export interface CheckBulkResourcesAuthorizationForUserRequest {
|
|
20
|
-
/** The set of resource identifier for which you want to check authorization. Currently limited to 20 resources. */
|
|
21
|
-
resourceIdentifiers: Credal.ResourceIdentifier[];
|
|
22
|
-
/** The user email to check authorization for. */
|
|
23
|
-
userEmail: string;
|
|
24
|
-
/** If specified, Credal will bypass the permissions cache and check current permissions for all resources specified. */
|
|
25
|
-
disableCache?: boolean;
|
|
26
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Credal from "../../../../index.js";
|
|
5
|
-
/**
|
|
6
|
-
* @example
|
|
7
|
-
* {
|
|
8
|
-
* resourceIdentifier: {
|
|
9
|
-
* type: "external-resource-id",
|
|
10
|
-
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
11
|
-
* resourceType: "GOOGLE_DRIVE_ITEM"
|
|
12
|
-
* },
|
|
13
|
-
* userEmail: "john.smith@foo.com"
|
|
14
|
-
* }
|
|
15
|
-
*/
|
|
16
|
-
export interface CheckResourceAuthorizationForUserRequest {
|
|
17
|
-
/** The resource identifier for which you want to check authorization. */
|
|
18
|
-
resourceIdentifier: Credal.ResourceIdentifier;
|
|
19
|
-
/** The user email to check authorization for. */
|
|
20
|
-
userEmail: string;
|
|
21
|
-
/** If specified, Credal will bypass the permissions cache and check current permissions for this resource */
|
|
22
|
-
disableCache?: boolean;
|
|
23
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Credal from "../../../../index.js";
|
|
5
|
-
/**
|
|
6
|
-
* @example
|
|
7
|
-
* {
|
|
8
|
-
* userEmail: "john.smith@foo.com"
|
|
9
|
-
* }
|
|
10
|
-
*/
|
|
11
|
-
export interface ListCachedAuthorizedResourcesForUserRequest {
|
|
12
|
-
/** The user email to list authorized resources for. */
|
|
13
|
-
userEmail: string;
|
|
14
|
-
/** The type of resource you want to list. If not specified, all resource types will be listed. */
|
|
15
|
-
resourceType?: Credal.ResourceType;
|
|
16
|
-
/** The maximum number of resources to return. Defaults to 100. */
|
|
17
|
-
limit?: number;
|
|
18
|
-
/** The offset to use for pagination. If not specified, the first page of results will be returned. */
|
|
19
|
-
offset?: number;
|
|
20
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { type CheckResourceAuthorizationForUserRequest } from "./CheckResourceAuthorizationForUserRequest.js";
|
|
2
|
-
export { type CheckBulkResourcesAuthorizationForUserRequest } from "./CheckBulkResourcesAuthorizationForUserRequest.js";
|
|
3
|
-
export { type ListCachedAuthorizedResourcesForUserRequest } from "./ListCachedAuthorizedResourcesForUserRequest.js";
|