mavenagi 1.2.73 → 1.2.74
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/BaseClient.js +2 -2
- package/Client.d.ts +3 -0
- package/Client.js +41 -36
- package/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -0
- package/api/resources/actions/types/ActionRequest.d.ts +5 -0
- package/api/resources/agentVariants/types/AgentVariantResponse.d.ts +3 -1
- package/api/resources/agents/client/Client.d.ts +22 -12
- package/api/resources/agents/client/Client.js +22 -12
- package/api/resources/agents/types/AgentMigrations.d.ts +1 -1
- package/api/resources/agents/types/AgentSettingName.d.ts +1 -1
- package/api/resources/agents/types/AgentSettingName.js +1 -1
- package/api/resources/agents/types/VersionedAgentSettings.d.ts +1 -1
- package/api/resources/appDirectory/client/Client.d.ts +6 -2
- package/api/resources/appDirectory/client/Client.js +6 -2
- package/api/resources/apps/client/Client.d.ts +139 -0
- package/api/resources/apps/client/Client.js +504 -0
- package/api/resources/apps/client/index.d.ts +1 -0
- package/api/resources/apps/client/index.js +2 -0
- package/api/resources/apps/exports.d.ts +2 -0
- package/api/resources/apps/exports.js +21 -0
- package/api/resources/apps/index.d.ts +2 -0
- package/api/resources/apps/index.js +18 -0
- package/api/resources/apps/types/AppPatchRequest.d.ts +26 -0
- package/api/resources/apps/types/AppPatchRequest.js +3 -0
- package/api/resources/apps/types/AppRequest.d.ts +38 -0
- package/api/resources/apps/types/AppRequest.js +3 -0
- package/api/resources/apps/types/AppResponse.d.ts +29 -0
- package/api/resources/apps/types/AppResponse.js +3 -0
- package/api/resources/apps/types/AppsSearchRequest.d.ts +3 -0
- package/api/resources/apps/types/AppsSearchRequest.js +3 -0
- package/api/resources/apps/types/AppsSearchResponse.d.ts +5 -0
- package/api/resources/apps/types/AppsSearchResponse.js +3 -0
- package/api/resources/apps/types/index.d.ts +5 -0
- package/api/resources/apps/types/index.js +21 -0
- package/api/resources/capabilities/types/CapabilityExecutionBase.d.ts +7 -0
- package/api/resources/commons/types/ActionResponse.d.ts +2 -0
- package/api/resources/commons/types/AttachmentNotSentToModelReason.d.ts +11 -0
- package/api/resources/commons/types/AttachmentNotSentToModelReason.js +14 -0
- package/api/resources/commons/types/AttachmentNotSentToModelWarning.d.ts +10 -0
- package/api/resources/commons/types/AttachmentNotSentToModelWarning.js +3 -0
- package/api/resources/commons/types/BaseConversationResponse.d.ts +4 -0
- package/api/resources/commons/types/BotMessage.d.ts +9 -0
- package/api/resources/commons/types/BotMessageWarning.d.ts +13 -0
- package/api/resources/commons/types/BotMessageWarning.js +3 -0
- package/api/resources/commons/types/ChangeAuthor.d.ts +1 -1
- package/api/resources/commons/types/EntityType.d.ts +3 -0
- package/api/resources/commons/types/EntityType.js +3 -0
- package/api/resources/commons/types/ErrorMessage.d.ts +2 -0
- package/api/resources/commons/types/ErrorReason.d.ts +7 -1
- package/api/resources/commons/types/ErrorReason.js +7 -1
- package/api/resources/commons/types/Feedback.d.ts +8 -0
- package/api/resources/commons/types/FieldError.d.ts +6 -0
- package/api/resources/commons/types/FieldError.js +3 -0
- package/api/resources/commons/types/InboxItemBase.d.ts +13 -0
- package/api/resources/commons/types/IntelligentFieldValueResponse.d.ts +13 -1
- package/api/resources/commons/types/UserEvent.d.ts +8 -0
- package/api/resources/commons/types/UserMessage.d.ts +4 -0
- package/api/resources/commons/types/index.d.ts +4 -0
- package/api/resources/commons/types/index.js +4 -0
- package/api/resources/conversation/client/Client.d.ts +1 -1
- package/api/resources/conversation/client/Client.js +1 -1
- package/api/resources/conversation/types/AskRequestFields.d.ts +3 -2
- package/api/resources/conversation/types/ConversationFilter.d.ts +2 -2
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -1
- package/api/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.d.ts +5 -0
- package/api/resources/conversationKickoffs/types/ConversationKickoff.d.ts +2 -0
- package/api/resources/developersCommons/types/AppDirectoryDetails.d.ts +23 -0
- package/api/resources/developersCommons/types/AppDirectoryDetails.js +3 -0
- package/api/resources/developersCommons/types/AppDirectoryListing.d.ts +14 -0
- package/api/resources/developersCommons/types/AppDirectoryListing.js +3 -0
- package/api/resources/developersCommons/types/BaseApp.d.ts +1 -9
- package/api/resources/developersCommons/types/BaseDetailApp.d.ts +1 -18
- package/api/resources/developersCommons/types/MarketplaceAppDetail.d.ts +5 -2
- package/api/resources/developersCommons/types/index.d.ts +2 -0
- package/api/resources/developersCommons/types/index.js +2 -0
- package/api/resources/events/client/Client.d.ts +1 -1
- package/api/resources/events/client/Client.js +1 -1
- package/api/resources/index.d.ts +2 -0
- package/api/resources/index.js +3 -1
- package/api/resources/intelligentFields/types/IntelligentFieldValueSearchResponse.d.ts +4 -1
- package/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +5 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +2 -0
- package/api/resources/triggers/client/requests/PartialUpdateRequest.d.ts +5 -0
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +5 -0
- package/api/resources/triggers/types/EventTriggerResponse.d.ts +2 -0
- package/api/resources/users/types/AgentUser.d.ts +13 -0
- package/package.json +1 -1
- package/reference.md +340 -16
- package/serialization/resources/actions/client/requests/ActionPatchRequest.d.ts +4 -0
- package/serialization/resources/actions/client/requests/ActionPatchRequest.js +4 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +2 -0
- package/serialization/resources/actions/types/ActionRequest.js +2 -0
- package/serialization/resources/agentVariants/types/AgentVariantResponse.d.ts +1 -0
- package/serialization/resources/agentVariants/types/AgentVariantResponse.js +1 -0
- package/serialization/resources/apps/index.d.ts +1 -0
- package/serialization/resources/apps/index.js +17 -0
- package/serialization/resources/apps/types/AppPatchRequest.d.ts +21 -0
- package/serialization/resources/apps/types/AppPatchRequest.js +54 -0
- package/serialization/resources/apps/types/AppRequest.d.ts +13 -0
- package/serialization/resources/apps/types/AppRequest.js +48 -0
- package/serialization/resources/apps/types/AppResponse.d.ts +11 -0
- package/serialization/resources/apps/types/AppResponse.js +45 -0
- package/serialization/resources/apps/types/AppsSearchRequest.d.ts +9 -0
- package/serialization/resources/apps/types/AppsSearchRequest.js +40 -0
- package/serialization/resources/apps/types/AppsSearchResponse.d.ts +11 -0
- package/serialization/resources/apps/types/AppsSearchResponse.js +45 -0
- package/serialization/resources/apps/types/index.d.ts +5 -0
- package/serialization/resources/apps/types/index.js +21 -0
- package/serialization/resources/capabilities/types/CapabilityExecutionBase.d.ts +2 -0
- package/serialization/resources/capabilities/types/CapabilityExecutionBase.js +2 -0
- package/serialization/resources/commons/types/ActionResponse.d.ts +2 -0
- package/serialization/resources/commons/types/ActionResponse.js +2 -0
- package/serialization/resources/commons/types/AttachmentNotSentToModelReason.d.ts +7 -0
- package/serialization/resources/commons/types/AttachmentNotSentToModelReason.js +39 -0
- package/serialization/resources/commons/types/AttachmentNotSentToModelWarning.d.ts +13 -0
- package/serialization/resources/commons/types/AttachmentNotSentToModelWarning.js +45 -0
- package/serialization/resources/commons/types/BaseConversationResponse.d.ts +3 -0
- package/serialization/resources/commons/types/BaseConversationResponse.js +3 -0
- package/serialization/resources/commons/types/BotMessage.d.ts +5 -0
- package/serialization/resources/commons/types/BotMessage.js +5 -0
- package/serialization/resources/commons/types/BotMessageWarning.d.ts +11 -0
- package/serialization/resources/commons/types/BotMessageWarning.js +47 -0
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -0
- package/serialization/resources/commons/types/ErrorMessage.d.ts +2 -0
- package/serialization/resources/commons/types/ErrorMessage.js +2 -0
- package/serialization/resources/commons/types/ErrorReason.d.ts +1 -1
- package/serialization/resources/commons/types/ErrorReason.js +2 -0
- package/serialization/resources/commons/types/Feedback.d.ts +2 -0
- package/serialization/resources/commons/types/Feedback.js +2 -0
- package/serialization/resources/commons/types/FieldError.d.ts +10 -0
- package/serialization/resources/commons/types/FieldError.js +42 -0
- package/serialization/resources/commons/types/InboxItemBase.d.ts +3 -0
- package/serialization/resources/commons/types/InboxItemBase.js +3 -0
- package/serialization/resources/commons/types/IntelligentFieldValueResponse.d.ts +2 -0
- package/serialization/resources/commons/types/IntelligentFieldValueResponse.js +2 -0
- package/serialization/resources/commons/types/UserEvent.d.ts +2 -0
- package/serialization/resources/commons/types/UserEvent.js +2 -0
- package/serialization/resources/commons/types/UserMessage.d.ts +3 -0
- package/serialization/resources/commons/types/UserMessage.js +3 -0
- package/serialization/resources/commons/types/index.d.ts +4 -0
- package/serialization/resources/commons/types/index.js +4 -0
- package/serialization/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.d.ts +2 -0
- package/serialization/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.js +2 -0
- package/serialization/resources/conversationKickoffs/types/ConversationKickoff.d.ts +2 -0
- package/serialization/resources/conversationKickoffs/types/ConversationKickoff.js +2 -0
- package/serialization/resources/developersCommons/types/AppDirectoryDetails.d.ts +13 -0
- package/serialization/resources/developersCommons/types/AppDirectoryDetails.js +46 -0
- package/serialization/resources/developersCommons/types/AppDirectoryListing.d.ts +14 -0
- package/serialization/resources/developersCommons/types/AppDirectoryListing.js +46 -0
- package/serialization/resources/developersCommons/types/BaseApp.d.ts +2 -7
- package/serialization/resources/developersCommons/types/BaseApp.js +5 -8
- package/serialization/resources/developersCommons/types/BaseDetailApp.d.ts +3 -7
- package/serialization/resources/developersCommons/types/BaseDetailApp.js +3 -7
- package/serialization/resources/developersCommons/types/index.d.ts +2 -0
- package/serialization/resources/developersCommons/types/index.js +2 -0
- package/serialization/resources/index.d.ts +2 -0
- package/serialization/resources/index.js +3 -1
- package/serialization/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +2 -0
- package/serialization/resources/knowledge/client/requests/KnowledgeBasePatchRequest.js +2 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +2 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +2 -0
- package/serialization/resources/triggers/client/requests/PartialUpdateRequest.d.ts +2 -0
- package/serialization/resources/triggers/client/requests/PartialUpdateRequest.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +2 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +2 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.js +2 -0
- package/serialization/resources/users/types/AgentUser.d.ts +3 -0
- package/serialization/resources/users/types/AgentUser.js +3 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.AppsClient = void 0;
|
|
47
|
+
const BaseClient_1 = require("../../../../BaseClient");
|
|
48
|
+
const core = __importStar(require("../../../../core"));
|
|
49
|
+
const headers_1 = require("../../../../core/headers");
|
|
50
|
+
const requestBody_1 = require("../../../../core/requestBody");
|
|
51
|
+
const environments = __importStar(require("../../../../environments"));
|
|
52
|
+
const handleNonStatusCodeError_1 = require("../../../../errors/handleNonStatusCodeError");
|
|
53
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
54
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
55
|
+
const MavenAGI = __importStar(require("../../../index"));
|
|
56
|
+
class AppsClient {
|
|
57
|
+
constructor(options) {
|
|
58
|
+
this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create an app your organization owns, or replace one it already owns: every field the request
|
|
62
|
+
* leaves out is cleared. To change only some fields, use `patch`. Send `categories`,
|
|
63
|
+
* `capabilities`, `links` and `settingsSchema` every time, as `[]` when the app has none.
|
|
64
|
+
*
|
|
65
|
+
* App IDs are unique across Maven, so an ID another organization uses, or a deleted app used, is a
|
|
66
|
+
* 409. Requesting a permission you don't hold is a 403.
|
|
67
|
+
*
|
|
68
|
+
* A new app is in development: only your organization can see it in the app directory, and install
|
|
69
|
+
* it on its agents with the app directory's install (`POST /v1/directory/{appId}/install`). Its code
|
|
70
|
+
* runs as Functions, which you add with the Functions API. Making the app public, sharing it with
|
|
71
|
+
* other organizations, and setting its logo can't be done through this API.
|
|
72
|
+
*
|
|
73
|
+
* It can't change an app with a hosted deployment, made in App Studio, or an agent's own app (409),
|
|
74
|
+
* and it can't change the permissions of an app other organizations can install, because the change
|
|
75
|
+
* would reach them with no consent (409).
|
|
76
|
+
*
|
|
77
|
+
* <Note>**Required permission:** `edit:apps`</Note>
|
|
78
|
+
*
|
|
79
|
+
* @param {MavenAGI.AppRequest} request
|
|
80
|
+
* @param {AppsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
|
+
*
|
|
82
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
83
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
84
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
85
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
86
|
+
* @throws {@link MavenAGI.ServerError}
|
|
87
|
+
* @throws {@link errors.MavenAGIError}
|
|
88
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* await client.apps.createOrUpdate({
|
|
92
|
+
* id: "order-lookup",
|
|
93
|
+
* name: "Order lookup",
|
|
94
|
+
* shortDescription: "Looks up an order's status.",
|
|
95
|
+
* categories: ["CUSTOMER_SUPPORT"],
|
|
96
|
+
* capabilities: ["ACTIONS"],
|
|
97
|
+
* links: [],
|
|
98
|
+
* settingsSchema: [{
|
|
99
|
+
* type: "text",
|
|
100
|
+
* key: "apiKey",
|
|
101
|
+
* displayName: "API key"
|
|
102
|
+
* }],
|
|
103
|
+
* requestedPermissions: ["read:conversations"]
|
|
104
|
+
* })
|
|
105
|
+
*/
|
|
106
|
+
createOrUpdate(request, requestOptions) {
|
|
107
|
+
return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions));
|
|
108
|
+
}
|
|
109
|
+
__createOrUpdate(request, requestOptions) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
112
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
113
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
114
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
115
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
116
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
117
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
118
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, "/v1/apps"),
|
|
119
|
+
method: "PUT",
|
|
120
|
+
headers: _headers,
|
|
121
|
+
contentType: "application/json",
|
|
122
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
123
|
+
requestType: "json",
|
|
124
|
+
body: (0, requestBody_1.mergeAdditionalBodyParameters)(serializers.AppRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
125
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
126
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
127
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
128
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
129
|
+
logging: this._options.logging,
|
|
130
|
+
});
|
|
131
|
+
if (_response.ok) {
|
|
132
|
+
return {
|
|
133
|
+
data: serializers.AppResponse.parseOrThrow(_response.body, {
|
|
134
|
+
unrecognizedObjectKeys: "passthrough",
|
|
135
|
+
allowUnrecognizedUnionMembers: true,
|
|
136
|
+
allowUnrecognizedEnumValues: true,
|
|
137
|
+
breadcrumbsPrefix: ["response"],
|
|
138
|
+
}),
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (_response.error.reason === "status-code") {
|
|
143
|
+
switch (_response.error.statusCode) {
|
|
144
|
+
case 404:
|
|
145
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
147
|
+
allowUnrecognizedUnionMembers: true,
|
|
148
|
+
allowUnrecognizedEnumValues: true,
|
|
149
|
+
breadcrumbsPrefix: ["response"],
|
|
150
|
+
}), _response.rawResponse);
|
|
151
|
+
case 400:
|
|
152
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
153
|
+
unrecognizedObjectKeys: "passthrough",
|
|
154
|
+
allowUnrecognizedUnionMembers: true,
|
|
155
|
+
allowUnrecognizedEnumValues: true,
|
|
156
|
+
breadcrumbsPrefix: ["response"],
|
|
157
|
+
}), _response.rawResponse);
|
|
158
|
+
case 413:
|
|
159
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
160
|
+
unrecognizedObjectKeys: "passthrough",
|
|
161
|
+
allowUnrecognizedUnionMembers: true,
|
|
162
|
+
allowUnrecognizedEnumValues: true,
|
|
163
|
+
breadcrumbsPrefix: ["response"],
|
|
164
|
+
}), _response.rawResponse);
|
|
165
|
+
case 429:
|
|
166
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
167
|
+
unrecognizedObjectKeys: "passthrough",
|
|
168
|
+
allowUnrecognizedUnionMembers: true,
|
|
169
|
+
allowUnrecognizedEnumValues: true,
|
|
170
|
+
breadcrumbsPrefix: ["response"],
|
|
171
|
+
}), _response.rawResponse);
|
|
172
|
+
case 500:
|
|
173
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
174
|
+
unrecognizedObjectKeys: "passthrough",
|
|
175
|
+
allowUnrecognizedUnionMembers: true,
|
|
176
|
+
allowUnrecognizedEnumValues: true,
|
|
177
|
+
breadcrumbsPrefix: ["response"],
|
|
178
|
+
}), _response.rawResponse);
|
|
179
|
+
default:
|
|
180
|
+
throw new errors.MavenAGIError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.body,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/v1/apps");
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Change some fields of an app your organization owns. Fields the request leaves out keep their
|
|
192
|
+
* values. Set a text field to null to clear it; send `[]` to empty a list.
|
|
193
|
+
*
|
|
194
|
+
* An app your organization doesn't own, or that doesn't exist, is a 403. Requesting a permission
|
|
195
|
+
* you don't hold is a 403. It can't change an app with a hosted deployment, made in App Studio, or
|
|
196
|
+
* an agent's own app (409), and it can't change the permissions of an app other organizations can
|
|
197
|
+
* install, because the change would reach them with no consent (409).
|
|
198
|
+
*
|
|
199
|
+
* <Note>**Required permission:** `edit:apps`</Note>
|
|
200
|
+
*
|
|
201
|
+
* @param {string} appId - The ID of the app to change.
|
|
202
|
+
* @param {MavenAGI.AppPatchRequest} request
|
|
203
|
+
* @param {AppsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
204
|
+
*
|
|
205
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
206
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
207
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
208
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
209
|
+
* @throws {@link MavenAGI.ServerError}
|
|
210
|
+
* @throws {@link errors.MavenAGIError}
|
|
211
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* await client.apps.patch("appId", {})
|
|
215
|
+
*/
|
|
216
|
+
patch(appId, request, requestOptions) {
|
|
217
|
+
return core.HttpResponsePromise.fromPromise(this.__patch(appId, request, requestOptions));
|
|
218
|
+
}
|
|
219
|
+
__patch(appId, request, requestOptions) {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
221
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
222
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
223
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
224
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
225
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
226
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
227
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
228
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/apps/${core.url.encodePathParam(appId, errors.MavenAGIError)}`),
|
|
229
|
+
method: "PATCH",
|
|
230
|
+
headers: _headers,
|
|
231
|
+
contentType: "application/merge-patch+json",
|
|
232
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
233
|
+
requestType: "json",
|
|
234
|
+
body: (0, requestBody_1.mergeAdditionalBodyParameters)(serializers.AppPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
235
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
236
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
237
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
238
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
239
|
+
logging: this._options.logging,
|
|
240
|
+
});
|
|
241
|
+
if (_response.ok) {
|
|
242
|
+
return {
|
|
243
|
+
data: serializers.AppResponse.parseOrThrow(_response.body, {
|
|
244
|
+
unrecognizedObjectKeys: "passthrough",
|
|
245
|
+
allowUnrecognizedUnionMembers: true,
|
|
246
|
+
allowUnrecognizedEnumValues: true,
|
|
247
|
+
breadcrumbsPrefix: ["response"],
|
|
248
|
+
}),
|
|
249
|
+
rawResponse: _response.rawResponse,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (_response.error.reason === "status-code") {
|
|
253
|
+
switch (_response.error.statusCode) {
|
|
254
|
+
case 404:
|
|
255
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
256
|
+
unrecognizedObjectKeys: "passthrough",
|
|
257
|
+
allowUnrecognizedUnionMembers: true,
|
|
258
|
+
allowUnrecognizedEnumValues: true,
|
|
259
|
+
breadcrumbsPrefix: ["response"],
|
|
260
|
+
}), _response.rawResponse);
|
|
261
|
+
case 400:
|
|
262
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
263
|
+
unrecognizedObjectKeys: "passthrough",
|
|
264
|
+
allowUnrecognizedUnionMembers: true,
|
|
265
|
+
allowUnrecognizedEnumValues: true,
|
|
266
|
+
breadcrumbsPrefix: ["response"],
|
|
267
|
+
}), _response.rawResponse);
|
|
268
|
+
case 413:
|
|
269
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
270
|
+
unrecognizedObjectKeys: "passthrough",
|
|
271
|
+
allowUnrecognizedUnionMembers: true,
|
|
272
|
+
allowUnrecognizedEnumValues: true,
|
|
273
|
+
breadcrumbsPrefix: ["response"],
|
|
274
|
+
}), _response.rawResponse);
|
|
275
|
+
case 429:
|
|
276
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
277
|
+
unrecognizedObjectKeys: "passthrough",
|
|
278
|
+
allowUnrecognizedUnionMembers: true,
|
|
279
|
+
allowUnrecognizedEnumValues: true,
|
|
280
|
+
breadcrumbsPrefix: ["response"],
|
|
281
|
+
}), _response.rawResponse);
|
|
282
|
+
case 500:
|
|
283
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
284
|
+
unrecognizedObjectKeys: "passthrough",
|
|
285
|
+
allowUnrecognizedUnionMembers: true,
|
|
286
|
+
allowUnrecognizedEnumValues: true,
|
|
287
|
+
breadcrumbsPrefix: ["response"],
|
|
288
|
+
}), _response.rawResponse);
|
|
289
|
+
default:
|
|
290
|
+
throw new errors.MavenAGIError({
|
|
291
|
+
statusCode: _response.error.statusCode,
|
|
292
|
+
body: _response.error.body,
|
|
293
|
+
rawResponse: _response.rawResponse,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/apps/{appId}");
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Search the apps your organization owns, newest first unless `sortDesc` is false, with how many
|
|
302
|
+
* agents each is installed on. Leaves out each agent's own app.
|
|
303
|
+
*
|
|
304
|
+
* <Note>**Required permission:** `read:apps`</Note>
|
|
305
|
+
*
|
|
306
|
+
* @param {MavenAGI.AppsSearchRequest} request
|
|
307
|
+
* @param {AppsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
308
|
+
*
|
|
309
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
310
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
311
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
312
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
313
|
+
* @throws {@link MavenAGI.ServerError}
|
|
314
|
+
* @throws {@link errors.MavenAGIError}
|
|
315
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* await client.apps.search({})
|
|
319
|
+
*/
|
|
320
|
+
search(request, requestOptions) {
|
|
321
|
+
return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
|
|
322
|
+
}
|
|
323
|
+
__search(request, requestOptions) {
|
|
324
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
325
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
326
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
327
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
328
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
329
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
330
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
331
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
332
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, "/v1/apps/search"),
|
|
333
|
+
method: "POST",
|
|
334
|
+
headers: _headers,
|
|
335
|
+
contentType: "application/json",
|
|
336
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
337
|
+
requestType: "json",
|
|
338
|
+
body: (0, requestBody_1.mergeAdditionalBodyParameters)(serializers.AppsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
339
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
340
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
341
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
342
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
343
|
+
logging: this._options.logging,
|
|
344
|
+
});
|
|
345
|
+
if (_response.ok) {
|
|
346
|
+
return {
|
|
347
|
+
data: serializers.AppsSearchResponse.parseOrThrow(_response.body, {
|
|
348
|
+
unrecognizedObjectKeys: "passthrough",
|
|
349
|
+
allowUnrecognizedUnionMembers: true,
|
|
350
|
+
allowUnrecognizedEnumValues: true,
|
|
351
|
+
breadcrumbsPrefix: ["response"],
|
|
352
|
+
}),
|
|
353
|
+
rawResponse: _response.rawResponse,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
if (_response.error.reason === "status-code") {
|
|
357
|
+
switch (_response.error.statusCode) {
|
|
358
|
+
case 404:
|
|
359
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
360
|
+
unrecognizedObjectKeys: "passthrough",
|
|
361
|
+
allowUnrecognizedUnionMembers: true,
|
|
362
|
+
allowUnrecognizedEnumValues: true,
|
|
363
|
+
breadcrumbsPrefix: ["response"],
|
|
364
|
+
}), _response.rawResponse);
|
|
365
|
+
case 400:
|
|
366
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
367
|
+
unrecognizedObjectKeys: "passthrough",
|
|
368
|
+
allowUnrecognizedUnionMembers: true,
|
|
369
|
+
allowUnrecognizedEnumValues: true,
|
|
370
|
+
breadcrumbsPrefix: ["response"],
|
|
371
|
+
}), _response.rawResponse);
|
|
372
|
+
case 413:
|
|
373
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
374
|
+
unrecognizedObjectKeys: "passthrough",
|
|
375
|
+
allowUnrecognizedUnionMembers: true,
|
|
376
|
+
allowUnrecognizedEnumValues: true,
|
|
377
|
+
breadcrumbsPrefix: ["response"],
|
|
378
|
+
}), _response.rawResponse);
|
|
379
|
+
case 429:
|
|
380
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
381
|
+
unrecognizedObjectKeys: "passthrough",
|
|
382
|
+
allowUnrecognizedUnionMembers: true,
|
|
383
|
+
allowUnrecognizedEnumValues: true,
|
|
384
|
+
breadcrumbsPrefix: ["response"],
|
|
385
|
+
}), _response.rawResponse);
|
|
386
|
+
case 500:
|
|
387
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
388
|
+
unrecognizedObjectKeys: "passthrough",
|
|
389
|
+
allowUnrecognizedUnionMembers: true,
|
|
390
|
+
allowUnrecognizedEnumValues: true,
|
|
391
|
+
breadcrumbsPrefix: ["response"],
|
|
392
|
+
}), _response.rawResponse);
|
|
393
|
+
default:
|
|
394
|
+
throw new errors.MavenAGIError({
|
|
395
|
+
statusCode: _response.error.statusCode,
|
|
396
|
+
body: _response.error.body,
|
|
397
|
+
rawResponse: _response.rawResponse,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/apps/search");
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Delete an app your organization owns. An app your organization doesn't own, or that doesn't exist,
|
|
406
|
+
* is a 403.
|
|
407
|
+
*
|
|
408
|
+
* An app that is still installed on any agent can't be deleted: uninstall it everywhere first, or
|
|
409
|
+
* the request fails with a 409. Its `installCount` says how many agents have it, and the app
|
|
410
|
+
* directory shows whether a given agent does; uninstall it from each with the app directory's
|
|
411
|
+
* uninstall (`DELETE /v1/directory/{appId}/install`). That includes agents in other organizations
|
|
412
|
+
* an app is public or shared with, which only those organizations can uninstall.
|
|
413
|
+
*
|
|
414
|
+
* <Note>**Required permission:** `edit:apps`</Note>
|
|
415
|
+
*
|
|
416
|
+
* @param {string} appId - The ID of the app to delete.
|
|
417
|
+
* @param {AppsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
418
|
+
*
|
|
419
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
420
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
421
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
422
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
423
|
+
* @throws {@link MavenAGI.ServerError}
|
|
424
|
+
* @throws {@link errors.MavenAGIError}
|
|
425
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* await client.apps.delete("appId")
|
|
429
|
+
*/
|
|
430
|
+
delete(appId, requestOptions) {
|
|
431
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(appId, requestOptions));
|
|
432
|
+
}
|
|
433
|
+
__delete(appId, requestOptions) {
|
|
434
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
436
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
437
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
438
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
439
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
440
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
441
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
442
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/apps/${core.url.encodePathParam(appId, errors.MavenAGIError)}`),
|
|
443
|
+
method: "DELETE",
|
|
444
|
+
headers: _headers,
|
|
445
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
446
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
447
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
448
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
449
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
450
|
+
logging: this._options.logging,
|
|
451
|
+
});
|
|
452
|
+
if (_response.ok) {
|
|
453
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
454
|
+
}
|
|
455
|
+
if (_response.error.reason === "status-code") {
|
|
456
|
+
switch (_response.error.statusCode) {
|
|
457
|
+
case 404:
|
|
458
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
459
|
+
unrecognizedObjectKeys: "passthrough",
|
|
460
|
+
allowUnrecognizedUnionMembers: true,
|
|
461
|
+
allowUnrecognizedEnumValues: true,
|
|
462
|
+
breadcrumbsPrefix: ["response"],
|
|
463
|
+
}), _response.rawResponse);
|
|
464
|
+
case 400:
|
|
465
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
466
|
+
unrecognizedObjectKeys: "passthrough",
|
|
467
|
+
allowUnrecognizedUnionMembers: true,
|
|
468
|
+
allowUnrecognizedEnumValues: true,
|
|
469
|
+
breadcrumbsPrefix: ["response"],
|
|
470
|
+
}), _response.rawResponse);
|
|
471
|
+
case 413:
|
|
472
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
473
|
+
unrecognizedObjectKeys: "passthrough",
|
|
474
|
+
allowUnrecognizedUnionMembers: true,
|
|
475
|
+
allowUnrecognizedEnumValues: true,
|
|
476
|
+
breadcrumbsPrefix: ["response"],
|
|
477
|
+
}), _response.rawResponse);
|
|
478
|
+
case 429:
|
|
479
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
480
|
+
unrecognizedObjectKeys: "passthrough",
|
|
481
|
+
allowUnrecognizedUnionMembers: true,
|
|
482
|
+
allowUnrecognizedEnumValues: true,
|
|
483
|
+
breadcrumbsPrefix: ["response"],
|
|
484
|
+
}), _response.rawResponse);
|
|
485
|
+
case 500:
|
|
486
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
487
|
+
unrecognizedObjectKeys: "passthrough",
|
|
488
|
+
allowUnrecognizedUnionMembers: true,
|
|
489
|
+
allowUnrecognizedEnumValues: true,
|
|
490
|
+
breadcrumbsPrefix: ["response"],
|
|
491
|
+
}), _response.rawResponse);
|
|
492
|
+
default:
|
|
493
|
+
throw new errors.MavenAGIError({
|
|
494
|
+
statusCode: _response.error.statusCode,
|
|
495
|
+
body: _response.error.body,
|
|
496
|
+
rawResponse: _response.rawResponse,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/apps/{appId}");
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
exports.AppsClient = AppsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AppsClient = void 0;
|
|
19
|
+
var Client_1 = require("./client/Client");
|
|
20
|
+
Object.defineProperty(exports, "AppsClient", { enumerable: true, get: function () { return Client_1.AppsClient; } });
|
|
21
|
+
__exportStar(require("./client/index"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* The fields to change. Leave a field out to keep it. Set a text field to null to clear it; send `[]` to empty a list.
|
|
4
|
+
*/
|
|
5
|
+
export interface AppPatchRequest {
|
|
6
|
+
/** Display name shown in the app directory. At most 191 characters. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Full description shown on the app's detail page. */
|
|
9
|
+
description?: string | null;
|
|
10
|
+
/** One-line summary shown on the app's card in the directory listing. At most 191 characters. */
|
|
11
|
+
shortDescription?: string | null;
|
|
12
|
+
/** Categories the app is filed under in the directory. */
|
|
13
|
+
categories?: MavenAGI.AppCategory[];
|
|
14
|
+
/** The kinds of functionality the app provides, such as actions, triggers, or knowledge bases. */
|
|
15
|
+
capabilities?: MavenAGI.AppCapability[];
|
|
16
|
+
/** Guidance shown while installing the app, for example how to obtain the credentials it asks for. */
|
|
17
|
+
installationInstructions?: string | null;
|
|
18
|
+
/** Guidance shown once the app is installed. */
|
|
19
|
+
instructions?: string | null;
|
|
20
|
+
/** Supporting links, such as documentation or a privacy policy. */
|
|
21
|
+
links?: MavenAGI.Link[];
|
|
22
|
+
/** The settings the app accepts, which the person installing it fills in. */
|
|
23
|
+
settingsSchema?: MavenAGI.SettingsSchema;
|
|
24
|
+
/** The Maven API permissions the app's Functions get when they run. You can request only permissions you hold yourself. */
|
|
25
|
+
requestedPermissions?: string[];
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* An app's ID and name, and everything else its organization sets.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* id: "order-lookup",
|
|
8
|
+
* name: "Order lookup",
|
|
9
|
+
* shortDescription: "Looks up an order's status.",
|
|
10
|
+
* categories: [MavenAGI.AppCategory.CustomerSupport],
|
|
11
|
+
* capabilities: [MavenAGI.AppCapability.Actions],
|
|
12
|
+
* links: [],
|
|
13
|
+
* settingsSchema: [{
|
|
14
|
+
* type: "text",
|
|
15
|
+
* key: "apiKey",
|
|
16
|
+
* displayName: "API key"
|
|
17
|
+
* }],
|
|
18
|
+
* requestedPermissions: ["read:conversations"]
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export interface AppRequest extends MavenAGI.AppDirectoryListing, MavenAGI.AppDirectoryDetails {
|
|
22
|
+
/**
|
|
23
|
+
* The app's ID, unique across Maven: 3 to 24 lowercase letters, numbers or hyphens, with no two
|
|
24
|
+
* hyphens in a row. It can't begin with `integration`, `sandbox`, `production` or `development`,
|
|
25
|
+
* and can't be a reserved word such as `api`, `app`, `mcp` or `test`.
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
/** Display name shown in the app directory. At most 191 characters. */
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* The Maven API permissions the app's Functions get when they run, such as `read:conversations`.
|
|
32
|
+
* Defaults to none. You can request only permissions you hold yourself. A Function's token
|
|
33
|
+
* carries only the ones that act on one agent: `ask:agent`, `create:simulations`, `read:agents`,
|
|
34
|
+
* `edit:agents`, `read:organization`, and reading, editing and deleting conversations and
|
|
35
|
+
* documents.
|
|
36
|
+
*/
|
|
37
|
+
requestedPermissions?: string[];
|
|
38
|
+
}
|