@microsoft/teamsfx-api 0.22.4-alpha.a32ea10b4.0 → 0.22.4-alpha.a80a9a6b9.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/build/cli.d.ts +203 -0
- package/build/cli.d.ts.map +1 -0
- package/build/{bicep.js → cli.js} +1 -1
- package/build/cli.js.map +1 -0
- package/build/constants.d.ts +4 -9
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +4 -9
- package/build/constants.js.map +1 -1
- package/build/context.d.ts +9 -28
- package/build/context.d.ts.map +1 -1
- package/build/error.d.ts +4 -0
- package/build/error.d.ts.map +1 -1
- package/build/error.js +6 -4
- package/build/error.js.map +1 -1
- package/build/index.d.ts +5 -12
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -13
- package/build/index.js.map +1 -1
- package/build/qm/question.d.ts +134 -26
- package/build/qm/question.d.ts.map +1 -1
- package/build/qm/question.js +0 -53
- package/build/qm/question.js.map +1 -1
- package/build/qm/ui.d.ts +59 -10
- package/build/qm/ui.d.ts.map +1 -1
- package/build/qm/validation.d.ts +7 -18
- package/build/qm/validation.d.ts.map +1 -1
- package/build/qm/validation.js +0 -159
- package/build/qm/validation.js.map +1 -1
- package/build/types.d.ts +73 -148
- package/build/types.d.ts.map +1 -1
- package/build/types.js +8 -87
- package/build/types.js.map +1 -1
- package/build/utils/log.d.ts +23 -36
- package/build/utils/log.d.ts.map +1 -1
- package/build/utils/log.js +7 -11
- package/build/utils/log.js.map +1 -1
- package/build/utils/login.d.ts +4 -4
- package/build/utils/login.d.ts.map +1 -1
- package/build/utils/login.js +4 -4
- package/build/utils/login.js.map +1 -1
- package/build/utils/telemetry.d.ts.map +1 -1
- package/package.json +8 -6
- package/build/action.d.ts +0 -109
- package/build/action.d.ts.map +0 -1
- package/build/action.js +0 -5
- package/build/action.js.map +0 -1
- package/build/bicep.d.ts +0 -19
- package/build/bicep.d.ts.map +0 -1
- package/build/bicep.js.map +0 -1
- package/build/component.d.ts +0 -31
- package/build/component.d.ts.map +0 -1
- package/build/component.js +0 -3
- package/build/component.js.map +0 -1
- package/build/v2/index.d.ts +0 -2
- package/build/v2/index.d.ts.map +0 -1
- package/build/v2/index.js +0 -7
- package/build/v2/index.js.map +0 -1
- package/build/v2/types.d.ts +0 -32
- package/build/v2/types.d.ts.map +0 -1
- package/build/v2/types.js +0 -5
- package/build/v2/types.js.map +0 -1
- package/build/v3/AzureResourceStates.d.ts +0 -58
- package/build/v3/AzureResourceStates.d.ts.map +0 -1
- package/build/v3/AzureResourceStates.js +0 -3
- package/build/v3/AzureResourceStates.js.map +0 -1
- package/build/v3/index.d.ts +0 -5
- package/build/v3/index.d.ts.map +0 -1
- package/build/v3/index.js +0 -10
- package/build/v3/index.js.map +0 -1
- package/build/v3/plugins.d.ts +0 -12
- package/build/v3/plugins.d.ts.map +0 -1
- package/build/v3/plugins.js +0 -5
- package/build/v3/plugins.js.map +0 -1
- package/build/v3/resourceStates.d.ts +0 -66
- package/build/v3/resourceStates.d.ts.map +0 -1
- package/build/v3/resourceStates.js +0 -5
- package/build/v3/resourceStates.js.map +0 -1
- package/build/v3/types.d.ts +0 -28
- package/build/v3/types.d.ts.map +0 -1
- package/build/v3/types.js +0 -5
- package/build/v3/types.js.map +0 -1
package/build/qm/validation.js
CHANGED
|
@@ -1,162 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validate = exports.getValidationFunction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// Copyright (c) Microsoft Corporation.
|
|
6
|
-
// Licensed under the MIT license.
|
|
7
|
-
const jsonschema = tslib_1.__importStar(require("jsonschema"));
|
|
8
|
-
/**
|
|
9
|
-
* A function to return a validation function according the validation schema
|
|
10
|
-
* @param validation validation schema
|
|
11
|
-
* @param inputs object to carry all user inputs
|
|
12
|
-
* @returns a validation function
|
|
13
|
-
*/
|
|
14
|
-
function getValidationFunction(validation, inputs) {
|
|
15
|
-
return function (input) {
|
|
16
|
-
return validate(validation, input, inputs);
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
exports.getValidationFunction = getValidationFunction;
|
|
20
|
-
/**
|
|
21
|
-
* Implementation of validation function
|
|
22
|
-
* @param validSchema validation schema
|
|
23
|
-
* @param value value to validate
|
|
24
|
-
* @param inputs user inputs object, which works as the context of the validation
|
|
25
|
-
* @returns A human-readable string which is presented as diagnostic message.
|
|
26
|
-
* Return `undefined` when 'value' is valid.
|
|
27
|
-
*/
|
|
28
|
-
async function validate(validSchema, value, inputs) {
|
|
29
|
-
{
|
|
30
|
-
//FuncValidation
|
|
31
|
-
const funcValidation = validSchema;
|
|
32
|
-
if (funcValidation.validFunc) {
|
|
33
|
-
const res = await funcValidation.validFunc(value, inputs);
|
|
34
|
-
return res;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (!value) {
|
|
38
|
-
if (validSchema.required === true)
|
|
39
|
-
return `input value is required.`;
|
|
40
|
-
}
|
|
41
|
-
{
|
|
42
|
-
// StringValidation
|
|
43
|
-
const stringValidation = validSchema;
|
|
44
|
-
const strToValidate = value;
|
|
45
|
-
if (typeof strToValidate === "string") {
|
|
46
|
-
const schema = {};
|
|
47
|
-
if (stringValidation.equals && typeof stringValidation.equals === "string")
|
|
48
|
-
schema.const = stringValidation.equals;
|
|
49
|
-
if (stringValidation.enum &&
|
|
50
|
-
stringValidation.enum.length > 0 &&
|
|
51
|
-
typeof stringValidation.enum[0] === "string")
|
|
52
|
-
schema.enum = stringValidation.enum;
|
|
53
|
-
if (stringValidation.minLength)
|
|
54
|
-
schema.minLength = stringValidation.minLength;
|
|
55
|
-
if (stringValidation.maxLength)
|
|
56
|
-
schema.maxLength = stringValidation.maxLength;
|
|
57
|
-
if (stringValidation.pattern)
|
|
58
|
-
schema.pattern = stringValidation.pattern;
|
|
59
|
-
if (Object.keys(schema).length > 0) {
|
|
60
|
-
const validateResult = jsonschema.validate(strToValidate, schema);
|
|
61
|
-
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
62
|
-
return `'${strToValidate}' ${validateResult.errors[0].message}`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (stringValidation.startsWith) {
|
|
66
|
-
if (!strToValidate.startsWith(stringValidation.startsWith)) {
|
|
67
|
-
return `'${strToValidate}' does not meet startsWith:'${stringValidation.startsWith}'`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (stringValidation.endsWith) {
|
|
71
|
-
if (!strToValidate.endsWith(stringValidation.endsWith)) {
|
|
72
|
-
return `'${strToValidate}' does not meet endsWith:'${stringValidation.endsWith}'`;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (stringValidation.includes && typeof strToValidate === "string") {
|
|
76
|
-
if (!strToValidate.includes(stringValidation.includes)) {
|
|
77
|
-
return `'${strToValidate}' does not meet includes:'${stringValidation.includes}'`;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (stringValidation.notEquals && typeof strToValidate === "string") {
|
|
81
|
-
if (strToValidate === stringValidation.notEquals) {
|
|
82
|
-
return `'${strToValidate}' does not meet notEquals:'${stringValidation.notEquals}'`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//StringArrayValidation
|
|
88
|
-
{
|
|
89
|
-
const stringArrayValidation = validSchema;
|
|
90
|
-
const arrayToValidate = value;
|
|
91
|
-
if (arrayToValidate instanceof Array) {
|
|
92
|
-
const schema = {};
|
|
93
|
-
if (stringArrayValidation.maxItems)
|
|
94
|
-
schema.maxItems = stringArrayValidation.maxItems;
|
|
95
|
-
if (stringArrayValidation.minItems)
|
|
96
|
-
schema.minItems = stringArrayValidation.minItems;
|
|
97
|
-
if (stringArrayValidation.uniqueItems)
|
|
98
|
-
schema.uniqueItems = stringArrayValidation.uniqueItems;
|
|
99
|
-
if (Object.keys(schema).length > 0) {
|
|
100
|
-
const validateResult = jsonschema.validate(arrayToValidate, schema);
|
|
101
|
-
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
102
|
-
return `'${arrayToValidate}' ${validateResult.errors[0].message}`;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (stringArrayValidation.equals) {
|
|
106
|
-
if (stringArrayValidation.equals instanceof Array) {
|
|
107
|
-
stringArrayValidation.enum = stringArrayValidation.equals;
|
|
108
|
-
stringArrayValidation.containsAll = stringArrayValidation.equals;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return `Array '${arrayToValidate}' does not equals to string:'${stringArrayValidation.equals}'`;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (stringArrayValidation.enum) {
|
|
115
|
-
for (const item of arrayToValidate) {
|
|
116
|
-
if (!stringArrayValidation.enum.includes(item)) {
|
|
117
|
-
return `'${arrayToValidate}' does not meet with enum:'${stringArrayValidation.enum}'`;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (stringArrayValidation.excludes) {
|
|
122
|
-
if (arrayToValidate.includes(stringArrayValidation.excludes)) {
|
|
123
|
-
return `'${arrayToValidate}' does not meet with excludes:'${stringArrayValidation.excludes}'`;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (stringArrayValidation.contains) {
|
|
127
|
-
if (!arrayToValidate.includes(stringArrayValidation.contains)) {
|
|
128
|
-
return `'${arrayToValidate}' does not meet with contains:'${stringArrayValidation.contains}'`;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (stringArrayValidation.containsAll) {
|
|
132
|
-
const containsAll = stringArrayValidation.containsAll;
|
|
133
|
-
if (containsAll.length > 0) {
|
|
134
|
-
for (const i of containsAll) {
|
|
135
|
-
if (!arrayToValidate.includes(i)) {
|
|
136
|
-
return `'${arrayToValidate}' does not meet with containsAll:'${containsAll}'`;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (stringArrayValidation.containsAny) {
|
|
142
|
-
const containsAny = stringArrayValidation.containsAny;
|
|
143
|
-
if (containsAny.length > 0) {
|
|
144
|
-
// let array = valueToValidate as string[];
|
|
145
|
-
let found = false;
|
|
146
|
-
for (const i of containsAny) {
|
|
147
|
-
if (arrayToValidate.includes(i)) {
|
|
148
|
-
found = true;
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (!found) {
|
|
153
|
-
return `'${arrayToValidate}' does not meet containsAny:'${containsAny}'`;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return undefined;
|
|
160
|
-
}
|
|
161
|
-
exports.validate = validate;
|
|
162
3
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/qm/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/qm/validation.ts"],"names":[],"mappings":""}
|
package/build/types.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Context } from "./v2/types";
|
|
4
|
-
import { AppManifestProvider } from "./v3/plugins";
|
|
5
|
-
import { EnvInfoV3 } from "./v3/types";
|
|
6
|
-
export declare type Json = Record<string, any>;
|
|
7
|
-
export declare type ConfigValue = any;
|
|
8
|
-
export declare type PluginIdentity = string;
|
|
9
|
-
export declare type PluginConfig = ConfigMap;
|
|
10
|
-
export declare type ReadonlyPluginConfig = ReadonlyMap<string, ConfigValue>;
|
|
11
|
-
export declare type SolutionConfig = Map<PluginIdentity, PluginConfig>;
|
|
12
|
-
export declare type ReadonlySolutionConfig = ReadonlyMap<PluginIdentity, ReadonlyPluginConfig>;
|
|
1
|
+
import { IBot, IComposeExtension, IConfigurableTab, IStaticTab, IWebApplicationInfo } from "@microsoft/teams-manifest";
|
|
2
|
+
import { Platform } from "./constants";
|
|
13
3
|
/**
|
|
14
4
|
* Definition of option item in single selection or multiple selection
|
|
15
5
|
*/
|
|
@@ -35,7 +25,7 @@ export interface OptionItem {
|
|
|
35
25
|
*/
|
|
36
26
|
data?: unknown;
|
|
37
27
|
/**
|
|
38
|
-
* CLI display name. CLI will use `cliName` as display name, and use `id` instead if `cliName` is undefined.
|
|
28
|
+
* @deprecated CLI display name. CLI will use `cliName` as display name, and use `id` instead if `cliName` is undefined.
|
|
39
29
|
*/
|
|
40
30
|
cliName?: string;
|
|
41
31
|
/**
|
|
@@ -55,31 +45,8 @@ export interface OptionItem {
|
|
|
55
45
|
command: string;
|
|
56
46
|
}[];
|
|
57
47
|
}
|
|
58
|
-
export
|
|
59
|
-
getString(k: string, defaultValue?: string): string | undefined;
|
|
60
|
-
getBoolean(k: string, defaultValue?: boolean): boolean | undefined;
|
|
61
|
-
getNumber(k: string, defaultValue?: number): number | undefined;
|
|
62
|
-
getStringArray(k: string, defaultValue?: string[]): string[] | undefined;
|
|
63
|
-
getNumberArray(k: string, defaultValue?: number[]): number[] | undefined;
|
|
64
|
-
getBooleanArray(k: string, defaultValue?: boolean[]): boolean[] | undefined;
|
|
65
|
-
getOptionItem(k: string, defaultValue?: OptionItem): OptionItem | undefined;
|
|
66
|
-
getOptionItemArray(k: string, defaultValue?: OptionItem[]): OptionItem[] | undefined;
|
|
67
|
-
toJSON(): Json;
|
|
68
|
-
static fromJSON(obj?: Json): ConfigMap | undefined;
|
|
69
|
-
constructor(entries?: readonly (readonly [string, ConfigValue])[] | null);
|
|
70
|
-
}
|
|
71
|
-
export declare type Void = {};
|
|
48
|
+
export type Void = {};
|
|
72
49
|
export declare const Void: {};
|
|
73
|
-
export declare type ResourceTemplate = Record<string, ConfigValue>;
|
|
74
|
-
export declare type ResourceTemplates = {
|
|
75
|
-
[k: string]: ResourceTemplate | undefined;
|
|
76
|
-
};
|
|
77
|
-
export declare type ResourceConfig = ResourceTemplate;
|
|
78
|
-
export declare type ResourceConfigs = ResourceTemplates;
|
|
79
|
-
export declare type ReadonlyResourceConfig = Readonly<ResourceConfig>;
|
|
80
|
-
export declare type ReadonlyResourceConfigs = Readonly<{
|
|
81
|
-
[k: string]: ReadonlyResourceConfig | undefined;
|
|
82
|
-
}>;
|
|
83
50
|
/**
|
|
84
51
|
* environment meta data
|
|
85
52
|
*/
|
|
@@ -88,120 +55,20 @@ export interface EnvMeta {
|
|
|
88
55
|
local: boolean;
|
|
89
56
|
sideloading: boolean;
|
|
90
57
|
}
|
|
91
|
-
|
|
92
|
-
* project static settings
|
|
93
|
-
*/
|
|
94
|
-
export interface ProjectSettings {
|
|
95
|
-
appName?: string;
|
|
96
|
-
version?: string;
|
|
97
|
-
projectId: string;
|
|
98
|
-
programmingLanguage?: string;
|
|
99
|
-
defaultFunctionName?: string;
|
|
100
|
-
solutionSettings?: SolutionSettings;
|
|
101
|
-
isFromSample?: boolean;
|
|
102
|
-
isM365?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* pluginSettings is used for plugin settings irrelevant to environments
|
|
105
|
-
*/
|
|
106
|
-
pluginSettings?: Json;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* solution settings
|
|
110
|
-
*/
|
|
111
|
-
export interface SolutionSettings extends Json {
|
|
112
|
-
name: string;
|
|
113
|
-
/**
|
|
114
|
-
* solution settings schema version
|
|
115
|
-
*/
|
|
116
|
-
version?: string;
|
|
117
|
-
}
|
|
118
|
-
export interface AzureSolutionSettings extends SolutionSettings {
|
|
119
|
-
hostType: string;
|
|
120
|
-
capabilities: string[];
|
|
121
|
-
azureResources: string[];
|
|
122
|
-
activeResourcePlugins: string[];
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* local debug settings
|
|
126
|
-
*/
|
|
127
|
-
export interface LocalSettings {
|
|
128
|
-
teamsApp?: ConfigMap;
|
|
129
|
-
auth?: ConfigMap;
|
|
130
|
-
frontend?: ConfigMap;
|
|
131
|
-
backend?: ConfigMap;
|
|
132
|
-
bot?: ConfigMap;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* project dynamic states
|
|
136
|
-
*/
|
|
137
|
-
export interface ProjectStates {
|
|
138
|
-
solution: Record<string, ConfigValue>;
|
|
139
|
-
resources: {
|
|
140
|
-
[k: string]: Record<string, ConfigValue>;
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
export interface Inputs extends Json {
|
|
144
|
-
projectPath?: string;
|
|
145
|
-
targetEnvName?: string;
|
|
146
|
-
sourceEnvName?: string;
|
|
147
|
-
targetResourceGroupName?: string;
|
|
148
|
-
targetResourceLocationName?: string;
|
|
149
|
-
targetSubscriptionId?: string;
|
|
58
|
+
export interface Inputs extends Record<string, any> {
|
|
150
59
|
platform: Platform;
|
|
151
|
-
stage?: Stage;
|
|
152
|
-
vscodeEnv?: VsCodeEnv;
|
|
153
|
-
ignoreConfigPersist?: boolean;
|
|
154
|
-
ignoreEnvInfo?: boolean;
|
|
155
|
-
env?: string;
|
|
156
|
-
projectId?: string;
|
|
157
|
-
existingResources?: string[];
|
|
158
|
-
locale?: string;
|
|
159
|
-
isM365?: boolean;
|
|
160
|
-
inProductDoc?: boolean;
|
|
161
|
-
teamsAppFromTdp?: any;
|
|
162
|
-
}
|
|
163
|
-
export interface ProjectConfig {
|
|
164
|
-
settings?: ProjectSettings;
|
|
165
|
-
config?: Json;
|
|
166
|
-
}
|
|
167
|
-
export interface ProjectConfigV3 {
|
|
168
|
-
projectSettings: ProjectSettings;
|
|
169
|
-
envInfos: {
|
|
170
|
-
[key: string]: EnvInfoV3;
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
export interface Component extends Json {
|
|
174
|
-
name: string;
|
|
175
|
-
hosting?: string;
|
|
176
|
-
code?: string;
|
|
177
|
-
deployType?: "folder" | "zip";
|
|
178
|
-
language?: string;
|
|
179
|
-
folder?: string;
|
|
180
|
-
artifactFolder?: string;
|
|
181
|
-
build?: boolean;
|
|
182
|
-
provision?: boolean;
|
|
183
|
-
deploy?: boolean;
|
|
184
|
-
connections?: string[];
|
|
185
|
-
sso?: boolean;
|
|
186
|
-
}
|
|
187
|
-
export interface ProjectSettingsV3 extends ProjectSettings {
|
|
188
|
-
components: Component[];
|
|
189
|
-
}
|
|
190
|
-
export interface ContextV3 extends Context {
|
|
191
|
-
manifestProvider: AppManifestProvider;
|
|
192
|
-
projectSetting: ProjectSettingsV3;
|
|
193
|
-
envInfo?: EnvInfoV3;
|
|
194
|
-
tokenProvider?: TokenProvider;
|
|
195
60
|
projectPath?: string;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
export interface ResourceContextV3 extends ContextV3 {
|
|
201
|
-
envInfo: EnvInfoV3;
|
|
202
|
-
tokenProvider: TokenProvider;
|
|
61
|
+
projectId?: string;
|
|
62
|
+
nonInteractive?: boolean;
|
|
63
|
+
correlationId?: string;
|
|
203
64
|
}
|
|
204
|
-
export
|
|
65
|
+
export type InputsWithProjectPath = Inputs & {
|
|
66
|
+
projectPath: string;
|
|
67
|
+
};
|
|
68
|
+
export type DeepReadonly<T> = {
|
|
69
|
+
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
70
|
+
};
|
|
71
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
205
72
|
/**
|
|
206
73
|
* simplified tooling settings for v3
|
|
207
74
|
*/
|
|
@@ -209,4 +76,62 @@ export interface Settings {
|
|
|
209
76
|
version: string;
|
|
210
77
|
trackingId: string;
|
|
211
78
|
}
|
|
79
|
+
export type ManifestCapability = {
|
|
80
|
+
name: "staticTab";
|
|
81
|
+
snippet?: IStaticTab;
|
|
82
|
+
existingApp?: boolean;
|
|
83
|
+
} | {
|
|
84
|
+
name: "configurableTab";
|
|
85
|
+
snippet?: IConfigurableTab;
|
|
86
|
+
existingApp?: boolean;
|
|
87
|
+
} | {
|
|
88
|
+
name: "Bot";
|
|
89
|
+
snippet?: IBot;
|
|
90
|
+
existingApp?: boolean;
|
|
91
|
+
} | {
|
|
92
|
+
name: "MessageExtension";
|
|
93
|
+
snippet?: IComposeExtension;
|
|
94
|
+
existingApp?: boolean;
|
|
95
|
+
} | {
|
|
96
|
+
name: "WebApplicationInfo";
|
|
97
|
+
snippet?: IWebApplicationInfo;
|
|
98
|
+
existingApp?: boolean;
|
|
99
|
+
};
|
|
100
|
+
export declare enum OpenAIManifestAuthType {
|
|
101
|
+
None = "none",
|
|
102
|
+
UserHttp = "user_http",
|
|
103
|
+
ServiceHttp = "service_http",
|
|
104
|
+
OAuth = "oauth"
|
|
105
|
+
}
|
|
106
|
+
export interface OpenAIPluginManifest {
|
|
107
|
+
schema_version: string;
|
|
108
|
+
name_for_human: string;
|
|
109
|
+
name_for_model: string;
|
|
110
|
+
description_for_human: string;
|
|
111
|
+
description_for_model: string;
|
|
112
|
+
auth: {
|
|
113
|
+
type: OpenAIManifestAuthType;
|
|
114
|
+
};
|
|
115
|
+
api: {
|
|
116
|
+
type: string;
|
|
117
|
+
url: string;
|
|
118
|
+
};
|
|
119
|
+
logo_url: string;
|
|
120
|
+
contact_email: string;
|
|
121
|
+
legal_info_url: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ApiOperation {
|
|
124
|
+
id: string;
|
|
125
|
+
label: string;
|
|
126
|
+
groupName: string;
|
|
127
|
+
}
|
|
128
|
+
export interface Warning {
|
|
129
|
+
type: string;
|
|
130
|
+
content: string;
|
|
131
|
+
data?: any;
|
|
132
|
+
}
|
|
133
|
+
export interface CreateProjectResult {
|
|
134
|
+
projectPath: string;
|
|
135
|
+
warnings?: Warning[];
|
|
136
|
+
}
|
|
212
137
|
//# sourceMappingURL=types.d.ts.map
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":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AAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,IAAI,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CAAC;IACvC,GAAG,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB"}
|
package/build/types.js
CHANGED
|
@@ -2,92 +2,13 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
class ConfigMap extends Map {
|
|
7
|
-
getString(k, defaultValue) {
|
|
8
|
-
const v = super.get(k);
|
|
9
|
-
if (!v)
|
|
10
|
-
return defaultValue;
|
|
11
|
-
return String(v);
|
|
12
|
-
}
|
|
13
|
-
getBoolean(k, defaultValue) {
|
|
14
|
-
const v = super.get(k);
|
|
15
|
-
if (!v)
|
|
16
|
-
return defaultValue;
|
|
17
|
-
return Boolean(v);
|
|
18
|
-
}
|
|
19
|
-
getNumber(k, defaultValue) {
|
|
20
|
-
const v = super.get(k);
|
|
21
|
-
if (!v)
|
|
22
|
-
return defaultValue;
|
|
23
|
-
return Number(v);
|
|
24
|
-
}
|
|
25
|
-
getStringArray(k, defaultValue) {
|
|
26
|
-
const v = super.get(k);
|
|
27
|
-
if (!v)
|
|
28
|
-
return defaultValue;
|
|
29
|
-
return v;
|
|
30
|
-
}
|
|
31
|
-
getNumberArray(k, defaultValue) {
|
|
32
|
-
const v = super.get(k);
|
|
33
|
-
if (!v)
|
|
34
|
-
return defaultValue;
|
|
35
|
-
return v;
|
|
36
|
-
}
|
|
37
|
-
getBooleanArray(k, defaultValue) {
|
|
38
|
-
const v = super.get(k);
|
|
39
|
-
if (!v)
|
|
40
|
-
return defaultValue;
|
|
41
|
-
return v;
|
|
42
|
-
}
|
|
43
|
-
getOptionItem(k, defaultValue) {
|
|
44
|
-
const v = super.get(k);
|
|
45
|
-
if (!v)
|
|
46
|
-
return defaultValue;
|
|
47
|
-
if (v instanceof ConfigMap) {
|
|
48
|
-
return v.toJSON();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
return v;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
getOptionItemArray(k, defaultValue) {
|
|
55
|
-
const v = super.get(k);
|
|
56
|
-
if (!v)
|
|
57
|
-
return defaultValue;
|
|
58
|
-
return v;
|
|
59
|
-
}
|
|
60
|
-
toJSON() {
|
|
61
|
-
const out = {};
|
|
62
|
-
for (const entry of super.entries()) {
|
|
63
|
-
if (entry[1] instanceof ConfigMap) {
|
|
64
|
-
out[entry[0]] = entry[1].toJSON();
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
out[entry[0]] = entry[1];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return out;
|
|
71
|
-
}
|
|
72
|
-
static fromJSON(obj) {
|
|
73
|
-
if (!obj)
|
|
74
|
-
return undefined;
|
|
75
|
-
const map = new ConfigMap();
|
|
76
|
-
for (const entry of Object.entries(obj)) {
|
|
77
|
-
if (typeof entry[1] !== "object") {
|
|
78
|
-
map.set(entry[0], entry[1]);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
map.set(entry[0], this.fromJSON(entry[1]));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return map;
|
|
85
|
-
}
|
|
86
|
-
constructor(entries) {
|
|
87
|
-
super(entries);
|
|
88
|
-
Object.setPrototypeOf(this, ConfigMap.prototype);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.ConfigMap = ConfigMap;
|
|
5
|
+
exports.OpenAIManifestAuthType = exports.Void = void 0;
|
|
92
6
|
exports.Void = {};
|
|
7
|
+
var OpenAIManifestAuthType;
|
|
8
|
+
(function (OpenAIManifestAuthType) {
|
|
9
|
+
OpenAIManifestAuthType["None"] = "none";
|
|
10
|
+
OpenAIManifestAuthType["UserHttp"] = "user_http";
|
|
11
|
+
OpenAIManifestAuthType["ServiceHttp"] = "service_http";
|
|
12
|
+
OpenAIManifestAuthType["OAuth"] = "oauth";
|
|
13
|
+
})(OpenAIManifestAuthType = exports.OpenAIManifestAuthType || (exports.OpenAIManifestAuthType = {}));
|
|
93
14
|
//# sourceMappingURL=types.js.map
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAwDA,QAAA,IAAI,GAAG,EAAE,CAAC;AA8DvB,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,uCAAa,CAAA;IACb,gDAAsB,CAAA;IACtB,sDAA4B,CAAA;IAC5B,yCAAe,CAAA;AACjB,CAAC,EALW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAKjC"}
|
package/build/utils/log.d.ts
CHANGED
|
@@ -1,74 +1,61 @@
|
|
|
1
1
|
export declare enum LogLevel {
|
|
2
|
-
/**
|
|
3
|
-
* Contain the most detailed messages.
|
|
4
|
-
*/
|
|
5
|
-
Trace = 0,
|
|
6
2
|
/**
|
|
7
3
|
* For debugging and development.
|
|
8
4
|
*/
|
|
9
5
|
Debug = 1,
|
|
6
|
+
/**
|
|
7
|
+
* Contain the most detailed messages.
|
|
8
|
+
*/
|
|
9
|
+
Verbose = 2,
|
|
10
10
|
/**
|
|
11
11
|
* Tracks the general flow of the app. May have long-term value.
|
|
12
12
|
*/
|
|
13
|
-
Info =
|
|
13
|
+
Info = 3,
|
|
14
14
|
/**
|
|
15
15
|
* For abnormal or unexpected events. Typically includes errors or conditions that don't cause the app to fail.
|
|
16
16
|
*/
|
|
17
|
-
Warning =
|
|
17
|
+
Warning = 4,
|
|
18
18
|
/**
|
|
19
19
|
* For errors and exceptions that cannot be handled. These messages indicate a failure in the current operation or request, not an app-wide failure.
|
|
20
20
|
*/
|
|
21
|
-
Error =
|
|
22
|
-
/**
|
|
23
|
-
* For failures that require immediate attention. Examples: data loss scenarios.
|
|
24
|
-
*/
|
|
25
|
-
Fatal = 5
|
|
21
|
+
Error = 5
|
|
26
22
|
}
|
|
27
23
|
export interface LogProvider {
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @param logLevel Defines logging severity levels.
|
|
31
|
-
* @param message Information of log event
|
|
25
|
+
* log by level
|
|
32
26
|
*/
|
|
33
|
-
log(logLevel: LogLevel, message: string):
|
|
27
|
+
log(logLevel: LogLevel, message: string): void;
|
|
34
28
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param message Information of log event
|
|
29
|
+
* diagnostic information used by user
|
|
37
30
|
*/
|
|
38
|
-
|
|
31
|
+
verbose(message: string): void;
|
|
39
32
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param message Information of log event
|
|
33
|
+
* debug information used internally
|
|
42
34
|
*/
|
|
43
|
-
debug(message: string):
|
|
35
|
+
debug(message: string): void;
|
|
44
36
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param message Information of log event
|
|
37
|
+
* normal output information
|
|
47
38
|
*/
|
|
48
|
-
info(message: string
|
|
39
|
+
info(message: string): void;
|
|
49
40
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param message Information of log event
|
|
41
|
+
* normal output information, colored version
|
|
52
42
|
*/
|
|
53
43
|
info(message: Array<{
|
|
54
44
|
content: string;
|
|
55
45
|
color: Colors;
|
|
56
|
-
}
|
|
46
|
+
}>): void;
|
|
57
47
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @param message Information of log event
|
|
48
|
+
* warning information
|
|
60
49
|
*/
|
|
61
|
-
warning(message: string
|
|
50
|
+
warning(message: string): void;
|
|
62
51
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @param message Information of log event
|
|
52
|
+
* error information
|
|
65
53
|
*/
|
|
66
|
-
error(message: string
|
|
54
|
+
error(message: string): void;
|
|
67
55
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @param message Information of log event
|
|
56
|
+
* log content into file
|
|
70
57
|
*/
|
|
71
|
-
|
|
58
|
+
logInFile(logLevel: LogLevel, message: string): Promise<void>;
|
|
72
59
|
/**
|
|
73
60
|
* Get log file path
|
|
74
61
|
*/
|
package/build/utils/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAIA,oBAAY,QAAQ;IAClB;;OAEG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAIA,oBAAY,QAAQ;IAClB;;OAEG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,IAAI,IAAI;IACR;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,KAAK,IAAI;CACV;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAA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