@randock/nameshift-api-client 0.0.555 → 0.0.557
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/apis/AutomationsApi.d.ts +13 -0
- package/dist/apis/AutomationsApi.js +61 -0
- package/dist/models/AutomationRunActionDto.d.ts +12 -0
- package/dist/models/AutomationRunActionDto.js +8 -0
- package/dist/models/AutomationRunLeadDto.d.ts +1 -1
- package/package.json +1 -1
- package/src/apis/AutomationsApi.ts +50 -0
- package/src/models/AutomationRunActionDto.ts +18 -0
- package/src/models/AutomationRunLeadDto.ts +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @randock/nameshift-api-client@0.0.
|
|
1
|
+
## @randock/nameshift-api-client@0.0.557
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @randock/nameshift-api-client@0.0.
|
|
39
|
+
npm install @randock/nameshift-api-client@0.0.557 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -44,4 +44,4 @@ _unPublished (not recommended):_
|
|
|
44
44
|
```
|
|
45
45
|
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
46
46
|
```
|
|
47
|
-
|
|
47
|
+
3de371fa6be62fc35feebc8f29185b80cafae6ecea0c205d9326d904d2b328b8497d60d211a99ea0a30594d670a90457
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import type { AutomationCatalogDto, AutomationDto, AutomationInput, AutomationRunDto, AutomationSimulationDto, AutomationStatusInput, GetAutomationRuns200Response, GetAutomations200Response, SimulateAutomationsInput } from '../models/index';
|
|
14
|
+
export interface AutomationsApiCancelAutomationScheduledActionRequest {
|
|
15
|
+
scheduledActionId: string;
|
|
16
|
+
}
|
|
14
17
|
export interface AutomationsApiCreateAutomationRequest {
|
|
15
18
|
automationInput: AutomationInput;
|
|
16
19
|
}
|
|
@@ -57,6 +60,16 @@ export interface AutomationsApiUpdateAutomationStatusRequest {
|
|
|
57
60
|
*
|
|
58
61
|
*/
|
|
59
62
|
export declare class AutomationsApi extends runtime.BaseAPI {
|
|
63
|
+
/**
|
|
64
|
+
* Calls off an action of an automation of the seller account that waits to run. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
65
|
+
* Cancel a scheduled action of an automation
|
|
66
|
+
*/
|
|
67
|
+
cancelAutomationScheduledActionRaw(requestParameters: AutomationsApiCancelAutomationScheduledActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
68
|
+
/**
|
|
69
|
+
* Calls off an action of an automation of the seller account that waits to run. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
70
|
+
* Cancel a scheduled action of an automation
|
|
71
|
+
*/
|
|
72
|
+
cancelAutomationScheduledAction(requestParameters: AutomationsApiCancelAutomationScheduledActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
60
73
|
/**
|
|
61
74
|
* Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
62
75
|
* Create an automation
|
|
@@ -75,6 +75,67 @@ var AutomationsApi = /** @class */ (function (_super) {
|
|
|
75
75
|
function AutomationsApi() {
|
|
76
76
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Calls off an action of an automation of the seller account that waits to run. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
80
|
+
* Cancel a scheduled action of an automation
|
|
81
|
+
*/
|
|
82
|
+
AutomationsApi.prototype.cancelAutomationScheduledActionRaw = function (requestParameters, initOverrides) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response;
|
|
85
|
+
return __generator(this, function (_c) {
|
|
86
|
+
switch (_c.label) {
|
|
87
|
+
case 0:
|
|
88
|
+
if (requestParameters['scheduledActionId'] == null) {
|
|
89
|
+
throw new runtime.RequiredError('scheduledActionId', 'Required parameter "scheduledActionId" was null or undefined when calling cancelAutomationScheduledAction().');
|
|
90
|
+
}
|
|
91
|
+
queryParameters = {};
|
|
92
|
+
headerParameters = {};
|
|
93
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
94
|
+
_a = headerParameters;
|
|
95
|
+
_b = "apikey";
|
|
96
|
+
return [4 /*yield*/, this.configuration.apiKey("apikey")];
|
|
97
|
+
case 1:
|
|
98
|
+
_a[_b] = _c.sent(); // api_key authentication
|
|
99
|
+
_c.label = 2;
|
|
100
|
+
case 2:
|
|
101
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
102
|
+
token = this.configuration.accessToken;
|
|
103
|
+
return [4 /*yield*/, token("bearer", [])];
|
|
104
|
+
case 3:
|
|
105
|
+
tokenString = _c.sent();
|
|
106
|
+
if (tokenString) {
|
|
107
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
108
|
+
}
|
|
109
|
+
_c.label = 4;
|
|
110
|
+
case 4: return [4 /*yield*/, this.request({
|
|
111
|
+
path: "/private/automations/scheduled-actions/{scheduledActionId}/cancel".replace("{".concat("scheduledActionId", "}"), encodeURIComponent(String(requestParameters['scheduledActionId']))),
|
|
112
|
+
method: 'POST',
|
|
113
|
+
headers: headerParameters,
|
|
114
|
+
query: queryParameters,
|
|
115
|
+
}, initOverrides)];
|
|
116
|
+
case 5:
|
|
117
|
+
response = _c.sent();
|
|
118
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Calls off an action of an automation of the seller account that waits to run. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
125
|
+
* Cancel a scheduled action of an automation
|
|
126
|
+
*/
|
|
127
|
+
AutomationsApi.prototype.cancelAutomationScheduledAction = function (requestParameters, initOverrides) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
return __generator(this, function (_a) {
|
|
130
|
+
switch (_a.label) {
|
|
131
|
+
case 0: return [4 /*yield*/, this.cancelAutomationScheduledActionRaw(requestParameters, initOverrides)];
|
|
132
|
+
case 1:
|
|
133
|
+
_a.sent();
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
78
139
|
/**
|
|
79
140
|
* Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
80
141
|
* Create an automation
|
|
@@ -41,6 +41,18 @@ export interface AutomationRunActionDto {
|
|
|
41
41
|
* @memberof AutomationRunActionDto
|
|
42
42
|
*/
|
|
43
43
|
scheduledFor: Date | null;
|
|
44
|
+
/**
|
|
45
|
+
* When an action that waited ran or was called off.
|
|
46
|
+
* @type {Date}
|
|
47
|
+
* @memberof AutomationRunActionDto
|
|
48
|
+
*/
|
|
49
|
+
resolvedAt: Date | null;
|
|
50
|
+
/**
|
|
51
|
+
* Id of the action that waits or waited.
|
|
52
|
+
* @type {string}
|
|
53
|
+
* @memberof AutomationRunActionDto
|
|
54
|
+
*/
|
|
55
|
+
scheduledActionId: string | null;
|
|
44
56
|
}
|
|
45
57
|
/**
|
|
46
58
|
* Check if a given object implements the AutomationRunActionDto interface.
|
|
@@ -32,6 +32,10 @@ function instanceOfAutomationRunActionDto(value) {
|
|
|
32
32
|
return false;
|
|
33
33
|
if (!('scheduledFor' in value) || value['scheduledFor'] === undefined)
|
|
34
34
|
return false;
|
|
35
|
+
if (!('resolvedAt' in value) || value['resolvedAt'] === undefined)
|
|
36
|
+
return false;
|
|
37
|
+
if (!('scheduledActionId' in value) || value['scheduledActionId'] === undefined)
|
|
38
|
+
return false;
|
|
35
39
|
return true;
|
|
36
40
|
}
|
|
37
41
|
function AutomationRunActionDtoFromJSON(json) {
|
|
@@ -46,6 +50,8 @@ function AutomationRunActionDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
46
50
|
'status': (0, AutomationActionStatusEnum_1.AutomationActionStatusEnumFromJSON)(json['status']),
|
|
47
51
|
'reason': json['reason'],
|
|
48
52
|
'scheduledFor': (json['scheduledFor'] == null ? null : new Date(json['scheduledFor'])),
|
|
53
|
+
'resolvedAt': (json['resolvedAt'] == null ? null : new Date(json['resolvedAt'])),
|
|
54
|
+
'scheduledActionId': json['scheduledActionId'],
|
|
49
55
|
};
|
|
50
56
|
}
|
|
51
57
|
function AutomationRunActionDtoToJSON(json) {
|
|
@@ -61,5 +67,7 @@ function AutomationRunActionDtoToJSONTyped(value, ignoreDiscriminator) {
|
|
|
61
67
|
'status': (0, AutomationActionStatusEnum_1.AutomationActionStatusEnumToJSON)(value['status']),
|
|
62
68
|
'reason': value['reason'],
|
|
63
69
|
'scheduledFor': (value['scheduledFor'] == null ? null : value['scheduledFor'].toISOString()),
|
|
70
|
+
'resolvedAt': (value['resolvedAt'] == null ? null : value['resolvedAt'].toISOString()),
|
|
71
|
+
'scheduledActionId': value['scheduledActionId'],
|
|
64
72
|
};
|
|
65
73
|
}
|
package/package.json
CHANGED
|
@@ -49,6 +49,10 @@ import {
|
|
|
49
49
|
ValidationExceptionToJSON,
|
|
50
50
|
} from '../models/index';
|
|
51
51
|
|
|
52
|
+
export interface AutomationsApiCancelAutomationScheduledActionRequest {
|
|
53
|
+
scheduledActionId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
export interface AutomationsApiCreateAutomationRequest {
|
|
53
57
|
automationInput: AutomationInput;
|
|
54
58
|
}
|
|
@@ -101,6 +105,52 @@ export interface AutomationsApiUpdateAutomationStatusRequest {
|
|
|
101
105
|
*/
|
|
102
106
|
export class AutomationsApi extends runtime.BaseAPI {
|
|
103
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Calls off an action of an automation of the seller account that waits to run. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
110
|
+
* Cancel a scheduled action of an automation
|
|
111
|
+
*/
|
|
112
|
+
async cancelAutomationScheduledActionRaw(requestParameters: AutomationsApiCancelAutomationScheduledActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
113
|
+
if (requestParameters['scheduledActionId'] == null) {
|
|
114
|
+
throw new runtime.RequiredError(
|
|
115
|
+
'scheduledActionId',
|
|
116
|
+
'Required parameter "scheduledActionId" was null or undefined when calling cancelAutomationScheduledAction().'
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const queryParameters: any = {};
|
|
121
|
+
|
|
122
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
123
|
+
|
|
124
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
125
|
+
headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
129
|
+
const token = this.configuration.accessToken;
|
|
130
|
+
const tokenString = await token("bearer", []);
|
|
131
|
+
|
|
132
|
+
if (tokenString) {
|
|
133
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const response = await this.request({
|
|
137
|
+
path: `/private/automations/scheduled-actions/{scheduledActionId}/cancel`.replace(`{${"scheduledActionId"}}`, encodeURIComponent(String(requestParameters['scheduledActionId']))),
|
|
138
|
+
method: 'POST',
|
|
139
|
+
headers: headerParameters,
|
|
140
|
+
query: queryParameters,
|
|
141
|
+
}, initOverrides);
|
|
142
|
+
|
|
143
|
+
return new runtime.VoidApiResponse(response);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Calls off an action of an automation of the seller account that waits to run. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
148
|
+
* Cancel a scheduled action of an automation
|
|
149
|
+
*/
|
|
150
|
+
async cancelAutomationScheduledAction(requestParameters: AutomationsApiCancelAutomationScheduledActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
151
|
+
await this.cancelAutomationScheduledActionRaw(requestParameters, initOverrides);
|
|
152
|
+
}
|
|
153
|
+
|
|
104
154
|
/**
|
|
105
155
|
* Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
|
|
106
156
|
* Create an automation
|
|
@@ -58,6 +58,18 @@ export interface AutomationRunActionDto {
|
|
|
58
58
|
* @memberof AutomationRunActionDto
|
|
59
59
|
*/
|
|
60
60
|
scheduledFor: Date | null;
|
|
61
|
+
/**
|
|
62
|
+
* When an action that waited ran or was called off.
|
|
63
|
+
* @type {Date}
|
|
64
|
+
* @memberof AutomationRunActionDto
|
|
65
|
+
*/
|
|
66
|
+
resolvedAt: Date | null;
|
|
67
|
+
/**
|
|
68
|
+
* Id of the action that waits or waited.
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @memberof AutomationRunActionDto
|
|
71
|
+
*/
|
|
72
|
+
scheduledActionId: string | null;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
|
|
@@ -70,6 +82,8 @@ export function instanceOfAutomationRunActionDto(value: object): value is Automa
|
|
|
70
82
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
71
83
|
if (!('reason' in value) || value['reason'] === undefined) return false;
|
|
72
84
|
if (!('scheduledFor' in value) || value['scheduledFor'] === undefined) return false;
|
|
85
|
+
if (!('resolvedAt' in value) || value['resolvedAt'] === undefined) return false;
|
|
86
|
+
if (!('scheduledActionId' in value) || value['scheduledActionId'] === undefined) return false;
|
|
73
87
|
return true;
|
|
74
88
|
}
|
|
75
89
|
|
|
@@ -87,6 +101,8 @@ export function AutomationRunActionDtoFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
87
101
|
'status': AutomationActionStatusEnumFromJSON(json['status']),
|
|
88
102
|
'reason': json['reason'],
|
|
89
103
|
'scheduledFor': (json['scheduledFor'] == null ? null : new Date(json['scheduledFor'])),
|
|
104
|
+
'resolvedAt': (json['resolvedAt'] == null ? null : new Date(json['resolvedAt'])),
|
|
105
|
+
'scheduledActionId': json['scheduledActionId'],
|
|
90
106
|
};
|
|
91
107
|
}
|
|
92
108
|
|
|
@@ -105,6 +121,8 @@ export function AutomationRunActionDtoToJSONTyped(value?: AutomationRunActionDto
|
|
|
105
121
|
'status': AutomationActionStatusEnumToJSON(value['status']),
|
|
106
122
|
'reason': value['reason'],
|
|
107
123
|
'scheduledFor': (value['scheduledFor'] == null ? null : (value['scheduledFor'] as any).toISOString()),
|
|
124
|
+
'resolvedAt': (value['resolvedAt'] == null ? null : (value['resolvedAt'] as any).toISOString()),
|
|
125
|
+
'scheduledActionId': value['scheduledActionId'],
|
|
108
126
|
};
|
|
109
127
|
}
|
|
110
128
|
|