@unified-api/typescript-sdk 1.0.26 → 1.0.27
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/sdk/channel.d.ts +15 -0
- package/dist/sdk/channel.js +213 -0
- package/dist/sdk/kms.d.ts +55 -0
- package/dist/sdk/kms.js +907 -0
- package/dist/sdk/message.d.ts +31 -0
- package/dist/sdk/message.js +505 -0
- package/dist/sdk/messaging.d.ts +39 -0
- package/dist/sdk/messaging.js +631 -0
- package/dist/sdk/models/operations/createkmspage.d.ts +28 -0
- package/dist/sdk/models/operations/createkmspage.js +95 -0
- package/dist/sdk/models/operations/createkmsspace.d.ts +28 -0
- package/dist/sdk/models/operations/createkmsspace.js +95 -0
- package/dist/sdk/models/operations/createmessagingmessage.d.ts +28 -0
- package/dist/sdk/models/operations/createmessagingmessage.js +95 -0
- package/dist/sdk/models/operations/getkmspage.d.ts +35 -0
- package/dist/sdk/models/operations/getkmspage.js +99 -0
- package/dist/sdk/models/operations/getkmsspace.d.ts +35 -0
- package/dist/sdk/models/operations/getkmsspace.js +99 -0
- package/dist/sdk/models/operations/getmessagingchannel.d.ts +35 -0
- package/dist/sdk/models/operations/getmessagingchannel.js +99 -0
- package/dist/sdk/models/operations/getmessagingmessage.d.ts +35 -0
- package/dist/sdk/models/operations/getmessagingmessage.js +99 -0
- package/dist/sdk/models/operations/getunifiedintegrationauth.d.ts +10 -1
- package/dist/sdk/models/operations/getunifiedintegrationauth.js +9 -0
- package/dist/sdk/models/operations/index.d.ts +20 -0
- package/dist/sdk/models/operations/index.js +20 -0
- package/dist/sdk/models/operations/listkmspages.d.ts +45 -0
- package/dist/sdk/models/operations/listkmspages.js +127 -0
- package/dist/sdk/models/operations/listkmsspaces.d.ts +44 -0
- package/dist/sdk/models/operations/listkmsspaces.js +123 -0
- package/dist/sdk/models/operations/listmessagingchannels.d.ts +43 -0
- package/dist/sdk/models/operations/listmessagingchannels.js +119 -0
- package/dist/sdk/models/operations/listmessagingmessages.d.ts +45 -0
- package/dist/sdk/models/operations/listmessagingmessages.js +127 -0
- package/dist/sdk/models/operations/listunifiedconnections.d.ts +3 -1
- package/dist/sdk/models/operations/listunifiedconnections.js +2 -0
- package/dist/sdk/models/operations/listunifiedintegrations.d.ts +3 -1
- package/dist/sdk/models/operations/listunifiedintegrations.js +2 -0
- package/dist/sdk/models/operations/listunifiedintegrationworkspaces.d.ts +3 -1
- package/dist/sdk/models/operations/listunifiedintegrationworkspaces.js +2 -0
- package/dist/sdk/models/operations/patchkmspage.d.ts +32 -0
- package/dist/sdk/models/operations/patchkmspage.js +99 -0
- package/dist/sdk/models/operations/patchkmsspace.d.ts +32 -0
- package/dist/sdk/models/operations/patchkmsspace.js +99 -0
- package/dist/sdk/models/operations/patchmessagingmessage.d.ts +32 -0
- package/dist/sdk/models/operations/patchmessagingmessage.js +99 -0
- package/dist/sdk/models/operations/removekmspage.d.ts +30 -0
- package/dist/sdk/models/operations/removekmspage.js +71 -0
- package/dist/sdk/models/operations/removekmsspace.d.ts +30 -0
- package/dist/sdk/models/operations/removekmsspace.js +71 -0
- package/dist/sdk/models/operations/removemessagingmessage.d.ts +30 -0
- package/dist/sdk/models/operations/removemessagingmessage.js +71 -0
- package/dist/sdk/models/operations/updatekmspage.d.ts +32 -0
- package/dist/sdk/models/operations/updatekmspage.js +99 -0
- package/dist/sdk/models/operations/updatekmsspace.d.ts +32 -0
- package/dist/sdk/models/operations/updatekmsspace.js +99 -0
- package/dist/sdk/models/operations/updatemessagingmessage.d.ts +32 -0
- package/dist/sdk/models/operations/updatemessagingmessage.js +99 -0
- package/dist/sdk/models/shared/index.d.ts +6 -0
- package/dist/sdk/models/shared/index.js +6 -0
- package/dist/sdk/models/shared/integrationsupport.d.ts +2 -0
- package/dist/sdk/models/shared/integrationsupport.js +10 -0
- package/dist/sdk/models/shared/kmspage.d.ts +19 -0
- package/dist/sdk/models/shared/kmspage.js +109 -0
- package/dist/sdk/models/shared/kmsspace.d.ts +12 -0
- package/dist/sdk/models/shared/kmsspace.js +93 -0
- package/dist/sdk/models/shared/messagingchannel.d.ts +16 -0
- package/dist/sdk/models/shared/messagingchannel.js +106 -0
- package/dist/sdk/models/shared/messagingmember.d.ts +6 -0
- package/dist/sdk/models/shared/messagingmember.js +55 -0
- package/dist/sdk/models/shared/messagingmessage.d.ts +18 -0
- package/dist/sdk/models/shared/messagingmessage.js +111 -0
- package/dist/sdk/models/shared/propertyconnectioncategories.d.ts +3 -1
- package/dist/sdk/models/shared/propertyconnectioncategories.js +2 -0
- package/dist/sdk/models/shared/propertyconnectionpermissions.d.ts +10 -1
- package/dist/sdk/models/shared/propertyconnectionpermissions.js +9 -0
- package/dist/sdk/models/shared/propertyintegrationcategories.d.ts +3 -1
- package/dist/sdk/models/shared/propertyintegrationcategories.js +2 -0
- package/dist/sdk/models/shared/propertymessagingmessageauthormember.d.ts +6 -0
- package/dist/sdk/models/shared/propertymessagingmessageauthormember.js +55 -0
- package/dist/sdk/models/shared/webhook.d.ts +5 -1
- package/dist/sdk/models/shared/webhook.js +4 -0
- package/dist/sdk/page.d.ts +31 -0
- package/dist/sdk/page.js +505 -0
- package/dist/sdk/sdk.d.ts +12 -0
- package/dist/sdk/sdk.js +14 -2
- package/dist/sdk/space.d.ts +31 -0
- package/dist/sdk/space.js +505 -0
- package/docs/sdk/models/operations/categories.md +3 -1
- package/docs/sdk/models/operations/createkmspagerequest.md +9 -0
- package/docs/sdk/models/operations/createkmspageresponse.md +11 -0
- package/docs/sdk/models/operations/createkmsspacerequest.md +9 -0
- package/docs/sdk/models/operations/createkmsspaceresponse.md +11 -0
- package/docs/sdk/models/operations/createmessagingmessagerequest.md +9 -0
- package/docs/sdk/models/operations/createmessagingmessageresponse.md +11 -0
- package/docs/sdk/models/operations/getkmspagerequest.md +10 -0
- package/docs/sdk/models/operations/getkmspageresponse.md +11 -0
- package/docs/sdk/models/operations/getkmsspacerequest.md +10 -0
- package/docs/sdk/models/operations/getkmsspaceresponse.md +11 -0
- package/docs/sdk/models/operations/getmessagingchannelrequest.md +10 -0
- package/docs/sdk/models/operations/getmessagingchannelresponse.md +11 -0
- package/docs/sdk/models/operations/getmessagingmessagerequest.md +10 -0
- package/docs/sdk/models/operations/getmessagingmessageresponse.md +11 -0
- package/docs/sdk/models/operations/listkmspagesrequest.md +17 -0
- package/docs/sdk/models/operations/listkmspagesresponse.md +11 -0
- package/docs/sdk/models/operations/listkmsspacesrequest.md +16 -0
- package/docs/sdk/models/operations/listkmsspacesresponse.md +11 -0
- package/docs/sdk/models/operations/listmessagingchannelsrequest.md +15 -0
- package/docs/sdk/models/operations/listmessagingchannelsresponse.md +11 -0
- package/docs/sdk/models/operations/listmessagingmessagesrequest.md +17 -0
- package/docs/sdk/models/operations/listmessagingmessagesresponse.md +11 -0
- package/docs/sdk/models/operations/listunifiedintegrationsqueryparamcategories.md +3 -1
- package/docs/sdk/models/operations/patchkmspagerequest.md +10 -0
- package/docs/sdk/models/operations/patchkmspageresponse.md +11 -0
- package/docs/sdk/models/operations/patchkmsspacerequest.md +10 -0
- package/docs/sdk/models/operations/patchkmsspaceresponse.md +11 -0
- package/docs/sdk/models/operations/patchmessagingmessagerequest.md +10 -0
- package/docs/sdk/models/operations/patchmessagingmessageresponse.md +11 -0
- package/docs/sdk/models/operations/queryparamcategories.md +3 -1
- package/docs/sdk/models/operations/removekmspagerequest.md +9 -0
- package/docs/sdk/models/operations/removekmspageresponse.md +11 -0
- package/docs/sdk/models/operations/removekmsspacerequest.md +9 -0
- package/docs/sdk/models/operations/removekmsspaceresponse.md +11 -0
- package/docs/sdk/models/operations/removemessagingmessagerequest.md +9 -0
- package/docs/sdk/models/operations/removemessagingmessageresponse.md +11 -0
- package/docs/sdk/models/operations/scopes.md +10 -1
- package/docs/sdk/models/operations/updatekmspagerequest.md +10 -0
- package/docs/sdk/models/operations/updatekmspageresponse.md +11 -0
- package/docs/sdk/models/operations/updatekmsspacerequest.md +10 -0
- package/docs/sdk/models/operations/updatekmsspaceresponse.md +11 -0
- package/docs/sdk/models/operations/updatemessagingmessagerequest.md +10 -0
- package/docs/sdk/models/operations/updatemessagingmessageresponse.md +11 -0
- package/docs/sdk/models/shared/integrationsupport.md +2 -0
- package/docs/sdk/models/shared/kmspage.md +18 -0
- package/docs/sdk/models/shared/kmspagetype.md +10 -0
- package/docs/sdk/models/shared/kmsspace.md +16 -0
- package/docs/sdk/models/shared/messagingchannel.md +19 -0
- package/docs/sdk/models/shared/messagingmember.md +10 -0
- package/docs/sdk/models/shared/messagingmessage.md +20 -0
- package/docs/sdk/models/shared/objecttype.md +5 -1
- package/docs/sdk/models/shared/propertyconnectioncategories.md +3 -1
- package/docs/sdk/models/shared/propertyconnectionpermissions.md +10 -1
- package/docs/sdk/models/shared/propertyintegrationcategories.md +3 -1
- package/docs/sdk/models/shared/propertymessagingmessageauthormember.md +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as operations from "../sdk/models/operations";
|
|
2
|
+
import { SDKConfiguration } from "./sdk";
|
|
3
|
+
import { AxiosRequestConfig } from "axios";
|
|
4
|
+
export declare class Channel {
|
|
5
|
+
private sdkConfiguration;
|
|
6
|
+
constructor(sdkConfig: SDKConfiguration);
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve a channel
|
|
9
|
+
*/
|
|
10
|
+
getMessagingChannel(req: operations.GetMessagingChannelRequest, config?: AxiosRequestConfig): Promise<operations.GetMessagingChannelResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* List all channels
|
|
13
|
+
*/
|
|
14
|
+
listMessagingChannels(req: operations.ListMessagingChannelsRequest, config?: AxiosRequestConfig): Promise<operations.ListMessagingChannelsResponse>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(o, k2, desc);
|
|
23
|
+
}) : (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
o[k2] = m[k];
|
|
26
|
+
}));
|
|
27
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
+
}) : function(o, v) {
|
|
30
|
+
o["default"] = v;
|
|
31
|
+
});
|
|
32
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
40
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
43
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
44
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
45
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
49
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
50
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
51
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
52
|
+
function step(op) {
|
|
53
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
55
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
56
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
+
switch (op[0]) {
|
|
58
|
+
case 0: case 1: t = op; break;
|
|
59
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
60
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
61
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
62
|
+
default:
|
|
63
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
64
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
65
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
66
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
67
|
+
if (t[2]) _.ops.pop();
|
|
68
|
+
_.trys.pop(); continue;
|
|
69
|
+
}
|
|
70
|
+
op = body.call(thisArg, _);
|
|
71
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
72
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
+
exports.Channel = void 0;
|
|
77
|
+
var utils = __importStar(require("../internal/utils"));
|
|
78
|
+
var errors = __importStar(require("../sdk/models/errors"));
|
|
79
|
+
var operations = __importStar(require("../sdk/models/operations"));
|
|
80
|
+
var shared = __importStar(require("../sdk/models/shared"));
|
|
81
|
+
var Channel = /** @class */ (function () {
|
|
82
|
+
function Channel(sdkConfig) {
|
|
83
|
+
this.sdkConfiguration = sdkConfig;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Retrieve a channel
|
|
87
|
+
*/
|
|
88
|
+
Channel.prototype.getMessagingChannel = function (req, config) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
|
|
92
|
+
return __generator(this, function (_c) {
|
|
93
|
+
switch (_c.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
96
|
+
req = new operations.GetMessagingChannelRequest(req);
|
|
97
|
+
}
|
|
98
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
99
|
+
operationUrl = utils.generateURL(baseURL, "/messaging/{connection_id}/channel/{id}", req);
|
|
100
|
+
client = this.sdkConfiguration.defaultClient;
|
|
101
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
102
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
103
|
+
return [4 /*yield*/, globalSecurity()];
|
|
104
|
+
case 1:
|
|
105
|
+
globalSecurity = _c.sent();
|
|
106
|
+
_c.label = 2;
|
|
107
|
+
case 2:
|
|
108
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
109
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
110
|
+
}
|
|
111
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
112
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
113
|
+
queryParams = utils.serializeQueryParams(req);
|
|
114
|
+
headers["Accept"] = "application/json";
|
|
115
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
116
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
117
|
+
case 3:
|
|
118
|
+
httpRes = _c.sent();
|
|
119
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
120
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
121
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
122
|
+
}
|
|
123
|
+
res = new operations.GetMessagingChannelResponse({
|
|
124
|
+
statusCode: httpRes.status,
|
|
125
|
+
contentType: responseContentType,
|
|
126
|
+
rawResponse: httpRes,
|
|
127
|
+
});
|
|
128
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
129
|
+
switch (true) {
|
|
130
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
131
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
132
|
+
res.messagingChannel = utils.objectToClass(JSON.parse(decodedRes), shared.MessagingChannel);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
139
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
140
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
141
|
+
}
|
|
142
|
+
return [2 /*return*/, res];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* List all channels
|
|
149
|
+
*/
|
|
150
|
+
Channel.prototype.listMessagingChannels = function (req, config) {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
153
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
|
|
154
|
+
return __generator(this, function (_c) {
|
|
155
|
+
switch (_c.label) {
|
|
156
|
+
case 0:
|
|
157
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
158
|
+
req = new operations.ListMessagingChannelsRequest(req);
|
|
159
|
+
}
|
|
160
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
161
|
+
operationUrl = utils.generateURL(baseURL, "/messaging/{connection_id}/channel", req);
|
|
162
|
+
client = this.sdkConfiguration.defaultClient;
|
|
163
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
164
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
165
|
+
return [4 /*yield*/, globalSecurity()];
|
|
166
|
+
case 1:
|
|
167
|
+
globalSecurity = _c.sent();
|
|
168
|
+
_c.label = 2;
|
|
169
|
+
case 2:
|
|
170
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
171
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
172
|
+
}
|
|
173
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
174
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
175
|
+
queryParams = utils.serializeQueryParams(req);
|
|
176
|
+
headers["Accept"] = "application/json";
|
|
177
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
178
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
179
|
+
case 3:
|
|
180
|
+
httpRes = _c.sent();
|
|
181
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
182
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
183
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
184
|
+
}
|
|
185
|
+
res = new operations.ListMessagingChannelsResponse({
|
|
186
|
+
statusCode: httpRes.status,
|
|
187
|
+
contentType: responseContentType,
|
|
188
|
+
rawResponse: httpRes,
|
|
189
|
+
});
|
|
190
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
191
|
+
switch (true) {
|
|
192
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
193
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
194
|
+
res.messagingChannels = [];
|
|
195
|
+
resFieldDepth = utils.getResFieldDepth(res);
|
|
196
|
+
res.messagingChannels = utils.objectToClass(JSON.parse(decodedRes), shared.MessagingChannel, resFieldDepth);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
203
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
204
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
205
|
+
}
|
|
206
|
+
return [2 /*return*/, res];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
return Channel;
|
|
212
|
+
}());
|
|
213
|
+
exports.Channel = Channel;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as operations from "../sdk/models/operations";
|
|
2
|
+
import { SDKConfiguration } from "./sdk";
|
|
3
|
+
import { AxiosRequestConfig } from "axios";
|
|
4
|
+
export declare class Kms {
|
|
5
|
+
private sdkConfiguration;
|
|
6
|
+
constructor(sdkConfig: SDKConfiguration);
|
|
7
|
+
/**
|
|
8
|
+
* Create a page
|
|
9
|
+
*/
|
|
10
|
+
createKmsPage(req: operations.CreateKmsPageRequest, config?: AxiosRequestConfig): Promise<operations.CreateKmsPageResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Create a space
|
|
13
|
+
*/
|
|
14
|
+
createKmsSpace(req: operations.CreateKmsSpaceRequest, config?: AxiosRequestConfig): Promise<operations.CreateKmsSpaceResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve a page
|
|
17
|
+
*/
|
|
18
|
+
getKmsPage(req: operations.GetKmsPageRequest, config?: AxiosRequestConfig): Promise<operations.GetKmsPageResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieve a space
|
|
21
|
+
*/
|
|
22
|
+
getKmsSpace(req: operations.GetKmsSpaceRequest, config?: AxiosRequestConfig): Promise<operations.GetKmsSpaceResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* List all pages
|
|
25
|
+
*/
|
|
26
|
+
listKmsPages(req: operations.ListKmsPagesRequest, config?: AxiosRequestConfig): Promise<operations.ListKmsPagesResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* List all spaces
|
|
29
|
+
*/
|
|
30
|
+
listKmsSpaces(req: operations.ListKmsSpacesRequest, config?: AxiosRequestConfig): Promise<operations.ListKmsSpacesResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Update a page
|
|
33
|
+
*/
|
|
34
|
+
patchKmsPage(req: operations.PatchKmsPageRequest, config?: AxiosRequestConfig): Promise<operations.PatchKmsPageResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Update a space
|
|
37
|
+
*/
|
|
38
|
+
patchKmsSpace(req: operations.PatchKmsSpaceRequest, config?: AxiosRequestConfig): Promise<operations.PatchKmsSpaceResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Remove a page
|
|
41
|
+
*/
|
|
42
|
+
removeKmsPage(req: operations.RemoveKmsPageRequest, config?: AxiosRequestConfig): Promise<operations.RemoveKmsPageResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove a space
|
|
45
|
+
*/
|
|
46
|
+
removeKmsSpace(req: operations.RemoveKmsSpaceRequest, config?: AxiosRequestConfig): Promise<operations.RemoveKmsSpaceResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Update a page
|
|
49
|
+
*/
|
|
50
|
+
updateKmsPage(req: operations.UpdateKmsPageRequest, config?: AxiosRequestConfig): Promise<operations.UpdateKmsPageResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Update a space
|
|
53
|
+
*/
|
|
54
|
+
updateKmsSpace(req: operations.UpdateKmsSpaceRequest, config?: AxiosRequestConfig): Promise<operations.UpdateKmsSpaceResponse>;
|
|
55
|
+
}
|