@widgetic/api-sdk-ts 2.0.2 → 3.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/dist/apis/CompositionsApi.d.ts +1 -0
- package/dist/apis/CompositionsApi.js +3 -0
- package/dist/apis/CreditsApi.d.ts +4 -4
- package/dist/apis/CreditsApi.js +4 -4
- package/dist/apis/ManagedUsersApi.d.ts +2 -2
- package/dist/apis/ManagedUsersApi.js +2 -2
- package/dist/apis/OrganizationsApi.d.ts +74 -0
- package/dist/apis/OrganizationsApi.js +205 -0
- package/dist/apis/PartnersApi.d.ts +8 -8
- package/dist/apis/PartnersApi.js +8 -8
- package/dist/apis/TokensApi.d.ts +2 -2
- package/dist/apis/TokensApi.js +2 -2
- package/dist/apis/UploadsApi.d.ts +4 -4
- package/dist/apis/UploadsApi.js +4 -4
- package/dist/apis/UsersApi.d.ts +3 -59
- package/dist/apis/UsersApi.js +2 -150
- package/dist/apis/WidgetsApi.d.ts +2 -2
- package/dist/apis/WidgetsApi.js +2 -2
- package/dist/apis/WorkflowsApi.d.ts +38 -38
- package/dist/apis/WorkflowsApi.js +38 -38
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/CompositionsApi.js +3 -0
- package/dist/esm/apis/CreditsApi.js +4 -4
- package/dist/esm/apis/ManagedUsersApi.js +2 -2
- package/dist/esm/apis/OrganizationsApi.js +168 -0
- package/dist/esm/apis/PartnersApi.js +8 -8
- package/dist/esm/apis/TokensApi.js +2 -2
- package/dist/esm/apis/UploadsApi.js +4 -4
- package/dist/esm/apis/UsersApi.js +3 -151
- package/dist/esm/apis/WidgetsApi.js +2 -2
- package/dist/esm/apis/WorkflowsApi.js +38 -38
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/{GetPersonalWorkspaceDomains200Response.js → AddOrganizationDomainResponse.js} +11 -11
- package/dist/esm/models/AddOrganizationDomainResponseData.js +44 -0
- package/dist/esm/models/Canvas.js +3 -0
- package/dist/esm/models/CanvasActiveOperation.js +66 -0
- package/dist/esm/models/CreateWidget201ResponseData.js +6 -0
- package/dist/esm/models/{PersonalWorkspaceDomainResultResponse.js → DeleteOrganizationDomainResponse.js} +11 -11
- package/dist/esm/models/DeleteOrganizationDomainResponseData.js +41 -0
- package/dist/esm/models/EditorSession.js +4 -0
- package/dist/esm/models/GetOperationResponseDataMetadata.js +11 -0
- package/dist/esm/models/GetOrganizationDomains200Response.js +51 -0
- package/dist/esm/models/NewWidget.js +0 -1
- package/dist/esm/models/{PersonalWorkspaceDomain.js → OrganizationDomain.js} +12 -18
- package/dist/esm/models/{DeletePersonalWorkspaceDomainResponse.js → UpdateOrganizationDomainResponse.js} +11 -11
- package/dist/esm/models/Upload.js +2 -0
- package/dist/esm/models/UserApiKey.js +2 -0
- package/dist/esm/models/ValidateToken200ResponseData.js +3 -0
- package/dist/esm/models/ValidateToken200ResponseDataWorkspace.js +43 -0
- package/dist/esm/models/Widget.js +6 -0
- package/dist/esm/models/WidgetClarificationQuestion.js +4 -0
- package/dist/esm/models/WidgetCodeChange.js +68 -0
- package/dist/esm/models/WidgetCodeChanges.js +48 -0
- package/dist/esm/models/WidgetNextStep.js +4 -0
- package/dist/esm/models/index.js +11 -6
- package/dist/esm/runtime.js +1 -1
- package/dist/models/AccountCreditBalance.d.ts +2 -2
- package/dist/models/AddOrganizationDomainResponse.d.ts +46 -0
- package/dist/models/AddOrganizationDomainResponse.js +58 -0
- package/dist/models/AddOrganizationDomainResponseData.d.ts +39 -0
- package/dist/models/AddOrganizationDomainResponseData.js +51 -0
- package/dist/models/Canvas.d.ts +7 -0
- package/dist/models/Canvas.js +3 -0
- package/dist/models/CanvasActiveOperation.d.ts +65 -0
- package/dist/models/CanvasActiveOperation.js +74 -0
- package/dist/models/CreateWidget201ResponseData.d.ts +18 -0
- package/dist/models/CreateWidget201ResponseData.js +6 -0
- package/dist/models/DeleteOrganizationDomainResponse.d.ts +46 -0
- package/dist/models/DeleteOrganizationDomainResponse.js +58 -0
- package/dist/models/DeleteOrganizationDomainResponseData.d.ts +32 -0
- package/dist/models/DeleteOrganizationDomainResponseData.js +48 -0
- package/dist/models/EditorSession.d.ts +7 -0
- package/dist/models/EditorSession.js +4 -0
- package/dist/models/GetOperationResponseDataMetadata.d.ts +23 -1
- package/dist/models/GetOperationResponseDataMetadata.js +12 -1
- package/dist/models/GetOrganizationDomains200Response.d.ts +46 -0
- package/dist/models/GetOrganizationDomains200Response.js +58 -0
- package/dist/models/NewEditorSession.d.ts +1 -1
- package/dist/models/NewWidget.d.ts +2 -3
- package/dist/models/NewWidget.js +0 -1
- package/dist/models/OrganizationDomain.d.ts +56 -0
- package/dist/models/OrganizationDomain.js +56 -0
- package/dist/models/PartnerBillingOverviewOperationalCredits.d.ts +1 -1
- package/dist/models/UpdateOrganizationDomainResponse.d.ts +46 -0
- package/dist/models/UpdateOrganizationDomainResponse.js +58 -0
- package/dist/models/Upload.d.ts +6 -0
- package/dist/models/Upload.js +2 -0
- package/dist/models/UserApiKey.d.ts +6 -0
- package/dist/models/UserApiKey.js +2 -0
- package/dist/models/ValidateToken200ResponseData.d.ts +7 -0
- package/dist/models/ValidateToken200ResponseData.js +3 -0
- package/dist/models/ValidateToken200ResponseDataWorkspace.d.ts +38 -0
- package/dist/models/ValidateToken200ResponseDataWorkspace.js +50 -0
- package/dist/models/Widget.d.ts +18 -0
- package/dist/models/Widget.js +6 -0
- package/dist/models/WidgetClarificationQuestion.d.ts +6 -0
- package/dist/models/WidgetClarificationQuestion.js +4 -0
- package/dist/models/WidgetCodeChange.d.ts +70 -0
- package/dist/models/WidgetCodeChange.js +76 -0
- package/dist/models/WidgetCodeChanges.d.ts +39 -0
- package/dist/models/WidgetCodeChanges.js +55 -0
- package/dist/models/WidgetNextStep.d.ts +7 -1
- package/dist/models/WidgetNextStep.js +4 -0
- package/dist/models/WorkflowDetailAllOfLastEditedBy.d.ts +2 -2
- package/dist/models/index.d.ts +11 -6
- package/dist/models/index.js +11 -6
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +1 -1
- package/package.json +1 -1
- package/dist/esm/models/DeletePersonalWorkspaceDomainResponseData.js +0 -41
- package/dist/esm/models/PersonalWorkspaceDomainResult.js +0 -48
- package/dist/models/DeletePersonalWorkspaceDomainResponse.d.ts +0 -46
- package/dist/models/DeletePersonalWorkspaceDomainResponse.js +0 -58
- package/dist/models/DeletePersonalWorkspaceDomainResponseData.d.ts +0 -32
- package/dist/models/DeletePersonalWorkspaceDomainResponseData.js +0 -48
- package/dist/models/GetPersonalWorkspaceDomains200Response.d.ts +0 -46
- package/dist/models/GetPersonalWorkspaceDomains200Response.js +0 -58
- package/dist/models/PersonalWorkspaceDomain.d.ts +0 -56
- package/dist/models/PersonalWorkspaceDomain.js +0 -62
- package/dist/models/PersonalWorkspaceDomainResult.d.ts +0 -39
- package/dist/models/PersonalWorkspaceDomainResult.js +0 -55
- package/dist/models/PersonalWorkspaceDomainResultResponse.d.ts +0 -46
- package/dist/models/PersonalWorkspaceDomainResultResponse.js +0 -58
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Widgetic API Gateway
|
|
5
|
+
* API documentation for the Widgetic API Gateway
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime.js';
|
|
15
|
+
import { AddDomainRequestToJSON, AddOrganizationDomainResponseFromJSON, DeleteOrganizationDomainResponseFromJSON, GetOrganizationDomains200ResponseFromJSON, UpdateDomainRequestToJSON, UpdateOrganizationDomainResponseFromJSON, } from '../models/index.js';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class OrganizationsApi extends runtime.BaseAPI {
|
|
20
|
+
/**
|
|
21
|
+
* Adds a new domain to the workspace\'s allowed domains list for widget embedding restrictions. The list of an ordinary workspace holds at most 50 websites (a 409 says so); the home workspace of a partner has no limit, because a partner adds its customers\' websites by code.
|
|
22
|
+
* Add Organization Allowed Domain
|
|
23
|
+
*/
|
|
24
|
+
async addOrganizationDomainRaw(requestParameters, initOverrides) {
|
|
25
|
+
if (requestParameters['orgId'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling addOrganizationDomain().');
|
|
27
|
+
}
|
|
28
|
+
if (requestParameters['addDomainRequest'] == null) {
|
|
29
|
+
throw new runtime.RequiredError('addDomainRequest', 'Required parameter "addDomainRequest" was null or undefined when calling addOrganizationDomain().');
|
|
30
|
+
}
|
|
31
|
+
const queryParameters = {};
|
|
32
|
+
const headerParameters = {};
|
|
33
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
34
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
35
|
+
const token = this.configuration.accessToken;
|
|
36
|
+
const tokenString = await token("apiKeyAuth", []);
|
|
37
|
+
if (tokenString) {
|
|
38
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const response = await this.request({
|
|
42
|
+
path: `/organizations/{orgId}/domains`.replace(`{${"orgId"}}`, encodeURIComponent(String(requestParameters['orgId']))),
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters,
|
|
46
|
+
body: AddDomainRequestToJSON(requestParameters['addDomainRequest']),
|
|
47
|
+
}, initOverrides);
|
|
48
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AddOrganizationDomainResponseFromJSON(jsonValue));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Adds a new domain to the workspace\'s allowed domains list for widget embedding restrictions. The list of an ordinary workspace holds at most 50 websites (a 409 says so); the home workspace of a partner has no limit, because a partner adds its customers\' websites by code.
|
|
52
|
+
* Add Organization Allowed Domain
|
|
53
|
+
*/
|
|
54
|
+
async addOrganizationDomain(requestParameters, initOverrides) {
|
|
55
|
+
const response = await this.addOrganizationDomainRaw(requestParameters, initOverrides);
|
|
56
|
+
return await response.value();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Removes a domain from the organization\'s allowed domains list
|
|
60
|
+
* Delete Organization Allowed Domain
|
|
61
|
+
*/
|
|
62
|
+
async deleteOrganizationDomainRaw(requestParameters, initOverrides) {
|
|
63
|
+
if (requestParameters['orgId'] == null) {
|
|
64
|
+
throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling deleteOrganizationDomain().');
|
|
65
|
+
}
|
|
66
|
+
if (requestParameters['domainId'] == null) {
|
|
67
|
+
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling deleteOrganizationDomain().');
|
|
68
|
+
}
|
|
69
|
+
const queryParameters = {};
|
|
70
|
+
const headerParameters = {};
|
|
71
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
72
|
+
const token = this.configuration.accessToken;
|
|
73
|
+
const tokenString = await token("apiKeyAuth", []);
|
|
74
|
+
if (tokenString) {
|
|
75
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const response = await this.request({
|
|
79
|
+
path: `/organizations/{orgId}/domains/{domainId}`.replace(`{${"orgId"}}`, encodeURIComponent(String(requestParameters['orgId']))).replace(`{${"domainId"}}`, encodeURIComponent(String(requestParameters['domainId']))),
|
|
80
|
+
method: 'DELETE',
|
|
81
|
+
headers: headerParameters,
|
|
82
|
+
query: queryParameters,
|
|
83
|
+
}, initOverrides);
|
|
84
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteOrganizationDomainResponseFromJSON(jsonValue));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Removes a domain from the organization\'s allowed domains list
|
|
88
|
+
* Delete Organization Allowed Domain
|
|
89
|
+
*/
|
|
90
|
+
async deleteOrganizationDomain(requestParameters, initOverrides) {
|
|
91
|
+
const response = await this.deleteOrganizationDomainRaw(requestParameters, initOverrides);
|
|
92
|
+
return await response.value();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Lists the websites on a workspace\'s own list, newest first. It is the list Widgetic checks when a widget of the workspace is embedded: when it holds at least one website, the widget is shown on those websites (and on Widgetic\'s own) and nowhere else; when it is empty, the widget can be shown anywhere. A partner\'s home workspace also has the websites set on the partner record by Widgetic added to its list, and those are not in this answer. The answer holds the whole list, however long it is: a partner\'s list has no limit.
|
|
96
|
+
* Get Organization Allowed Domains
|
|
97
|
+
*/
|
|
98
|
+
async getOrganizationDomainsRaw(requestParameters, initOverrides) {
|
|
99
|
+
if (requestParameters['orgId'] == null) {
|
|
100
|
+
throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling getOrganizationDomains().');
|
|
101
|
+
}
|
|
102
|
+
const queryParameters = {};
|
|
103
|
+
const headerParameters = {};
|
|
104
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
105
|
+
const token = this.configuration.accessToken;
|
|
106
|
+
const tokenString = await token("apiKeyAuth", []);
|
|
107
|
+
if (tokenString) {
|
|
108
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const response = await this.request({
|
|
112
|
+
path: `/organizations/{orgId}/domains`.replace(`{${"orgId"}}`, encodeURIComponent(String(requestParameters['orgId']))),
|
|
113
|
+
method: 'GET',
|
|
114
|
+
headers: headerParameters,
|
|
115
|
+
query: queryParameters,
|
|
116
|
+
}, initOverrides);
|
|
117
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetOrganizationDomains200ResponseFromJSON(jsonValue));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Lists the websites on a workspace\'s own list, newest first. It is the list Widgetic checks when a widget of the workspace is embedded: when it holds at least one website, the widget is shown on those websites (and on Widgetic\'s own) and nowhere else; when it is empty, the widget can be shown anywhere. A partner\'s home workspace also has the websites set on the partner record by Widgetic added to its list, and those are not in this answer. The answer holds the whole list, however long it is: a partner\'s list has no limit.
|
|
121
|
+
* Get Organization Allowed Domains
|
|
122
|
+
*/
|
|
123
|
+
async getOrganizationDomains(requestParameters, initOverrides) {
|
|
124
|
+
const response = await this.getOrganizationDomainsRaw(requestParameters, initOverrides);
|
|
125
|
+
return await response.value();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Updates an existing domain in the organization\'s allowed domains list
|
|
129
|
+
* Update Organization Allowed Domain
|
|
130
|
+
*/
|
|
131
|
+
async updateOrganizationDomainRaw(requestParameters, initOverrides) {
|
|
132
|
+
if (requestParameters['orgId'] == null) {
|
|
133
|
+
throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling updateOrganizationDomain().');
|
|
134
|
+
}
|
|
135
|
+
if (requestParameters['domainId'] == null) {
|
|
136
|
+
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling updateOrganizationDomain().');
|
|
137
|
+
}
|
|
138
|
+
if (requestParameters['updateDomainRequest'] == null) {
|
|
139
|
+
throw new runtime.RequiredError('updateDomainRequest', 'Required parameter "updateDomainRequest" was null or undefined when calling updateOrganizationDomain().');
|
|
140
|
+
}
|
|
141
|
+
const queryParameters = {};
|
|
142
|
+
const headerParameters = {};
|
|
143
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
144
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
145
|
+
const token = this.configuration.accessToken;
|
|
146
|
+
const tokenString = await token("apiKeyAuth", []);
|
|
147
|
+
if (tokenString) {
|
|
148
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const response = await this.request({
|
|
152
|
+
path: `/organizations/{orgId}/domains/{domainId}`.replace(`{${"orgId"}}`, encodeURIComponent(String(requestParameters['orgId']))).replace(`{${"domainId"}}`, encodeURIComponent(String(requestParameters['domainId']))),
|
|
153
|
+
method: 'PUT',
|
|
154
|
+
headers: headerParameters,
|
|
155
|
+
query: queryParameters,
|
|
156
|
+
body: UpdateDomainRequestToJSON(requestParameters['updateDomainRequest']),
|
|
157
|
+
}, initOverrides);
|
|
158
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UpdateOrganizationDomainResponseFromJSON(jsonValue));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Updates an existing domain in the organization\'s allowed domains list
|
|
162
|
+
* Update Organization Allowed Domain
|
|
163
|
+
*/
|
|
164
|
+
async updateOrganizationDomain(requestParameters, initOverrides) {
|
|
165
|
+
const response = await this.updateOrganizationDomainRaw(requestParameters, initOverrides);
|
|
166
|
+
return await response.value();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -106,7 +106,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
106
106
|
return await response.value();
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet), `suspended` (paused, with the reason Widgetic gave) or `payment_arrears` (a contract invoice is past its due date and unpaid, since `overdueSince`; the partner is stopped until it is paid). A partner API key is that account\'s key, so
|
|
109
|
+
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet), `suspended` (paused, with the reason Widgetic gave) or `payment_arrears` (a contract invoice is past its due date and unpaid, since `overdueSince`; the partner is stopped until it is paid). A partner API key (`wgt_prt_`) is that account\'s key, and so is a workspace key (`wdg_org_`) of the partner\'s home workspace, so either reads its own partner here. An account that administers no partner is not refused: it gets `standing: not_a_partner` and an empty list, so a dashboard can tell \"this is not a partner account\" from \"something failed\". The call stays open while the partner is paused, not yet active or in payment arrears: that is when its dashboard has to say why.
|
|
110
110
|
* Find the partner you administer
|
|
111
111
|
*/
|
|
112
112
|
async getMyPartnersRaw(initOverrides) {
|
|
@@ -128,7 +128,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
128
128
|
return new runtime.JSONApiResponse(response, (jsonValue) => MyPartnersResponseFromJSON(jsonValue));
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet), `suspended` (paused, with the reason Widgetic gave) or `payment_arrears` (a contract invoice is past its due date and unpaid, since `overdueSince`; the partner is stopped until it is paid). A partner API key is that account\'s key, so
|
|
131
|
+
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet), `suspended` (paused, with the reason Widgetic gave) or `payment_arrears` (a contract invoice is past its due date and unpaid, since `overdueSince`; the partner is stopped until it is paid). A partner API key (`wgt_prt_`) is that account\'s key, and so is a workspace key (`wdg_org_`) of the partner\'s home workspace, so either reads its own partner here. An account that administers no partner is not refused: it gets `standing: not_a_partner` and an empty list, so a dashboard can tell \"this is not a partner account\" from \"something failed\". The call stays open while the partner is paused, not yet active or in payment arrears: that is when its dashboard has to say why.
|
|
132
132
|
* Find the partner you administer
|
|
133
133
|
*/
|
|
134
134
|
async getMyPartners(initOverrides) {
|
|
@@ -352,7 +352,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
352
352
|
return await response.value();
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
|
-
* Retrieves the partner\'s credits (`operationalCredits`), the partner\'s contract terms (`partnerCustomization`, the same fields as `getPartnerContract`) and billing integration status. Internal negotiation notes are not part of it. `operationalCredits` is the one account a partner has for its credits: the account of the person who administers it. It holds `balance` (the same balance `getPartnerCreditBalance` reads), `reservedBalance`, `availableBalance` (what a new operation can use) and `recentTransactions` (the ten newest entries of the ledger `getPartnerCreditTransactions` lists). A partner with no administrator has no account, and reads 0 and an empty list.
|
|
355
|
+
* Retrieves the partner\'s credits (`operationalCredits`), the partner\'s contract terms (`partnerCustomization`, the same fields as `getPartnerContract`) and billing integration status. Internal negotiation notes are not part of it. `operationalCredits` is the credits of the partner\'s workspace, held in the one account a partner has for its credits: the account of the person who administers it. It holds `balance` (the same balance `getPartnerCreditBalance` reads), `reservedBalance`, `availableBalance` (what a new operation can use) and `recentTransactions` (the ten newest entries of the ledger `getPartnerCreditTransactions` lists). A partner with no administrator has no account, and reads 0 and an empty list.
|
|
356
356
|
* Get comprehensive partner billing overview
|
|
357
357
|
*/
|
|
358
358
|
async getPartnerBillingOverviewRaw(requestParameters, initOverrides) {
|
|
@@ -377,7 +377,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
377
377
|
return new runtime.JSONApiResponse(response, (jsonValue) => GetPartnerBillingOverview200ResponseFromJSON(jsonValue));
|
|
378
378
|
}
|
|
379
379
|
/**
|
|
380
|
-
* Retrieves the partner\'s credits (`operationalCredits`), the partner\'s contract terms (`partnerCustomization`, the same fields as `getPartnerContract`) and billing integration status. Internal negotiation notes are not part of it. `operationalCredits` is the one account a partner has for its credits: the account of the person who administers it. It holds `balance` (the same balance `getPartnerCreditBalance` reads), `reservedBalance`, `availableBalance` (what a new operation can use) and `recentTransactions` (the ten newest entries of the ledger `getPartnerCreditTransactions` lists). A partner with no administrator has no account, and reads 0 and an empty list.
|
|
380
|
+
* Retrieves the partner\'s credits (`operationalCredits`), the partner\'s contract terms (`partnerCustomization`, the same fields as `getPartnerContract`) and billing integration status. Internal negotiation notes are not part of it. `operationalCredits` is the credits of the partner\'s workspace, held in the one account a partner has for its credits: the account of the person who administers it. It holds `balance` (the same balance `getPartnerCreditBalance` reads), `reservedBalance`, `availableBalance` (what a new operation can use) and `recentTransactions` (the ten newest entries of the ledger `getPartnerCreditTransactions` lists). A partner with no administrator has no account, and reads 0 and an empty list.
|
|
381
381
|
* Get comprehensive partner billing overview
|
|
382
382
|
*/
|
|
383
383
|
async getPartnerBillingOverview(requestParameters, initOverrides) {
|
|
@@ -418,7 +418,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
418
418
|
return await response.value();
|
|
419
419
|
}
|
|
420
420
|
/**
|
|
421
|
-
* Returns the credits the partner has, and how much of that is reserved by operations that are still running. A partner
|
|
421
|
+
* Returns the credits the partner has, and how much of that is reserved by operations that are still running. A partner\'s credits belong to its own workspace, the one that is made with the partner, and are all held in ONE account: the account of the person who administers it, the same account its API key acts as. There is nothing else to create or to fund. What its customers\' editor sessions and its own API calls spend comes out of that workspace, and the credits a paid invoice carries are added to it, so this is the balance of the partner\'s workspace, where `getUserCreditBalance` reads the workspace the request acts in. The other workspaces its administrator may own hold credits of their own, which are not the partner\'s and are not in this balance. A partner with no administrator has no account to hold credits, and reads a balance of 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
422
422
|
* Get partner credit balance
|
|
423
423
|
*/
|
|
424
424
|
async getPartnerCreditBalanceRaw(requestParameters, initOverrides) {
|
|
@@ -443,7 +443,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
443
443
|
return new runtime.JSONApiResponse(response, (jsonValue) => AccountCreditBalanceResponseFromJSON(jsonValue));
|
|
444
444
|
}
|
|
445
445
|
/**
|
|
446
|
-
* Returns the credits the partner has, and how much of that is reserved by operations that are still running. A partner
|
|
446
|
+
* Returns the credits the partner has, and how much of that is reserved by operations that are still running. A partner\'s credits belong to its own workspace, the one that is made with the partner, and are all held in ONE account: the account of the person who administers it, the same account its API key acts as. There is nothing else to create or to fund. What its customers\' editor sessions and its own API calls spend comes out of that workspace, and the credits a paid invoice carries are added to it, so this is the balance of the partner\'s workspace, where `getUserCreditBalance` reads the workspace the request acts in. The other workspaces its administrator may own hold credits of their own, which are not the partner\'s and are not in this balance. A partner with no administrator has no account to hold credits, and reads a balance of 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
447
447
|
* Get partner credit balance
|
|
448
448
|
*/
|
|
449
449
|
async getPartnerCreditBalance(requestParameters, initOverrides) {
|
|
@@ -451,7 +451,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
451
451
|
return await response.value();
|
|
452
452
|
}
|
|
453
453
|
/**
|
|
454
|
-
* Lists what happened to the partner\'s credits, newest first: the entries of the credit ledger of the account of the person who administers it, the one account a partner has for its credits. Every operation that spends credits is a `debit` entry,
|
|
454
|
+
* Lists what happened to the partner\'s credits, newest first: the entries of the credit ledger of the partner\'s workspace, held in the account of the person who administers it, the one account a partner has for its credits. Every operation that spends credits is a `debit` entry, the credits an invoice carried arrive as `credit` entries when the invoice is paid, and the credits of a contract period that end are an `expiration` entry, so this is also how the partner\'s usage is read. It is the statement of the partner\'s workspace, where `getUserCreditTransactions` reads the workspace the request acts in; the entries of the other workspaces its administrator may own are not in it. A partner with no administrator has no account, and an empty ledger. The page is always bounded: `limit` defaults to 20 and is capped at 100, `offset` defaults to 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
455
455
|
* Get partner credit transaction history
|
|
456
456
|
*/
|
|
457
457
|
async getPartnerCreditTransactionsRaw(requestParameters, initOverrides) {
|
|
@@ -485,7 +485,7 @@ export class PartnersApi extends runtime.BaseAPI {
|
|
|
485
485
|
return new runtime.JSONApiResponse(response, (jsonValue) => AccountCreditTransactionListResponseFromJSON(jsonValue));
|
|
486
486
|
}
|
|
487
487
|
/**
|
|
488
|
-
* Lists what happened to the partner\'s credits, newest first: the entries of the credit ledger of the account of the person who administers it, the one account a partner has for its credits. Every operation that spends credits is a `debit` entry,
|
|
488
|
+
* Lists what happened to the partner\'s credits, newest first: the entries of the credit ledger of the partner\'s workspace, held in the account of the person who administers it, the one account a partner has for its credits. Every operation that spends credits is a `debit` entry, the credits an invoice carried arrive as `credit` entries when the invoice is paid, and the credits of a contract period that end are an `expiration` entry, so this is also how the partner\'s usage is read. It is the statement of the partner\'s workspace, where `getUserCreditTransactions` reads the workspace the request acts in; the entries of the other workspaces its administrator may own are not in it. A partner with no administrator has no account, and an empty ledger. The page is always bounded: `limit` defaults to 20 and is capped at 100, `offset` defaults to 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
489
489
|
* Get partner credit transaction history
|
|
490
490
|
*/
|
|
491
491
|
async getPartnerCreditTransactions(requestParameters, initOverrides) {
|
|
@@ -18,7 +18,7 @@ import { ValidateToken200ResponseFromJSON, } from '../models/index.js';
|
|
|
18
18
|
*/
|
|
19
19
|
export class TokensApi extends runtime.BaseAPI {
|
|
20
20
|
/**
|
|
21
|
-
* Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`)
|
|
21
|
+
* Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`), the account it belongs to (`userId`) and the workspace it works in (`workspace`). An API key works in the one workspace it was made for, whichever workspace its owner is looking at on widgetic.com; a signed-in session names none (`workspace` is null), and follows the workspace the person has chosen. A credential that belongs to the platform itself, and not to a customer\'s account, is held to no scope: it is answered with `tokenType` `service_key`, `scopes` `[\"*:*\"]`, no `userId` and no `workspace`.
|
|
22
22
|
* Validate current authentication token
|
|
23
23
|
*/
|
|
24
24
|
async validateTokenRaw(initOverrides) {
|
|
@@ -43,7 +43,7 @@ export class TokensApi extends runtime.BaseAPI {
|
|
|
43
43
|
return new runtime.JSONApiResponse(response, (jsonValue) => ValidateToken200ResponseFromJSON(jsonValue));
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`)
|
|
46
|
+
* Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`), the account it belongs to (`userId`) and the workspace it works in (`workspace`). An API key works in the one workspace it was made for, whichever workspace its owner is looking at on widgetic.com; a signed-in session names none (`workspace` is null), and follows the workspace the person has chosen. A credential that belongs to the platform itself, and not to a customer\'s account, is held to no scope: it is answered with `tokenType` `service_key`, `scopes` `[\"*:*\"]`, no `userId` and no `workspace`.
|
|
47
47
|
* Validate current authentication token
|
|
48
48
|
*/
|
|
49
49
|
async validateToken(initOverrides) {
|
|
@@ -18,7 +18,7 @@ import { DeleteUpload200ResponseFromJSON, ListUploads200ResponseFromJSON, Upload
|
|
|
18
18
|
*/
|
|
19
19
|
export class UploadsApi extends runtime.BaseAPI {
|
|
20
20
|
/**
|
|
21
|
-
* Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from
|
|
21
|
+
* Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from the storage allowance it was charged to (the team\'s shared space for a file uploaded in a team workspace); a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. A file you uploaded can always be deleted by you. A file in a team\'s workspace can also be deleted by the owner and by every active member of that team, whoever uploaded it (the files of a workspace are the whole team\'s). An upload that belongs to another account, or to a team you are not a member of, is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
|
|
22
22
|
* Delete an upload
|
|
23
23
|
*/
|
|
24
24
|
async deleteUploadRaw(requestParameters, initOverrides) {
|
|
@@ -43,7 +43,7 @@ export class UploadsApi extends runtime.BaseAPI {
|
|
|
43
43
|
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteUpload200ResponseFromJSON(jsonValue));
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from
|
|
46
|
+
* Removes the stored file and the upload row. A file in Widgetic\'s own storage gives back the space it took from the storage allowance it was charged to (the team\'s shared space for a file uploaded in a team workspace); a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. A file you uploaded can always be deleted by you. A file in a team\'s workspace can also be deleted by the owner and by every active member of that team, whoever uploaded it (the files of a workspace are the whole team\'s). An upload that belongs to another account, or to a team you are not a member of, is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
|
|
47
47
|
* Delete an upload
|
|
48
48
|
*/
|
|
49
49
|
async deleteUpload(requestParameters, initOverrides) {
|
|
@@ -114,7 +114,7 @@ export class UploadsApi extends runtime.BaseAPI {
|
|
|
114
114
|
return await response.value();
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
* The files the
|
|
117
|
+
* The files of the workspace the caller works in, newest first: the workspace\'s shared files (every member\'s, and those of members who have since left). The workspace is the one a person signed in on widgetic.com switched to, or the one an API key or a connection belongs to; an editor session names none and lists the files of the account. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user\'s files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget\'s upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account\'s own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
|
|
118
118
|
* List the account\'s uploads
|
|
119
119
|
*/
|
|
120
120
|
async listUploadsRaw(requestParameters, initOverrides) {
|
|
@@ -145,7 +145,7 @@ export class UploadsApi extends runtime.BaseAPI {
|
|
|
145
145
|
return new runtime.JSONApiResponse(response, (jsonValue) => ListUploads200ResponseFromJSON(jsonValue));
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
* The files the
|
|
148
|
+
* The files of the workspace the caller works in, newest first: the workspace\'s shared files (every member\'s, and those of members who have since left). The workspace is the one a person signed in on widgetic.com switched to, or the one an API key or a connection belongs to; an editor session names none and lists the files of the account. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user\'s files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget\'s upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account\'s own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
|
|
149
149
|
* List the account\'s uploads
|
|
150
150
|
*/
|
|
151
151
|
async listUploads(requestParameters = {}, initOverrides) {
|
|
@@ -12,49 +12,11 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import * as runtime from '../runtime.js';
|
|
15
|
-
import { AdapterConnectionListResponseFromJSON, AdapterConnectionRemovalResponseFromJSON, AdapterConnectionResponseFromJSON,
|
|
15
|
+
import { AdapterConnectionListResponseFromJSON, AdapterConnectionRemovalResponseFromJSON, AdapterConnectionResponseFromJSON, ConfirmAdapterConnectionRequestToJSON, CreateUserApiKeyRequestToJSON, CreatedUserApiKeyResponseFromJSON, DeleteUserApiKeyResponseFromJSON, GetUserApiKeyUsageLogsResponseFromJSON, GetUserApiKeys200ResponseFromJSON, SetAdapterConnectionRequestToJSON, UpdateUserApiKeyRequestToJSON, UserApiKeyResponseFromJSON, } from '../models/index.js';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
export class UsersApi extends runtime.BaseAPI {
|
|
20
|
-
/**
|
|
21
|
-
* Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. So is the website where a partner your account administers integrates Widgetic, with every subdomain of it (`platformDomain` in the answer of `GET /partners/mine`), so there is nothing to add for it either and a list can never lock it out. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. There is no limit on the list of an account that administers a partner, so a partner can add the website of each of its customers as they publish on their own domain, one call each. Any other account can list at most 50 websites, and the 51st is answered with a 409 (`BUSINESS_STATE_CONFLICT`). A wildcard such as `*.example.com` counts as one website, not one per subdomain, so use it instead of listing each subdomain. A page that frames a widget can name only so many websites to the browser (about fifty of ordinary length). Past that, the browser no longer checks the list for that page; the lookup that the Embed SDK makes for the widget still refuses every website that is not on the list.
|
|
22
|
-
* Allow a website to show your widgets
|
|
23
|
-
*/
|
|
24
|
-
async addPersonalWorkspaceDomainRaw(requestParameters, initOverrides) {
|
|
25
|
-
if (requestParameters['id'] == null) {
|
|
26
|
-
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling addPersonalWorkspaceDomain().');
|
|
27
|
-
}
|
|
28
|
-
if (requestParameters['addDomainRequest'] == null) {
|
|
29
|
-
throw new runtime.RequiredError('addDomainRequest', 'Required parameter "addDomainRequest" was null or undefined when calling addPersonalWorkspaceDomain().');
|
|
30
|
-
}
|
|
31
|
-
const queryParameters = {};
|
|
32
|
-
const headerParameters = {};
|
|
33
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
34
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
35
|
-
const token = this.configuration.accessToken;
|
|
36
|
-
const tokenString = await token("apiKeyAuth", []);
|
|
37
|
-
if (tokenString) {
|
|
38
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const response = await this.request({
|
|
42
|
-
path: `/users/{id}/workspace/domains`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
43
|
-
method: 'POST',
|
|
44
|
-
headers: headerParameters,
|
|
45
|
-
query: queryParameters,
|
|
46
|
-
body: AddDomainRequestToJSON(requestParameters['addDomainRequest']),
|
|
47
|
-
}, initOverrides);
|
|
48
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => PersonalWorkspaceDomainResultResponseFromJSON(jsonValue));
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. So is the website where a partner your account administers integrates Widgetic, with every subdomain of it (`platformDomain` in the answer of `GET /partners/mine`), so there is nothing to add for it either and a list can never lock it out. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. There is no limit on the list of an account that administers a partner, so a partner can add the website of each of its customers as they publish on their own domain, one call each. Any other account can list at most 50 websites, and the 51st is answered with a 409 (`BUSINESS_STATE_CONFLICT`). A wildcard such as `*.example.com` counts as one website, not one per subdomain, so use it instead of listing each subdomain. A page that frames a widget can name only so many websites to the browser (about fifty of ordinary length). Past that, the browser no longer checks the list for that page; the lookup that the Embed SDK makes for the widget still refuses every website that is not on the list.
|
|
52
|
-
* Allow a website to show your widgets
|
|
53
|
-
*/
|
|
54
|
-
async addPersonalWorkspaceDomain(requestParameters, initOverrides) {
|
|
55
|
-
const response = await this.addPersonalWorkspaceDomainRaw(requestParameters, initOverrides);
|
|
56
|
-
return await response.value();
|
|
57
|
-
}
|
|
58
20
|
/**
|
|
59
21
|
* Some credentials are an email address Widgetic sends a widget\'s messages to (`confirmation: email_code` in `getUserAdapterConnections`). Saving one with `setUserAdapterConnection` emails a six-digit code to it; this gives the code back. Only then is the address used: until it is confirmed, the widgets that need it are not charged and their visitors are told the feature is unavailable. The code works for 30 minutes and for five wrong tries. After that, save the address again and a new code is emailed (not sooner than a minute after the last one). A code that is not made of digits is refused without counting as a try. Confirming an address that is already confirmed answers 200 with the same state, so a retry of a request that went through is harmless. Saving a different address, or the same one before it was confirmed, starts again. This needs an API key with full access. The caller must be the account itself or a Widgetic administrator.
|
|
60
22
|
* Confirm an adapter address with the code that was emailed to it
|
|
@@ -100,7 +62,7 @@ export class UsersApi extends runtime.BaseAPI {
|
|
|
100
62
|
return await response.value();
|
|
101
63
|
}
|
|
102
64
|
/**
|
|
103
|
-
* Makes a new API key for
|
|
65
|
+
* Makes a new API key for a partner (or staff) account and returns its secret in `key`. That is the only time the secret is shown: Widgetic keeps a hash, so a key that was not stored cannot be recovered, only replaced. To rotate a key, make the new one, switch the integration over to it, then delete the old one. A customer account does not make personal keys: a customer\'s keys are workspace keys, made in Settings, under API keys, for one workspace. They take the same presets and scopes as the ones below. A request for a customer account is refused with 403 and the code `PERSONAL_API_KEY_RETIRED`. A personal key a customer made before workspace keys replaced them keeps working until it is deleted or expires, and can still be listed, renamed, switched off and deleted here. Only a person signed in on widgetic.com can make a key: a request made with an API key, or with an SDK token, is refused with 403. That way a leaked key cannot be used to make a second one that survives its revocation. Make keys from the dashboard; a key can still list, rename, switch off and delete keys. An `Idempotency-Key` header is required (8 to 50 characters: letters, digits, `-` and `_`). A retry with the same header and the same body returns the same answer instead of making a second key, and the same header with a different body is refused with 422. Make keys one at a time: two requests for the same account that run at the same moment can overwrite each other. A key can be limited to what it needs. Send a `preset` (`read_only`, `content` or `full_access`) or a list of `scopes`, never both. Send neither for a key that can do everything its owner can, as every key made before scopes existed. A limited key is refused with 403 and the code `API_KEY_SCOPE_MISSING` on anything outside its scopes, so a key held by a build server or by a partner\'s backend can be given only the part of the API it uses. The scopes of a key are fixed when it is made: to widen one, make a new key and delete the old one. A limited key cannot make, change or delete keys, exchange tokens or reach the administration routes. The list of scopes is in the `ApiKeyScope` schema. A partner or staff account has no limit on how many keys it holds, and its keys name no workspace: they act as the account.
|
|
104
66
|
* Create an API key
|
|
105
67
|
*/
|
|
106
68
|
async createUserApiKeyRaw(requestParameters, initOverrides) {
|
|
@@ -136,49 +98,13 @@ export class UsersApi extends runtime.BaseAPI {
|
|
|
136
98
|
return new runtime.JSONApiResponse(response, (jsonValue) => CreatedUserApiKeyResponseFromJSON(jsonValue));
|
|
137
99
|
}
|
|
138
100
|
/**
|
|
139
|
-
* Makes a new API key for
|
|
101
|
+
* Makes a new API key for a partner (or staff) account and returns its secret in `key`. That is the only time the secret is shown: Widgetic keeps a hash, so a key that was not stored cannot be recovered, only replaced. To rotate a key, make the new one, switch the integration over to it, then delete the old one. A customer account does not make personal keys: a customer\'s keys are workspace keys, made in Settings, under API keys, for one workspace. They take the same presets and scopes as the ones below. A request for a customer account is refused with 403 and the code `PERSONAL_API_KEY_RETIRED`. A personal key a customer made before workspace keys replaced them keeps working until it is deleted or expires, and can still be listed, renamed, switched off and deleted here. Only a person signed in on widgetic.com can make a key: a request made with an API key, or with an SDK token, is refused with 403. That way a leaked key cannot be used to make a second one that survives its revocation. Make keys from the dashboard; a key can still list, rename, switch off and delete keys. An `Idempotency-Key` header is required (8 to 50 characters: letters, digits, `-` and `_`). A retry with the same header and the same body returns the same answer instead of making a second key, and the same header with a different body is refused with 422. Make keys one at a time: two requests for the same account that run at the same moment can overwrite each other. A key can be limited to what it needs. Send a `preset` (`read_only`, `content` or `full_access`) or a list of `scopes`, never both. Send neither for a key that can do everything its owner can, as every key made before scopes existed. A limited key is refused with 403 and the code `API_KEY_SCOPE_MISSING` on anything outside its scopes, so a key held by a build server or by a partner\'s backend can be given only the part of the API it uses. The scopes of a key are fixed when it is made: to widen one, make a new key and delete the old one. A limited key cannot make, change or delete keys, exchange tokens or reach the administration routes. The list of scopes is in the `ApiKeyScope` schema. A partner or staff account has no limit on how many keys it holds, and its keys name no workspace: they act as the account.
|
|
140
102
|
* Create an API key
|
|
141
103
|
*/
|
|
142
104
|
async createUserApiKey(requestParameters, initOverrides) {
|
|
143
105
|
const response = await this.createUserApiKeyRaw(requestParameters, initOverrides);
|
|
144
106
|
return await response.value();
|
|
145
107
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Removes one entry from an account\'s own list. When it was the last one, nothing is restricted any more and a widget can be shown anywhere again. A change can take about 15 seconds to reach every server.
|
|
148
|
-
* Stop allowing a website to show your widgets
|
|
149
|
-
*/
|
|
150
|
-
async deletePersonalWorkspaceDomainRaw(requestParameters, initOverrides) {
|
|
151
|
-
if (requestParameters['id'] == null) {
|
|
152
|
-
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deletePersonalWorkspaceDomain().');
|
|
153
|
-
}
|
|
154
|
-
if (requestParameters['domainId'] == null) {
|
|
155
|
-
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling deletePersonalWorkspaceDomain().');
|
|
156
|
-
}
|
|
157
|
-
const queryParameters = {};
|
|
158
|
-
const headerParameters = {};
|
|
159
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
160
|
-
const token = this.configuration.accessToken;
|
|
161
|
-
const tokenString = await token("apiKeyAuth", []);
|
|
162
|
-
if (tokenString) {
|
|
163
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
const response = await this.request({
|
|
167
|
-
path: `/users/{id}/workspace/domains/{domainId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"domainId"}}`, encodeURIComponent(String(requestParameters['domainId']))),
|
|
168
|
-
method: 'DELETE',
|
|
169
|
-
headers: headerParameters,
|
|
170
|
-
query: queryParameters,
|
|
171
|
-
}, initOverrides);
|
|
172
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => DeletePersonalWorkspaceDomainResponseFromJSON(jsonValue));
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Removes one entry from an account\'s own list. When it was the last one, nothing is restricted any more and a widget can be shown anywhere again. A change can take about 15 seconds to reach every server.
|
|
176
|
-
* Stop allowing a website to show your widgets
|
|
177
|
-
*/
|
|
178
|
-
async deletePersonalWorkspaceDomain(requestParameters, initOverrides) {
|
|
179
|
-
const response = await this.deletePersonalWorkspaceDomainRaw(requestParameters, initOverrides);
|
|
180
|
-
return await response.value();
|
|
181
|
-
}
|
|
182
108
|
/**
|
|
183
109
|
* Deletes a key and the record of what it was used for. The key stops working at once on the server that took the request and within a minute on the others, and cannot be brought back: make a new one instead. To stop a key without losing it, switch it off with `updateUserApiKey`.
|
|
184
110
|
* Delete an API key
|
|
@@ -215,39 +141,6 @@ export class UsersApi extends runtime.BaseAPI {
|
|
|
215
141
|
const response = await this.deleteUserApiKeyRaw(requestParameters, initOverrides);
|
|
216
142
|
return await response.value();
|
|
217
143
|
}
|
|
218
|
-
/**
|
|
219
|
-
* Lists the websites on an account\'s own list, newest first. It is the list Widgetic checks when a widget of the account is embedded: when it holds at least one website, the widget is shown on those websites (and on Widgetic\'s own) and nowhere else; when it is empty, the widget can be shown anywhere. If the account administers a partner, the websites set on the partner record by Widgetic are added to them. Widgets that belong to an organization use the organization\'s list instead. The answer holds the whole list, however long it is: a partner\'s list has no limit.
|
|
220
|
-
* List the websites allowed to show your widgets
|
|
221
|
-
*/
|
|
222
|
-
async getPersonalWorkspaceDomainsRaw(requestParameters, initOverrides) {
|
|
223
|
-
if (requestParameters['id'] == null) {
|
|
224
|
-
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getPersonalWorkspaceDomains().');
|
|
225
|
-
}
|
|
226
|
-
const queryParameters = {};
|
|
227
|
-
const headerParameters = {};
|
|
228
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
229
|
-
const token = this.configuration.accessToken;
|
|
230
|
-
const tokenString = await token("apiKeyAuth", []);
|
|
231
|
-
if (tokenString) {
|
|
232
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
const response = await this.request({
|
|
236
|
-
path: `/users/{id}/workspace/domains`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
237
|
-
method: 'GET',
|
|
238
|
-
headers: headerParameters,
|
|
239
|
-
query: queryParameters,
|
|
240
|
-
}, initOverrides);
|
|
241
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => GetPersonalWorkspaceDomains200ResponseFromJSON(jsonValue));
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Lists the websites on an account\'s own list, newest first. It is the list Widgetic checks when a widget of the account is embedded: when it holds at least one website, the widget is shown on those websites (and on Widgetic\'s own) and nowhere else; when it is empty, the widget can be shown anywhere. If the account administers a partner, the websites set on the partner record by Widgetic are added to them. Widgets that belong to an organization use the organization\'s list instead. The answer holds the whole list, however long it is: a partner\'s list has no limit.
|
|
245
|
-
* List the websites allowed to show your widgets
|
|
246
|
-
*/
|
|
247
|
-
async getPersonalWorkspaceDomains(requestParameters, initOverrides) {
|
|
248
|
-
const response = await this.getPersonalWorkspaceDomainsRaw(requestParameters, initOverrides);
|
|
249
|
-
return await response.value();
|
|
250
|
-
}
|
|
251
144
|
/**
|
|
252
145
|
* Widget adapters are capabilities a widget can use, and some of them act through a service the owner has an account with: an adapter that sends email needs the owner\'s email provider key, one that sends texts needs the owner\'s SMS provider key. This lists every key an adapter takes from an owner and whether this account has connected it, so a settings page can show what is missing. An empty list means no adapter takes a key from an owner at the moment. The list never contains a key: only whether one is connected and when it was last set. Connect a key with `setUserAdapterConnection`; take it away with `removeUserAdapterConnection`. The widgets of customers a partner manages use the partner\'s keys instead (`getPartnerAdapterConnections`). The caller must be the account itself (an API key of that account works, with the `account:read` scope), or a Widgetic administrator.
|
|
253
146
|
* See which adapter keys an account has connected
|
|
@@ -436,47 +329,6 @@ export class UsersApi extends runtime.BaseAPI {
|
|
|
436
329
|
const response = await this.setUserAdapterConnectionRaw(requestParameters, initOverrides);
|
|
437
330
|
return await response.value();
|
|
438
331
|
}
|
|
439
|
-
/**
|
|
440
|
-
* Replaces the website of one entry on an account\'s own list. The same rules apply as when adding one (`addPersonalWorkspaceDomain`): a website name such as `example.com` or `*.example.com`, kept in its cleaned form, and refused when it is not a website name or is already on the list.
|
|
441
|
-
* Change a website on your list
|
|
442
|
-
*/
|
|
443
|
-
async updatePersonalWorkspaceDomainRaw(requestParameters, initOverrides) {
|
|
444
|
-
if (requestParameters['id'] == null) {
|
|
445
|
-
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updatePersonalWorkspaceDomain().');
|
|
446
|
-
}
|
|
447
|
-
if (requestParameters['domainId'] == null) {
|
|
448
|
-
throw new runtime.RequiredError('domainId', 'Required parameter "domainId" was null or undefined when calling updatePersonalWorkspaceDomain().');
|
|
449
|
-
}
|
|
450
|
-
if (requestParameters['updateDomainRequest'] == null) {
|
|
451
|
-
throw new runtime.RequiredError('updateDomainRequest', 'Required parameter "updateDomainRequest" was null or undefined when calling updatePersonalWorkspaceDomain().');
|
|
452
|
-
}
|
|
453
|
-
const queryParameters = {};
|
|
454
|
-
const headerParameters = {};
|
|
455
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
456
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
457
|
-
const token = this.configuration.accessToken;
|
|
458
|
-
const tokenString = await token("apiKeyAuth", []);
|
|
459
|
-
if (tokenString) {
|
|
460
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
const response = await this.request({
|
|
464
|
-
path: `/users/{id}/workspace/domains/{domainId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"domainId"}}`, encodeURIComponent(String(requestParameters['domainId']))),
|
|
465
|
-
method: 'PUT',
|
|
466
|
-
headers: headerParameters,
|
|
467
|
-
query: queryParameters,
|
|
468
|
-
body: UpdateDomainRequestToJSON(requestParameters['updateDomainRequest']),
|
|
469
|
-
}, initOverrides);
|
|
470
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => PersonalWorkspaceDomainResultResponseFromJSON(jsonValue));
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Replaces the website of one entry on an account\'s own list. The same rules apply as when adding one (`addPersonalWorkspaceDomain`): a website name such as `example.com` or `*.example.com`, kept in its cleaned form, and refused when it is not a website name or is already on the list.
|
|
474
|
-
* Change a website on your list
|
|
475
|
-
*/
|
|
476
|
-
async updatePersonalWorkspaceDomain(requestParameters, initOverrides) {
|
|
477
|
-
const response = await this.updatePersonalWorkspaceDomainRaw(requestParameters, initOverrides);
|
|
478
|
-
return await response.value();
|
|
479
|
-
}
|
|
480
332
|
/**
|
|
481
333
|
* Renames a key, or switches it off (`isActive: false`) or back on. A key that is switched off is refused at once by the server that took the request and within a minute by the others, and can be switched on again; deleting is for a key that is not coming back. The secret, the expiry and the scopes of a key cannot be changed. Only a key with full access can make these requests: a key limited to some scopes is refused with 403 and the code `API_KEY_SCOPE_MISSING`. Renaming and switching off can be done with an API key. Switching a key on needs a person signed in on widgetic.com: a request that asks for it with an API key or an SDK token is refused with 403, so a leaked key cannot bring a dormant key back to life.
|
|
482
334
|
* Rename an API key, or switch it off or on
|
|
@@ -62,7 +62,7 @@ export class WidgetsApi extends runtime.BaseAPI {
|
|
|
62
62
|
return await response.value();
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Creates a widget for your account: a named record with a type and some starting content, on a canvas of its own (or one of yours that you name). It costs no credits and has no code yet; the code is generated for it afterwards. The new widget is yours, and you can list it with `getWidgets`. A widget is a draft until you say otherwise (`isDraft: false`). If a step after the widget was saved does not go through, the widget is still created, and `data.warnings` says what did not. Read it before relying on the widget. A widget can be placed on one of your canvases (`canvasId`), in a project you can edit (`projectId`) or in
|
|
65
|
+
* Creates a widget for your account: a named record with a type and some starting content, on a canvas of its own (or one of yours that you name). It costs no credits and has no code yet; the code is generated for it afterwards. The new widget is yours, and you can list it with `getWidgets`. A widget is a draft until you say otherwise (`isDraft: false`). If a step after the widget was saved does not go through, the widget is still created, and `data.warnings` says what did not. Read it before relying on the widget. A widget can be placed on one of your canvases (`canvasId`), in a project you can edit (`projectId`) or in a workspace where you may create widgets (`organizationId`). Naming anything you cannot use is refused with 403, and the answer is the same whether it exists or not. Every widget belongs to one workspace. It goes where its project is; with no project, in the workspace you name (`organizationId`); and when you name neither, in the workspace the call works in (the one your API key or connection belongs to, or the one you last chose on widgetic.com). A project of one workspace together with the id of another is refused with 400. A person who belongs to no workspace yet is told so (403 `NO_WORKSPACE`), and a call that acts for no person (an internal service) must name the workspace. To make the widget for one of your managed users, send `managedUserId` or `managedUserExternalId`. The widget stays in your account and is yours to edit; the tag lets you list one user\'s widgets with `getWidgets`. The managed user must be yours and active: one that is not yours, or does not exist, is answered with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`. The tag is set here and does not change afterwards. This call has a limit of its own: 120 per minute for each account (ask Widgetic if you need more). Past that the call is answered with 429 and a `Retry-After`. A widget has no database of its own: what the visitors of a composition leave is kept in the tables of that composition, made when the composition is. The `Idempotency-Key` header is required; send the same key when you retry, so one widget is created, not two.
|
|
66
66
|
* Create Widget
|
|
67
67
|
*/
|
|
68
68
|
async createWidgetRaw(requestParameters, initOverrides) {
|
|
@@ -95,7 +95,7 @@ export class WidgetsApi extends runtime.BaseAPI {
|
|
|
95
95
|
return new runtime.JSONApiResponse(response, (jsonValue) => CreateWidget201ResponseFromJSON(jsonValue));
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
|
-
* Creates a widget for your account: a named record with a type and some starting content, on a canvas of its own (or one of yours that you name). It costs no credits and has no code yet; the code is generated for it afterwards. The new widget is yours, and you can list it with `getWidgets`. A widget is a draft until you say otherwise (`isDraft: false`). If a step after the widget was saved does not go through, the widget is still created, and `data.warnings` says what did not. Read it before relying on the widget. A widget can be placed on one of your canvases (`canvasId`), in a project you can edit (`projectId`) or in
|
|
98
|
+
* Creates a widget for your account: a named record with a type and some starting content, on a canvas of its own (or one of yours that you name). It costs no credits and has no code yet; the code is generated for it afterwards. The new widget is yours, and you can list it with `getWidgets`. A widget is a draft until you say otherwise (`isDraft: false`). If a step after the widget was saved does not go through, the widget is still created, and `data.warnings` says what did not. Read it before relying on the widget. A widget can be placed on one of your canvases (`canvasId`), in a project you can edit (`projectId`) or in a workspace where you may create widgets (`organizationId`). Naming anything you cannot use is refused with 403, and the answer is the same whether it exists or not. Every widget belongs to one workspace. It goes where its project is; with no project, in the workspace you name (`organizationId`); and when you name neither, in the workspace the call works in (the one your API key or connection belongs to, or the one you last chose on widgetic.com). A project of one workspace together with the id of another is refused with 400. A person who belongs to no workspace yet is told so (403 `NO_WORKSPACE`), and a call that acts for no person (an internal service) must name the workspace. To make the widget for one of your managed users, send `managedUserId` or `managedUserExternalId`. The widget stays in your account and is yours to edit; the tag lets you list one user\'s widgets with `getWidgets`. The managed user must be yours and active: one that is not yours, or does not exist, is answered with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`. The tag is set here and does not change afterwards. This call has a limit of its own: 120 per minute for each account (ask Widgetic if you need more). Past that the call is answered with 429 and a `Retry-After`. A widget has no database of its own: what the visitors of a composition leave is kept in the tables of that composition, made when the composition is. The `Idempotency-Key` header is required; send the same key when you retry, so one widget is created, not two.
|
|
99
99
|
* Create Widget
|
|
100
100
|
*/
|
|
101
101
|
async createWidget(requestParameters, initOverrides) {
|