@snokam/platform-client 1.0.0 → 2.0.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/CHANGELOG.md +139 -0
- package/README.md +4 -3
- package/dist/apis/PlatformClient.d.ts +41 -23
- package/dist/apis/PlatformClient.js +103 -54
- package/dist/esm/apis/PlatformClient.d.ts +41 -23
- package/dist/esm/apis/PlatformClient.js +103 -54
- package/dist/esm/models/index.d.ts +29 -21
- package/dist/models/index.d.ts +29 -21
- package/docs/{SetActiveProviderRequest.md → ChooseProviderRequest.md} +1 -1
- package/docs/IntegrationSummary.md +1 -1
- package/docs/PlatformClient.md +155 -79
- package/docs/StudioSanityConfig.md +1 -0
- package/package.json +1 -1
- package/src/apis/PlatformClient.ts +137 -72
- package/src/models/index.ts +27 -21
package/docs/PlatformClient.md
CHANGED
|
@@ -10,6 +10,7 @@ All URIs are relative to *https://snokam.snosky.no/api/platform*
|
|
|
10
10
|
| [**backfillBridgeWebhook**](PlatformClient.md#backfillbridgewebhook) | **POST** /v1.0/protected/businesses/{id}/bridge-webhook | Re-create a business\'s Sanity bridge webhook with a managed API key |
|
|
11
11
|
| [**checkIntegration**](PlatformClient.md#checkintegration) | **POST** /v1.0/protected/businesses/{id}/integrations/{key}/check | Run a live integration connectivity check |
|
|
12
12
|
| [**checkPlatformIntegration**](PlatformClient.md#checkplatformintegration) | **POST** /v1.0/protected/platform/integrations/{key}/check | Live-probe a platform integration |
|
|
13
|
+
| [**chooseProvider**](PlatformClient.md#chooseprovideroperation) | **PUT** /v1.0/protected/businesses/{id}/integrations/chosen | Choose the active provider for a capability |
|
|
13
14
|
| [**connectTenant**](PlatformClient.md#connecttenant) | **POST** /v1.0/protected/businesses/{id}/connect | Connect the caller\'s tenant to a business |
|
|
14
15
|
| [**createApiToken**](PlatformClient.md#createapitokenoperation) | **POST** /v1.0/protected/businesses/{id}/tokens | Create an API token |
|
|
15
16
|
| [**createBillingCheckout**](PlatformClient.md#createbillingcheckout) | **POST** /v1.0/protected/businesses/{id}/billing/checkout | Start a subscription checkout |
|
|
@@ -21,6 +22,7 @@ All URIs are relative to *https://snokam.snosky.no/api/platform*
|
|
|
21
22
|
| [**devicePairPoll**](PlatformClient.md#devicepairpoll) | **POST** /v1.0/public/devices/poll | Ask whether the code was approved |
|
|
22
23
|
| [**devicePairRequest**](PlatformClient.md#devicepairrequest) | **POST** /v1.0/public/devices/pair | Ask for a pairing code |
|
|
23
24
|
| [**disableCredential**](PlatformClient.md#disablecredential) | **DELETE** /v1.0/protected/businesses/{id}/credentials/{credentialId} | Disable a password credential |
|
|
25
|
+
| [**disconnectIntegration**](PlatformClient.md#disconnectintegration) | **DELETE** /v1.0/protected/businesses/{id}/integrations/{key} | Disconnect an integration |
|
|
24
26
|
| [**endImpersonation**](PlatformClient.md#endimpersonation) | **POST** /v1.0/protected/impersonate/{tokenId}/end | End a view-as-employee session |
|
|
25
27
|
| [**exportBusinessData**](PlatformClient.md#exportbusinessdata) | **POST** /v1.0/protected/businesses/{id}/export | Export a business\'s data (GDPR) |
|
|
26
28
|
| [**getApiScopes**](PlatformClient.md#getapiscopes) | **GET** /v1.0/protected/scopes | List grantable API scopes |
|
|
@@ -103,7 +105,7 @@ All URIs are relative to *https://snokam.snosky.no/api/platform*
|
|
|
103
105
|
| [**requestUpgrade**](PlatformClient.md#requestupgrade) | **POST** /v1.0/protected/businesses/{id}/request-upgrade | Request an Enterprise upgrade |
|
|
104
106
|
| [**resetCredential**](PlatformClient.md#resetcredential) | **POST** /v1.0/protected/businesses/{id}/credentials/{credentialId}/reset | Admin-initiated password reset |
|
|
105
107
|
| [**resolvePlatformSanityConfig**](PlatformClient.md#resolveplatformsanityconfig) | **GET** /v1.0/protected/sanity/platform | Resolve the platform Sanity read config |
|
|
106
|
-
| [**resolveStudioSanityConfig**](PlatformClient.md#resolvestudiosanityconfig) | **GET** /v1.0/public/sanity-config | Resolve the Sanity Studio project/dataset for a host |
|
|
108
|
+
| [**resolveStudioSanityConfig**](PlatformClient.md#resolvestudiosanityconfig) | **GET** /v1.0/public/sanity-config | Resolve the Sanity Studio project/dataset and frontend URLs for a host |
|
|
107
109
|
| [**resolveTenant**](PlatformClient.md#resolvetenant) | **GET** /v1.0/protected/tenant | Resolve a tenant |
|
|
108
110
|
| [**resolveTenantSanityCredentials**](PlatformClient.md#resolvetenantsanitycredentials) | **GET** /v1.0/protected/businesses/by-host/{host}/sanity | Resolve a tenant\'s Sanity read credentials by host |
|
|
109
111
|
| [**revokeApiToken**](PlatformClient.md#revokeapitoken) | **DELETE** /v1.0/protected/businesses/{id}/tokens/{fingerprint} | Revoke an API token |
|
|
@@ -111,7 +113,6 @@ All URIs are relative to *https://snokam.snosky.no/api/platform*
|
|
|
111
113
|
| [**revokeDevice**](PlatformClient.md#revokedevice) | **DELETE** /v1.0/protected/businesses/{id}/devices/{deviceId} | Revoke a screen |
|
|
112
114
|
| [**setAccountingGadgetsProject**](PlatformClient.md#setaccountinggadgetsproject) | **POST** /v1.0/protected/businesses/{id}/accounting/gadgets-project | Set the gadgets project code |
|
|
113
115
|
| [**setAccountingReinvoiceProduct**](PlatformClient.md#setaccountingreinvoiceproduct) | **POST** /v1.0/protected/businesses/{id}/accounting/reinvoice-product | Set the re-invoice product code |
|
|
114
|
-
| [**setActiveProvider**](PlatformClient.md#setactiveprovideroperation) | **PUT** /v1.0/protected/businesses/{id}/integrations/active | Choose the active provider for a capability |
|
|
115
116
|
| [**setBusinessEmployeePhoto**](PlatformClient.md#setbusinessemployeephoto) | **POST** /v1.0/protected/businesses/{id}/employees/{employeeId}/photo | Upload an employee\'s profile photo |
|
|
116
117
|
| [**setEmployeeScopeGrants**](PlatformClient.md#setemployeescopegrants) | **PUT** /v1.0/protected/businesses/{id}/access/employees/{employeeId} | Set the scopes granted directly to an employee |
|
|
117
118
|
| [**setFacebookSelectedAccount**](PlatformClient.md#setfacebookselectedaccount) | **PUT** /v1.0/protected/businesses/{id}/oauth/facebook/account | Set the selected Facebook/Instagram posting account |
|
|
@@ -585,6 +586,81 @@ example().catch(console.error);
|
|
|
585
586
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
586
587
|
|
|
587
588
|
|
|
589
|
+
## chooseProvider
|
|
590
|
+
|
|
591
|
+
> Business chooseProvider(id, chooseProviderRequest)
|
|
592
|
+
|
|
593
|
+
Choose the active provider for a capability
|
|
594
|
+
|
|
595
|
+
When a capability has several providers (e.g. PowerOffice vs Tripletex, Coinbase API-key vs OAuth), selects which one the business uses.
|
|
596
|
+
|
|
597
|
+
### Example
|
|
598
|
+
|
|
599
|
+
```ts
|
|
600
|
+
import {
|
|
601
|
+
Configuration,
|
|
602
|
+
PlatformClient,
|
|
603
|
+
} from '@snokam/platform-client';
|
|
604
|
+
import type { ChooseProviderOperationRequest } from '@snokam/platform-client';
|
|
605
|
+
|
|
606
|
+
async function example() {
|
|
607
|
+
console.log("🚀 Testing @snokam/platform-client SDK...");
|
|
608
|
+
const config = new Configuration({
|
|
609
|
+
// To configure OAuth2 access token for authorization: Implicit implicit
|
|
610
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
611
|
+
});
|
|
612
|
+
const api = new PlatformClient(config);
|
|
613
|
+
|
|
614
|
+
const body = {
|
|
615
|
+
// string
|
|
616
|
+
id: id_example,
|
|
617
|
+
// ChooseProviderRequest
|
|
618
|
+
chooseProviderRequest: ...,
|
|
619
|
+
} satisfies ChooseProviderOperationRequest;
|
|
620
|
+
|
|
621
|
+
try {
|
|
622
|
+
const data = await api.chooseProvider(body);
|
|
623
|
+
console.log(data);
|
|
624
|
+
} catch (error) {
|
|
625
|
+
console.error(error);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// Run the test
|
|
630
|
+
example().catch(console.error);
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
### Parameters
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
| Name | Type | Description | Notes |
|
|
637
|
+
|------------- | ------------- | ------------- | -------------|
|
|
638
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
639
|
+
| **chooseProviderRequest** | [ChooseProviderRequest](ChooseProviderRequest.md) | | |
|
|
640
|
+
|
|
641
|
+
### Return type
|
|
642
|
+
|
|
643
|
+
[**Business**](Business.md)
|
|
644
|
+
|
|
645
|
+
### Authorization
|
|
646
|
+
|
|
647
|
+
[Implicit implicit](../README.md#Implicit-implicit)
|
|
648
|
+
|
|
649
|
+
### HTTP request headers
|
|
650
|
+
|
|
651
|
+
- **Content-Type**: `application/json`
|
|
652
|
+
- **Accept**: `application/json`
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
### HTTP response details
|
|
656
|
+
| Status code | Description | Response headers |
|
|
657
|
+
|-------------|-------------|------------------|
|
|
658
|
+
| **200** | Payload of Business | - |
|
|
659
|
+
| **404** | No description | - |
|
|
660
|
+
|
|
661
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
662
|
+
|
|
663
|
+
|
|
588
664
|
## connectTenant
|
|
589
665
|
|
|
590
666
|
> Business connectTenant(id)
|
|
@@ -1392,6 +1468,81 @@ example().catch(console.error);
|
|
|
1392
1468
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1393
1469
|
|
|
1394
1470
|
|
|
1471
|
+
## disconnectIntegration
|
|
1472
|
+
|
|
1473
|
+
> Business disconnectIntegration(id, key)
|
|
1474
|
+
|
|
1475
|
+
Disconnect an integration
|
|
1476
|
+
|
|
1477
|
+
Deletes every secret the integration stores for this business — including the OAuth refresh token and cached access token — and clears the capability\'s provider choice when it pointed at this integration. Settings such as base URLs are left alone.
|
|
1478
|
+
|
|
1479
|
+
### Example
|
|
1480
|
+
|
|
1481
|
+
```ts
|
|
1482
|
+
import {
|
|
1483
|
+
Configuration,
|
|
1484
|
+
PlatformClient,
|
|
1485
|
+
} from '@snokam/platform-client';
|
|
1486
|
+
import type { DisconnectIntegrationRequest } from '@snokam/platform-client';
|
|
1487
|
+
|
|
1488
|
+
async function example() {
|
|
1489
|
+
console.log("🚀 Testing @snokam/platform-client SDK...");
|
|
1490
|
+
const config = new Configuration({
|
|
1491
|
+
// To configure OAuth2 access token for authorization: Implicit implicit
|
|
1492
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
1493
|
+
});
|
|
1494
|
+
const api = new PlatformClient(config);
|
|
1495
|
+
|
|
1496
|
+
const body = {
|
|
1497
|
+
// string
|
|
1498
|
+
id: id_example,
|
|
1499
|
+
// string
|
|
1500
|
+
key: key_example,
|
|
1501
|
+
} satisfies DisconnectIntegrationRequest;
|
|
1502
|
+
|
|
1503
|
+
try {
|
|
1504
|
+
const data = await api.disconnectIntegration(body);
|
|
1505
|
+
console.log(data);
|
|
1506
|
+
} catch (error) {
|
|
1507
|
+
console.error(error);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// Run the test
|
|
1512
|
+
example().catch(console.error);
|
|
1513
|
+
```
|
|
1514
|
+
|
|
1515
|
+
### Parameters
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
| Name | Type | Description | Notes |
|
|
1519
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1520
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
1521
|
+
| **key** | `string` | | [Defaults to `undefined`] |
|
|
1522
|
+
|
|
1523
|
+
### Return type
|
|
1524
|
+
|
|
1525
|
+
[**Business**](Business.md)
|
|
1526
|
+
|
|
1527
|
+
### Authorization
|
|
1528
|
+
|
|
1529
|
+
[Implicit implicit](../README.md#Implicit-implicit)
|
|
1530
|
+
|
|
1531
|
+
### HTTP request headers
|
|
1532
|
+
|
|
1533
|
+
- **Content-Type**: Not defined
|
|
1534
|
+
- **Accept**: `application/json`
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
### HTTP response details
|
|
1538
|
+
| Status code | Description | Response headers |
|
|
1539
|
+
|-------------|-------------|------------------|
|
|
1540
|
+
| **200** | Payload of Business | - |
|
|
1541
|
+
| **404** | No description | - |
|
|
1542
|
+
|
|
1543
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1544
|
+
|
|
1545
|
+
|
|
1395
1546
|
## endImpersonation
|
|
1396
1547
|
|
|
1397
1548
|
> endImpersonation(tokenId)
|
|
@@ -7100,9 +7251,9 @@ This endpoint does not need any parameter.
|
|
|
7100
7251
|
|
|
7101
7252
|
> StudioSanityConfig resolveStudioSanityConfig(host)
|
|
7102
7253
|
|
|
7103
|
-
Resolve the Sanity Studio project/dataset for a host
|
|
7254
|
+
Resolve the Sanity Studio project/dataset and frontend URLs for a host
|
|
7104
7255
|
|
|
7105
|
-
Returns the non-secret Sanity project id and dataset a studio should point at for the given host. A tenant host returns that tenant\'s project; a host that belongs to no business (the platform host) returns the shared platform project. No read/write token is returned — the studio authenticates the user via Sanity login — so this is a public endpoint safe to call from a browser.
|
|
7256
|
+
Returns the non-secret Sanity project id and dataset a studio should point at for the given host, plus that tenant\'s frontend app URLs so document \'Vis side\' links resolve per tenant. A tenant host returns that tenant\'s project; a host that belongs to no business (the platform host) returns the shared platform project and no app URLs. No read/write token is returned — the studio authenticates the user via Sanity login — so this is a public endpoint safe to call from a browser.
|
|
7106
7257
|
|
|
7107
7258
|
### Example
|
|
7108
7259
|
|
|
@@ -7694,81 +7845,6 @@ example().catch(console.error);
|
|
|
7694
7845
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
7695
7846
|
|
|
7696
7847
|
|
|
7697
|
-
## setActiveProvider
|
|
7698
|
-
|
|
7699
|
-
> Business setActiveProvider(id, setActiveProviderRequest)
|
|
7700
|
-
|
|
7701
|
-
Choose the active provider for a capability
|
|
7702
|
-
|
|
7703
|
-
When a capability has several providers (e.g. PowerOffice vs Tripletex, Coinbase API-key vs OAuth), selects which one the business uses.
|
|
7704
|
-
|
|
7705
|
-
### Example
|
|
7706
|
-
|
|
7707
|
-
```ts
|
|
7708
|
-
import {
|
|
7709
|
-
Configuration,
|
|
7710
|
-
PlatformClient,
|
|
7711
|
-
} from '@snokam/platform-client';
|
|
7712
|
-
import type { SetActiveProviderOperationRequest } from '@snokam/platform-client';
|
|
7713
|
-
|
|
7714
|
-
async function example() {
|
|
7715
|
-
console.log("🚀 Testing @snokam/platform-client SDK...");
|
|
7716
|
-
const config = new Configuration({
|
|
7717
|
-
// To configure OAuth2 access token for authorization: Implicit implicit
|
|
7718
|
-
accessToken: "YOUR ACCESS TOKEN",
|
|
7719
|
-
});
|
|
7720
|
-
const api = new PlatformClient(config);
|
|
7721
|
-
|
|
7722
|
-
const body = {
|
|
7723
|
-
// string
|
|
7724
|
-
id: id_example,
|
|
7725
|
-
// SetActiveProviderRequest
|
|
7726
|
-
setActiveProviderRequest: ...,
|
|
7727
|
-
} satisfies SetActiveProviderOperationRequest;
|
|
7728
|
-
|
|
7729
|
-
try {
|
|
7730
|
-
const data = await api.setActiveProvider(body);
|
|
7731
|
-
console.log(data);
|
|
7732
|
-
} catch (error) {
|
|
7733
|
-
console.error(error);
|
|
7734
|
-
}
|
|
7735
|
-
}
|
|
7736
|
-
|
|
7737
|
-
// Run the test
|
|
7738
|
-
example().catch(console.error);
|
|
7739
|
-
```
|
|
7740
|
-
|
|
7741
|
-
### Parameters
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
| Name | Type | Description | Notes |
|
|
7745
|
-
|------------- | ------------- | ------------- | -------------|
|
|
7746
|
-
| **id** | `string` | | [Defaults to `undefined`] |
|
|
7747
|
-
| **setActiveProviderRequest** | [SetActiveProviderRequest](SetActiveProviderRequest.md) | | |
|
|
7748
|
-
|
|
7749
|
-
### Return type
|
|
7750
|
-
|
|
7751
|
-
[**Business**](Business.md)
|
|
7752
|
-
|
|
7753
|
-
### Authorization
|
|
7754
|
-
|
|
7755
|
-
[Implicit implicit](../README.md#Implicit-implicit)
|
|
7756
|
-
|
|
7757
|
-
### HTTP request headers
|
|
7758
|
-
|
|
7759
|
-
- **Content-Type**: `application/json`
|
|
7760
|
-
- **Accept**: `application/json`
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
### HTTP response details
|
|
7764
|
-
| Status code | Description | Response headers |
|
|
7765
|
-
|-------------|-------------|------------------|
|
|
7766
|
-
| **200** | Payload of Business | - |
|
|
7767
|
-
| **404** | No description | - |
|
|
7768
|
-
|
|
7769
|
-
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
7848
|
## setBusinessEmployeePhoto
|
|
7773
7849
|
|
|
7774
7850
|
> ProtectedEmployee setBusinessEmployeePhoto(id, employeeId, body)
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ import type {
|
|
|
30
30
|
BusinessAccess,
|
|
31
31
|
BusinessHealth,
|
|
32
32
|
Capability,
|
|
33
|
+
ChooseProviderRequest,
|
|
33
34
|
CreateApiTokenRequest,
|
|
34
35
|
CreateUserRequest,
|
|
35
36
|
CreatedApiToken,
|
|
@@ -88,7 +89,6 @@ import type {
|
|
|
88
89
|
RevokeRequest,
|
|
89
90
|
ScopeDefinition,
|
|
90
91
|
SessionBootstrapRequest,
|
|
91
|
-
SetActiveProviderRequest,
|
|
92
92
|
SetFacebookAccountRequest,
|
|
93
93
|
SetGoogleAnalyticsPropertyRequest,
|
|
94
94
|
SetPlatformSecretRequest,
|
|
@@ -152,6 +152,11 @@ export interface CheckPlatformIntegrationRequest {
|
|
|
152
152
|
key: string;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
export interface ChooseProviderOperationRequest {
|
|
156
|
+
id: string;
|
|
157
|
+
chooseProviderRequest: ChooseProviderRequest;
|
|
158
|
+
}
|
|
159
|
+
|
|
155
160
|
export interface ConnectTenantRequest {
|
|
156
161
|
id: string;
|
|
157
162
|
}
|
|
@@ -202,6 +207,11 @@ export interface DisableCredentialRequest {
|
|
|
202
207
|
credentialId: string;
|
|
203
208
|
}
|
|
204
209
|
|
|
210
|
+
export interface DisconnectIntegrationRequest {
|
|
211
|
+
id: string;
|
|
212
|
+
key: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
205
215
|
export interface EndImpersonationRequest {
|
|
206
216
|
tokenId: string;
|
|
207
217
|
}
|
|
@@ -510,11 +520,6 @@ export interface SetAccountingReinvoiceProductRequest {
|
|
|
510
520
|
powerOfficeProduct: PowerOfficeProduct;
|
|
511
521
|
}
|
|
512
522
|
|
|
513
|
-
export interface SetActiveProviderOperationRequest {
|
|
514
|
-
id: string;
|
|
515
|
-
setActiveProviderRequest: SetActiveProviderRequest;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
523
|
export interface SetBusinessEmployeePhotoRequest {
|
|
519
524
|
id: string;
|
|
520
525
|
employeeId: string;
|
|
@@ -978,6 +983,68 @@ export class PlatformClient extends runtime.BaseAPI {
|
|
|
978
983
|
return await response.value();
|
|
979
984
|
}
|
|
980
985
|
|
|
986
|
+
/**
|
|
987
|
+
* Creates request options for chooseProvider without sending the request
|
|
988
|
+
*/
|
|
989
|
+
async chooseProviderRequestOpts(requestParameters: ChooseProviderOperationRequest): Promise<runtime.RequestOpts> {
|
|
990
|
+
if (requestParameters['id'] == null) {
|
|
991
|
+
throw new runtime.RequiredError(
|
|
992
|
+
'id',
|
|
993
|
+
'Required parameter "id" was null or undefined when calling chooseProvider().'
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
if (requestParameters['chooseProviderRequest'] == null) {
|
|
998
|
+
throw new runtime.RequiredError(
|
|
999
|
+
'chooseProviderRequest',
|
|
1000
|
+
'Required parameter "chooseProviderRequest" was null or undefined when calling chooseProvider().'
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
const queryParameters: any = {};
|
|
1005
|
+
|
|
1006
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1007
|
+
|
|
1008
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1009
|
+
|
|
1010
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1011
|
+
// oauth required
|
|
1012
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("Implicit", []);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
let urlPath = `/v1.0/protected/businesses/{id}/integrations/chosen`;
|
|
1017
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
1018
|
+
|
|
1019
|
+
return {
|
|
1020
|
+
path: urlPath,
|
|
1021
|
+
method: 'PUT',
|
|
1022
|
+
headers: headerParameters,
|
|
1023
|
+
query: queryParameters,
|
|
1024
|
+
body: requestParameters['chooseProviderRequest'],
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* When a capability has several providers (e.g. PowerOffice vs Tripletex, Coinbase API-key vs OAuth), selects which one the business uses.
|
|
1030
|
+
* Choose the active provider for a capability
|
|
1031
|
+
*/
|
|
1032
|
+
async chooseProviderRaw(requestParameters: ChooseProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Business>> {
|
|
1033
|
+
const requestOptions = await this.chooseProviderRequestOpts(requestParameters);
|
|
1034
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1035
|
+
|
|
1036
|
+
return new runtime.JSONApiResponse(response);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* When a capability has several providers (e.g. PowerOffice vs Tripletex, Coinbase API-key vs OAuth), selects which one the business uses.
|
|
1041
|
+
* Choose the active provider for a capability
|
|
1042
|
+
*/
|
|
1043
|
+
async chooseProvider(requestParameters: ChooseProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Business> {
|
|
1044
|
+
const response = await this.chooseProviderRaw(requestParameters, initOverrides);
|
|
1045
|
+
return await response.value();
|
|
1046
|
+
}
|
|
1047
|
+
|
|
981
1048
|
/**
|
|
982
1049
|
* Creates request options for connectTenant without sending the request
|
|
983
1050
|
*/
|
|
@@ -1593,6 +1660,66 @@ export class PlatformClient extends runtime.BaseAPI {
|
|
|
1593
1660
|
await this.disableCredentialRaw(requestParameters, initOverrides);
|
|
1594
1661
|
}
|
|
1595
1662
|
|
|
1663
|
+
/**
|
|
1664
|
+
* Creates request options for disconnectIntegration without sending the request
|
|
1665
|
+
*/
|
|
1666
|
+
async disconnectIntegrationRequestOpts(requestParameters: DisconnectIntegrationRequest): Promise<runtime.RequestOpts> {
|
|
1667
|
+
if (requestParameters['id'] == null) {
|
|
1668
|
+
throw new runtime.RequiredError(
|
|
1669
|
+
'id',
|
|
1670
|
+
'Required parameter "id" was null or undefined when calling disconnectIntegration().'
|
|
1671
|
+
);
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
if (requestParameters['key'] == null) {
|
|
1675
|
+
throw new runtime.RequiredError(
|
|
1676
|
+
'key',
|
|
1677
|
+
'Required parameter "key" was null or undefined when calling disconnectIntegration().'
|
|
1678
|
+
);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
const queryParameters: any = {};
|
|
1682
|
+
|
|
1683
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1684
|
+
|
|
1685
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1686
|
+
// oauth required
|
|
1687
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("Implicit", []);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
let urlPath = `/v1.0/protected/businesses/{id}/integrations/{key}`;
|
|
1692
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
1693
|
+
urlPath = urlPath.replace('{key}', encodeURIComponent(String(requestParameters['key'])));
|
|
1694
|
+
|
|
1695
|
+
return {
|
|
1696
|
+
path: urlPath,
|
|
1697
|
+
method: 'DELETE',
|
|
1698
|
+
headers: headerParameters,
|
|
1699
|
+
query: queryParameters,
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* Deletes every secret the integration stores for this business — including the OAuth refresh token and cached access token — and clears the capability\'s provider choice when it pointed at this integration. Settings such as base URLs are left alone.
|
|
1705
|
+
* Disconnect an integration
|
|
1706
|
+
*/
|
|
1707
|
+
async disconnectIntegrationRaw(requestParameters: DisconnectIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Business>> {
|
|
1708
|
+
const requestOptions = await this.disconnectIntegrationRequestOpts(requestParameters);
|
|
1709
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1710
|
+
|
|
1711
|
+
return new runtime.JSONApiResponse(response);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Deletes every secret the integration stores for this business — including the OAuth refresh token and cached access token — and clears the capability\'s provider choice when it pointed at this integration. Settings such as base URLs are left alone.
|
|
1716
|
+
* Disconnect an integration
|
|
1717
|
+
*/
|
|
1718
|
+
async disconnectIntegration(requestParameters: DisconnectIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Business> {
|
|
1719
|
+
const response = await this.disconnectIntegrationRaw(requestParameters, initOverrides);
|
|
1720
|
+
return await response.value();
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1596
1723
|
/**
|
|
1597
1724
|
* Creates request options for endImpersonation without sending the request
|
|
1598
1725
|
*/
|
|
@@ -5786,8 +5913,8 @@ export class PlatformClient extends runtime.BaseAPI {
|
|
|
5786
5913
|
}
|
|
5787
5914
|
|
|
5788
5915
|
/**
|
|
5789
|
-
* Returns the non-secret Sanity project id and dataset a studio should point at for the given host. A tenant host returns that tenant\'s project; a host that belongs to no business (the platform host) returns the shared platform project. No read/write token is returned — the studio authenticates the user via Sanity login — so this is a public endpoint safe to call from a browser.
|
|
5790
|
-
* Resolve the Sanity Studio project/dataset for a host
|
|
5916
|
+
* Returns the non-secret Sanity project id and dataset a studio should point at for the given host, plus that tenant\'s frontend app URLs so document \'Vis side\' links resolve per tenant. A tenant host returns that tenant\'s project; a host that belongs to no business (the platform host) returns the shared platform project and no app URLs. No read/write token is returned — the studio authenticates the user via Sanity login — so this is a public endpoint safe to call from a browser.
|
|
5917
|
+
* Resolve the Sanity Studio project/dataset and frontend URLs for a host
|
|
5791
5918
|
*/
|
|
5792
5919
|
async resolveStudioSanityConfigRaw(requestParameters: ResolveStudioSanityConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudioSanityConfig>> {
|
|
5793
5920
|
const requestOptions = await this.resolveStudioSanityConfigRequestOpts(requestParameters);
|
|
@@ -5797,8 +5924,8 @@ export class PlatformClient extends runtime.BaseAPI {
|
|
|
5797
5924
|
}
|
|
5798
5925
|
|
|
5799
5926
|
/**
|
|
5800
|
-
* Returns the non-secret Sanity project id and dataset a studio should point at for the given host. A tenant host returns that tenant\'s project; a host that belongs to no business (the platform host) returns the shared platform project. No read/write token is returned — the studio authenticates the user via Sanity login — so this is a public endpoint safe to call from a browser.
|
|
5801
|
-
* Resolve the Sanity Studio project/dataset for a host
|
|
5927
|
+
* Returns the non-secret Sanity project id and dataset a studio should point at for the given host, plus that tenant\'s frontend app URLs so document \'Vis side\' links resolve per tenant. A tenant host returns that tenant\'s project; a host that belongs to no business (the platform host) returns the shared platform project and no app URLs. No read/write token is returned — the studio authenticates the user via Sanity login — so this is a public endpoint safe to call from a browser.
|
|
5928
|
+
* Resolve the Sanity Studio project/dataset and frontend URLs for a host
|
|
5802
5929
|
*/
|
|
5803
5930
|
async resolveStudioSanityConfig(requestParameters: ResolveStudioSanityConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudioSanityConfig> {
|
|
5804
5931
|
const response = await this.resolveStudioSanityConfigRaw(requestParameters, initOverrides);
|
|
@@ -6219,68 +6346,6 @@ export class PlatformClient extends runtime.BaseAPI {
|
|
|
6219
6346
|
await this.setAccountingReinvoiceProductRaw(requestParameters, initOverrides);
|
|
6220
6347
|
}
|
|
6221
6348
|
|
|
6222
|
-
/**
|
|
6223
|
-
* Creates request options for setActiveProvider without sending the request
|
|
6224
|
-
*/
|
|
6225
|
-
async setActiveProviderRequestOpts(requestParameters: SetActiveProviderOperationRequest): Promise<runtime.RequestOpts> {
|
|
6226
|
-
if (requestParameters['id'] == null) {
|
|
6227
|
-
throw new runtime.RequiredError(
|
|
6228
|
-
'id',
|
|
6229
|
-
'Required parameter "id" was null or undefined when calling setActiveProvider().'
|
|
6230
|
-
);
|
|
6231
|
-
}
|
|
6232
|
-
|
|
6233
|
-
if (requestParameters['setActiveProviderRequest'] == null) {
|
|
6234
|
-
throw new runtime.RequiredError(
|
|
6235
|
-
'setActiveProviderRequest',
|
|
6236
|
-
'Required parameter "setActiveProviderRequest" was null or undefined when calling setActiveProvider().'
|
|
6237
|
-
);
|
|
6238
|
-
}
|
|
6239
|
-
|
|
6240
|
-
const queryParameters: any = {};
|
|
6241
|
-
|
|
6242
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
6243
|
-
|
|
6244
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
6245
|
-
|
|
6246
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
6247
|
-
// oauth required
|
|
6248
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("Implicit", []);
|
|
6249
|
-
}
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
let urlPath = `/v1.0/protected/businesses/{id}/integrations/active`;
|
|
6253
|
-
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
6254
|
-
|
|
6255
|
-
return {
|
|
6256
|
-
path: urlPath,
|
|
6257
|
-
method: 'PUT',
|
|
6258
|
-
headers: headerParameters,
|
|
6259
|
-
query: queryParameters,
|
|
6260
|
-
body: requestParameters['setActiveProviderRequest'],
|
|
6261
|
-
};
|
|
6262
|
-
}
|
|
6263
|
-
|
|
6264
|
-
/**
|
|
6265
|
-
* When a capability has several providers (e.g. PowerOffice vs Tripletex, Coinbase API-key vs OAuth), selects which one the business uses.
|
|
6266
|
-
* Choose the active provider for a capability
|
|
6267
|
-
*/
|
|
6268
|
-
async setActiveProviderRaw(requestParameters: SetActiveProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Business>> {
|
|
6269
|
-
const requestOptions = await this.setActiveProviderRequestOpts(requestParameters);
|
|
6270
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
6271
|
-
|
|
6272
|
-
return new runtime.JSONApiResponse(response);
|
|
6273
|
-
}
|
|
6274
|
-
|
|
6275
|
-
/**
|
|
6276
|
-
* When a capability has several providers (e.g. PowerOffice vs Tripletex, Coinbase API-key vs OAuth), selects which one the business uses.
|
|
6277
|
-
* Choose the active provider for a capability
|
|
6278
|
-
*/
|
|
6279
|
-
async setActiveProvider(requestParameters: SetActiveProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Business> {
|
|
6280
|
-
const response = await this.setActiveProviderRaw(requestParameters, initOverrides);
|
|
6281
|
-
return await response.value();
|
|
6282
|
-
}
|
|
6283
|
-
|
|
6284
6349
|
/**
|
|
6285
6350
|
* Creates request options for setBusinessEmployeePhoto without sending the request
|
|
6286
6351
|
*/
|
package/src/models/index.ts
CHANGED
|
@@ -948,6 +948,25 @@ export interface Capability {
|
|
|
948
948
|
*/
|
|
949
949
|
platformProvided?: boolean | null;
|
|
950
950
|
}
|
|
951
|
+
/**
|
|
952
|
+
*
|
|
953
|
+
* @export
|
|
954
|
+
* @interface ChooseProviderRequest
|
|
955
|
+
*/
|
|
956
|
+
export interface ChooseProviderRequest {
|
|
957
|
+
/**
|
|
958
|
+
*
|
|
959
|
+
* @type {string}
|
|
960
|
+
* @memberof ChooseProviderRequest
|
|
961
|
+
*/
|
|
962
|
+
capability?: string | null;
|
|
963
|
+
/**
|
|
964
|
+
*
|
|
965
|
+
* @type {string}
|
|
966
|
+
* @memberof ChooseProviderRequest
|
|
967
|
+
*/
|
|
968
|
+
integrationKey?: string | null;
|
|
969
|
+
}
|
|
951
970
|
/**
|
|
952
971
|
*
|
|
953
972
|
* @export
|
|
@@ -2201,13 +2220,13 @@ export interface IntegrationSummary {
|
|
|
2201
2220
|
* @type {boolean}
|
|
2202
2221
|
* @memberof IntegrationSummary
|
|
2203
2222
|
*/
|
|
2204
|
-
|
|
2223
|
+
isConfigured?: boolean | null;
|
|
2205
2224
|
/**
|
|
2206
2225
|
*
|
|
2207
2226
|
* @type {boolean}
|
|
2208
2227
|
* @memberof IntegrationSummary
|
|
2209
2228
|
*/
|
|
2210
|
-
|
|
2229
|
+
isInUse?: boolean | null;
|
|
2211
2230
|
/**
|
|
2212
2231
|
*
|
|
2213
2232
|
* @type {string}
|
|
@@ -5548,25 +5567,6 @@ export interface SessionBootstrapRequest {
|
|
|
5548
5567
|
*/
|
|
5549
5568
|
bootstrapToken?: string | null;
|
|
5550
5569
|
}
|
|
5551
|
-
/**
|
|
5552
|
-
*
|
|
5553
|
-
* @export
|
|
5554
|
-
* @interface SetActiveProviderRequest
|
|
5555
|
-
*/
|
|
5556
|
-
export interface SetActiveProviderRequest {
|
|
5557
|
-
/**
|
|
5558
|
-
*
|
|
5559
|
-
* @type {string}
|
|
5560
|
-
* @memberof SetActiveProviderRequest
|
|
5561
|
-
*/
|
|
5562
|
-
capability?: string | null;
|
|
5563
|
-
/**
|
|
5564
|
-
*
|
|
5565
|
-
* @type {string}
|
|
5566
|
-
* @memberof SetActiveProviderRequest
|
|
5567
|
-
*/
|
|
5568
|
-
integrationKey?: string | null;
|
|
5569
|
-
}
|
|
5570
5570
|
/**
|
|
5571
5571
|
*
|
|
5572
5572
|
* @export
|
|
@@ -5902,6 +5902,12 @@ export interface StartImpersonationResult {
|
|
|
5902
5902
|
* @interface StudioSanityConfig
|
|
5903
5903
|
*/
|
|
5904
5904
|
export interface StudioSanityConfig {
|
|
5905
|
+
/**
|
|
5906
|
+
*
|
|
5907
|
+
* @type {{ [key: string]: string; }}
|
|
5908
|
+
* @memberof StudioSanityConfig
|
|
5909
|
+
*/
|
|
5910
|
+
appUrls?: { [key: string]: string; } | null;
|
|
5905
5911
|
/**
|
|
5906
5912
|
*
|
|
5907
5913
|
* @type {string}
|