@tiny-mce-umbraco/backoffice 17.5.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cms/api/client/client.gen.d.ts.map +1 -1
- package/dist-cms/api/client/client.gen.js +114 -102
- package/dist-cms/api/client/index.d.ts +1 -1
- package/dist-cms/api/client/index.d.ts.map +1 -1
- package/dist-cms/api/client/types.gen.d.ts +9 -13
- package/dist-cms/api/client/types.gen.d.ts.map +1 -1
- package/dist-cms/api/client/utils.gen.d.ts +8 -4
- package/dist-cms/api/client/utils.gen.d.ts.map +1 -1
- package/dist-cms/api/client/utils.gen.js +13 -15
- package/dist-cms/api/client.gen.d.ts.map +1 -1
- package/dist-cms/api/client.gen.js +1 -3
- package/dist-cms/api/core/auth.gen.d.ts.map +1 -1
- package/dist-cms/api/core/bodySerializer.gen.d.ts +16 -8
- package/dist-cms/api/core/bodySerializer.gen.d.ts.map +1 -1
- package/dist-cms/api/core/bodySerializer.gen.js +1 -1
- package/dist-cms/api/core/params.gen.d.ts +10 -0
- package/dist-cms/api/core/params.gen.d.ts.map +1 -1
- package/dist-cms/api/core/params.gen.js +22 -10
- package/dist-cms/api/core/pathSerializer.gen.d.ts.map +1 -1
- package/dist-cms/api/core/pathSerializer.gen.js +3 -11
- package/dist-cms/api/core/queryKeySerializer.gen.d.ts.map +1 -1
- package/dist-cms/api/core/queryKeySerializer.gen.js +4 -11
- package/dist-cms/api/core/serverSentEvents.gen.d.ts +1 -1
- package/dist-cms/api/core/serverSentEvents.gen.d.ts.map +1 -1
- package/dist-cms/api/core/serverSentEvents.gen.js +6 -9
- package/dist-cms/api/core/types.gen.d.ts +1 -1
- package/dist-cms/api/core/types.gen.d.ts.map +1 -1
- package/dist-cms/api/core/utils.gen.d.ts.map +1 -1
- package/dist-cms/api/core/utils.gen.js +1 -1
- package/dist-cms/api/index.d.ts +2 -2
- package/dist-cms/api/index.d.ts.map +1 -1
- package/dist-cms/api/index.js +1 -2
- package/dist-cms/api/sdk.gen.d.ts +1 -1
- package/dist-cms/api/sdk.gen.d.ts.map +1 -1
- package/dist-cms/api/sdk.gen.js +1 -6
- package/dist-cms/api/types.gen.d.ts +13 -18
- package/dist-cms/api/types.gen.d.ts.map +1 -1
- package/dist-cms/api/types.gen.js +1 -6
- package/dist-cms/components/input-tiny-mce/input-tiny-mce.element.d.ts +1 -1
- package/dist-cms/components/stylesheet-rule-input/stylesheet-rule-input.element.d.ts +1 -1
- package/dist-cms/plugins/core/ai-request-factory.js +2 -2
- package/package.json +10 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../../src/api/client/client.gen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../../src/api/client/client.gen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA0C,MAAM,aAAa,CAAC;AAgB1F,eAAO,MAAM,YAAY,GAAI,SAAQ,MAAW,KAAG,MA+PlD,CAAC"}
|
|
@@ -19,10 +19,7 @@ export const createClient = (config = {}) => {
|
|
|
19
19
|
serializedBody: undefined,
|
|
20
20
|
};
|
|
21
21
|
if (opts.security) {
|
|
22
|
-
await setAuthParams(
|
|
23
|
-
...opts,
|
|
24
|
-
security: opts.security,
|
|
25
|
-
});
|
|
22
|
+
await setAuthParams(opts);
|
|
26
23
|
}
|
|
27
24
|
if (opts.requestValidator) {
|
|
28
25
|
await opts.requestValidator(opts);
|
|
@@ -34,125 +31,139 @@ export const createClient = (config = {}) => {
|
|
|
34
31
|
if (opts.body === undefined || opts.serializedBody === '') {
|
|
35
32
|
opts.headers.delete('Content-Type');
|
|
36
33
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
34
|
+
const resolvedOpts = opts;
|
|
35
|
+
const url = buildUrl(resolvedOpts);
|
|
36
|
+
return { opts: resolvedOpts, url };
|
|
39
37
|
};
|
|
40
38
|
const request = async (options) => {
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
40
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
41
|
+
let request;
|
|
42
|
+
let response;
|
|
43
|
+
try {
|
|
44
|
+
const { opts, url } = await beforeRequest(options);
|
|
45
|
+
const requestInit = {
|
|
46
|
+
redirect: 'follow',
|
|
47
|
+
...opts,
|
|
48
|
+
body: getValidRequestBody(opts),
|
|
49
|
+
};
|
|
50
|
+
request = new Request(url, requestInit);
|
|
51
|
+
for (const fn of interceptors.request.fns) {
|
|
52
|
+
if (fn) {
|
|
53
|
+
request = await fn(request, opts);
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
// fetch must be assigned here, otherwise it would throw the error:
|
|
57
|
+
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
58
|
+
const _fetch = opts.fetch;
|
|
59
|
+
response = await _fetch(request);
|
|
60
|
+
for (const fn of interceptors.response.fns) {
|
|
61
|
+
if (fn) {
|
|
62
|
+
response = await fn(response, request, opts);
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
const result = {
|
|
66
|
+
request,
|
|
67
|
+
response,
|
|
68
|
+
};
|
|
69
|
+
if (response.ok) {
|
|
70
|
+
const parseAs = (opts.parseAs === 'auto'
|
|
71
|
+
? getParseAs(response.headers.get('Content-Type'))
|
|
72
|
+
: opts.parseAs) ?? 'json';
|
|
73
|
+
if (response.status === 204 || response.headers.get('Content-Length') === '0') {
|
|
74
|
+
let emptyData;
|
|
75
|
+
switch (parseAs) {
|
|
76
|
+
case 'arrayBuffer':
|
|
77
|
+
case 'blob':
|
|
78
|
+
case 'text':
|
|
79
|
+
emptyData = await response[parseAs]();
|
|
80
|
+
break;
|
|
81
|
+
case 'formData':
|
|
82
|
+
emptyData = new FormData();
|
|
83
|
+
break;
|
|
84
|
+
case 'stream':
|
|
85
|
+
emptyData = response.body;
|
|
86
|
+
break;
|
|
87
|
+
case 'json':
|
|
88
|
+
default:
|
|
89
|
+
emptyData = {};
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return opts.responseStyle === 'data'
|
|
93
|
+
? emptyData
|
|
94
|
+
: {
|
|
95
|
+
data: emptyData,
|
|
96
|
+
...result,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
let data;
|
|
74
100
|
switch (parseAs) {
|
|
75
101
|
case 'arrayBuffer':
|
|
76
102
|
case 'blob':
|
|
103
|
+
case 'formData':
|
|
77
104
|
case 'text':
|
|
78
|
-
|
|
105
|
+
data = await response[parseAs]();
|
|
79
106
|
break;
|
|
80
|
-
case '
|
|
81
|
-
|
|
107
|
+
case 'json': {
|
|
108
|
+
// Some servers return 200 with no Content-Length and empty body.
|
|
109
|
+
// response.json() would throw; read as text and parse if non-empty.
|
|
110
|
+
const text = await response.text();
|
|
111
|
+
data = text ? JSON.parse(text) : {};
|
|
82
112
|
break;
|
|
113
|
+
}
|
|
83
114
|
case 'stream':
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
115
|
+
return opts.responseStyle === 'data'
|
|
116
|
+
? response.body
|
|
117
|
+
: {
|
|
118
|
+
data: response.body,
|
|
119
|
+
...result,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (parseAs === 'json') {
|
|
123
|
+
if (opts.responseValidator) {
|
|
124
|
+
await opts.responseValidator(data);
|
|
125
|
+
}
|
|
126
|
+
if (opts.responseTransformer) {
|
|
127
|
+
data = await opts.responseTransformer(data);
|
|
128
|
+
}
|
|
90
129
|
}
|
|
91
130
|
return opts.responseStyle === 'data'
|
|
92
|
-
?
|
|
131
|
+
? data
|
|
93
132
|
: {
|
|
94
|
-
data
|
|
133
|
+
data,
|
|
95
134
|
...result,
|
|
96
135
|
};
|
|
97
136
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
case 'formData':
|
|
103
|
-
case 'json':
|
|
104
|
-
case 'text':
|
|
105
|
-
data = await response[parseAs]();
|
|
106
|
-
break;
|
|
107
|
-
case 'stream':
|
|
108
|
-
return opts.responseStyle === 'data'
|
|
109
|
-
? response.body
|
|
110
|
-
: {
|
|
111
|
-
data: response.body,
|
|
112
|
-
...result,
|
|
113
|
-
};
|
|
137
|
+
const textError = await response.text();
|
|
138
|
+
let jsonError;
|
|
139
|
+
try {
|
|
140
|
+
jsonError = JSON.parse(textError);
|
|
114
141
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
catch {
|
|
143
|
+
// noop
|
|
144
|
+
}
|
|
145
|
+
throw jsonError ?? textError;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
let finalError = error;
|
|
149
|
+
for (const fn of interceptors.error.fns) {
|
|
150
|
+
if (fn) {
|
|
151
|
+
finalError = await fn(finalError, response, request, options);
|
|
121
152
|
}
|
|
122
153
|
}
|
|
123
|
-
|
|
124
|
-
|
|
154
|
+
finalError = finalError || {};
|
|
155
|
+
if (throwOnError) {
|
|
156
|
+
throw finalError;
|
|
157
|
+
}
|
|
158
|
+
// TODO: we probably want to return error and improve types
|
|
159
|
+
return responseStyle === 'data'
|
|
160
|
+
? undefined
|
|
125
161
|
: {
|
|
126
|
-
|
|
127
|
-
|
|
162
|
+
error: finalError,
|
|
163
|
+
request,
|
|
164
|
+
response,
|
|
128
165
|
};
|
|
129
166
|
}
|
|
130
|
-
const textError = await response.text();
|
|
131
|
-
let jsonError;
|
|
132
|
-
try {
|
|
133
|
-
jsonError = JSON.parse(textError);
|
|
134
|
-
}
|
|
135
|
-
catch {
|
|
136
|
-
// noop
|
|
137
|
-
}
|
|
138
|
-
const error = jsonError ?? textError;
|
|
139
|
-
let finalError = error;
|
|
140
|
-
for (const fn of interceptors.error.fns) {
|
|
141
|
-
if (fn) {
|
|
142
|
-
finalError = (await fn(error, response, request, opts));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
finalError = finalError || {};
|
|
146
|
-
if (opts.throwOnError) {
|
|
147
|
-
throw finalError;
|
|
148
|
-
}
|
|
149
|
-
// TODO: we probably want to return error and improve types
|
|
150
|
-
return opts.responseStyle === 'data'
|
|
151
|
-
? undefined
|
|
152
|
-
: {
|
|
153
|
-
error: finalError,
|
|
154
|
-
...result,
|
|
155
|
-
};
|
|
156
167
|
};
|
|
157
168
|
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
158
169
|
const makeSseFn = (method) => async (options) => {
|
|
@@ -160,7 +171,6 @@ export const createClient = (config = {}) => {
|
|
|
160
171
|
return createSseClient({
|
|
161
172
|
...opts,
|
|
162
173
|
body: opts.body,
|
|
163
|
-
headers: opts.headers,
|
|
164
174
|
method,
|
|
165
175
|
onRequest: async (url, init) => {
|
|
166
176
|
let request = new Request(url, init);
|
|
@@ -171,11 +181,13 @@ export const createClient = (config = {}) => {
|
|
|
171
181
|
}
|
|
172
182
|
return request;
|
|
173
183
|
},
|
|
184
|
+
serializedBody: getValidRequestBody(opts),
|
|
174
185
|
url,
|
|
175
186
|
});
|
|
176
187
|
};
|
|
188
|
+
const _buildUrl = (options) => buildUrl({ ..._config, ...options });
|
|
177
189
|
return {
|
|
178
|
-
buildUrl,
|
|
190
|
+
buildUrl: _buildUrl,
|
|
179
191
|
connect: makeMethodFn('CONNECT'),
|
|
180
192
|
delete: makeMethodFn('DELETE'),
|
|
181
193
|
get: makeMethodFn('GET'),
|
|
@@ -4,6 +4,6 @@ export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializ
|
|
|
4
4
|
export { buildClientParams } from '../core/params.gen';
|
|
5
5
|
export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen';
|
|
6
6
|
export { createClient } from './client.gen';
|
|
7
|
-
export type { Client, ClientOptions, Config, CreateClientConfig, Options,
|
|
7
|
+
export type { Client, ClientOptions, Config, CreateClientConfig, Options, RequestOptions, RequestResult, ResolvedRequestOptions, ResponseStyle, TDataShape, } from './types.gen';
|
|
8
8
|
export { createConfig, mergeHeaders } from './utils.gen';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/client/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,MAAM,EACN,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/client/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,MAAM,EACN,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -47,7 +47,7 @@ export interface Config<T extends ClientOptions = ClientOptions> extends Omit<Re
|
|
|
47
47
|
export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
48
48
|
responseStyle: TResponseStyle;
|
|
49
49
|
throwOnError: ThrowOnError;
|
|
50
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
50
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
51
51
|
/**
|
|
52
52
|
* Any body that you want to add to your request.
|
|
53
53
|
*
|
|
@@ -63,6 +63,7 @@ export interface RequestOptions<TData = unknown, TResponseStyle extends Response
|
|
|
63
63
|
url: Url;
|
|
64
64
|
}
|
|
65
65
|
export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
66
|
+
headers: Headers;
|
|
66
67
|
serializedBody?: string;
|
|
67
68
|
}
|
|
68
69
|
export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
@@ -76,8 +77,10 @@ export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extend
|
|
|
76
77
|
data: undefined;
|
|
77
78
|
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
78
79
|
}) & {
|
|
79
|
-
request
|
|
80
|
-
|
|
80
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
81
|
+
request?: Request;
|
|
82
|
+
/** response may be undefined, because error may be from building the request object itself or from a network error */
|
|
83
|
+
response?: Response;
|
|
81
84
|
}>;
|
|
82
85
|
export interface ClientOptions {
|
|
83
86
|
baseUrl?: string;
|
|
@@ -85,14 +88,14 @@ export interface ClientOptions {
|
|
|
85
88
|
throwOnError?: boolean;
|
|
86
89
|
}
|
|
87
90
|
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
88
|
-
type SseFn = <TData = unknown,
|
|
91
|
+
type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
|
|
89
92
|
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
90
93
|
type BuildUrlFn = <TData extends {
|
|
91
94
|
body?: unknown;
|
|
92
95
|
path?: Record<string, unknown>;
|
|
93
96
|
query?: Record<string, unknown>;
|
|
94
97
|
url: string;
|
|
95
|
-
}>(options:
|
|
98
|
+
}>(options: TData & Options<TData>) => string;
|
|
96
99
|
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
97
100
|
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
98
101
|
};
|
|
@@ -113,13 +116,6 @@ export interface TDataShape {
|
|
|
113
116
|
url: string;
|
|
114
117
|
}
|
|
115
118
|
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
116
|
-
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & Omit<TData, 'url'
|
|
117
|
-
export type OptionsLegacyParser<TData = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = TData extends {
|
|
118
|
-
body?: any;
|
|
119
|
-
} ? TData extends {
|
|
120
|
-
headers?: any;
|
|
121
|
-
} ? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'body' | 'headers' | 'url'> & TData : OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'body' | 'url'> & TData & Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'headers'> : TData extends {
|
|
122
|
-
headers?: any;
|
|
123
|
-
} ? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'headers' | 'url'> & TData & Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'body'> : OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'url'> & TData;
|
|
119
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
124
120
|
export {};
|
|
125
121
|
//# sourceMappingURL=types.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../../src/api/client/types.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../../src/api/client/types.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,MAAM,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,CAC7D,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,EAAE,UAAU;IACpE;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC;IACb;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,GAAG,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
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { QuerySerializerOptions } from '../core/bodySerializer.gen';
|
|
2
2
|
import type { Client, ClientOptions, Config, RequestOptions } from './types.gen';
|
|
3
|
-
export declare const createQuerySerializer: <T = unknown>({
|
|
3
|
+
export declare const createQuerySerializer: <T = unknown>({ parameters, ...args }?: QuerySerializerOptions) => (queryParams: T) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Infers parseAs value from provided Content-Type header.
|
|
6
6
|
*/
|
|
7
7
|
export declare const getParseAs: (contentType: string | null) => Exclude<Config["parseAs"], "auto">;
|
|
8
|
-
export declare
|
|
8
|
+
export declare function setAuthParams(options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
|
|
9
9
|
headers: Headers;
|
|
10
|
-
})
|
|
10
|
+
}): Promise<void>;
|
|
11
11
|
export declare const buildUrl: Client['buildUrl'];
|
|
12
12
|
export declare const mergeConfigs: (a: Config, b: Config) => Config;
|
|
13
13
|
export declare const mergeHeaders: (...headers: Array<Required<Config>["headers"] | undefined>) => Headers;
|
|
14
|
-
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
14
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
15
|
+
/** response may be undefined due to a network error where no response object is produced */
|
|
16
|
+
response: Res | undefined,
|
|
17
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
18
|
+
request: Req | undefined, options: Options) => Err | Promise<Err>;
|
|
15
19
|
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
16
20
|
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
17
21
|
declare class Interceptors<Interceptor> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.gen.d.ts","sourceRoot":"","sources":["../../../src/api/client/utils.gen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;A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,OAAO,CAAC,CAAC,CAAC;CAC3D;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,OAAK,UAAU,CACtE,GAAG,EACH,GAAG,EACH,GAAG,EACH,OAAO,CAKP,CAAC;AAkBH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,aAAa,GAAG,aAAa,EAClE,WAAU,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAM,KACtD,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAMxC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { getAuthToken } from '../core/auth.gen';
|
|
|
3
3
|
import { jsonBodySerializer } from '../core/bodySerializer.gen';
|
|
4
4
|
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam, } from '../core/pathSerializer.gen';
|
|
5
5
|
import { getUrl } from '../core/utils.gen';
|
|
6
|
-
export const createQuerySerializer = ({
|
|
6
|
+
export const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
7
7
|
const querySerializer = (queryParams) => {
|
|
8
8
|
const search = [];
|
|
9
9
|
if (queryParams && typeof queryParams === 'object') {
|
|
@@ -12,33 +12,34 @@ export const createQuerySerializer = ({ allowReserved, array, object, } = {}) =>
|
|
|
12
12
|
if (value === undefined || value === null) {
|
|
13
13
|
continue;
|
|
14
14
|
}
|
|
15
|
+
const options = parameters[name] || args;
|
|
15
16
|
if (Array.isArray(value)) {
|
|
16
17
|
const serializedArray = serializeArrayParam({
|
|
17
|
-
allowReserved,
|
|
18
|
+
allowReserved: options.allowReserved,
|
|
18
19
|
explode: true,
|
|
19
20
|
name,
|
|
20
21
|
style: 'form',
|
|
21
22
|
value,
|
|
22
|
-
...array,
|
|
23
|
+
...options.array,
|
|
23
24
|
});
|
|
24
25
|
if (serializedArray)
|
|
25
26
|
search.push(serializedArray);
|
|
26
27
|
}
|
|
27
28
|
else if (typeof value === 'object') {
|
|
28
29
|
const serializedObject = serializeObjectParam({
|
|
29
|
-
allowReserved,
|
|
30
|
+
allowReserved: options.allowReserved,
|
|
30
31
|
explode: true,
|
|
31
32
|
name,
|
|
32
33
|
style: 'deepObject',
|
|
33
34
|
value: value,
|
|
34
|
-
...object,
|
|
35
|
+
...options.object,
|
|
35
36
|
});
|
|
36
37
|
if (serializedObject)
|
|
37
38
|
search.push(serializedObject);
|
|
38
39
|
}
|
|
39
40
|
else {
|
|
40
41
|
const serializedPrimitive = serializePrimitiveParam({
|
|
41
|
-
allowReserved,
|
|
42
|
+
allowReserved: options.allowReserved,
|
|
42
43
|
name,
|
|
43
44
|
value: value,
|
|
44
45
|
});
|
|
@@ -64,8 +65,7 @@ export const getParseAs = (contentType) => {
|
|
|
64
65
|
if (!cleanContent) {
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
if (cleanContent.startsWith('application/json') ||
|
|
68
|
-
cleanContent.endsWith('+json')) {
|
|
68
|
+
if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) {
|
|
69
69
|
return 'json';
|
|
70
70
|
}
|
|
71
71
|
if (cleanContent === 'multipart/form-data') {
|
|
@@ -90,8 +90,8 @@ const checkForExistence = (options, name) => {
|
|
|
90
90
|
}
|
|
91
91
|
return false;
|
|
92
92
|
};
|
|
93
|
-
export
|
|
94
|
-
for (const auth of security) {
|
|
93
|
+
export async function setAuthParams(options) {
|
|
94
|
+
for (const auth of options.security ?? []) {
|
|
95
95
|
if (checkForExistence(options, auth.name)) {
|
|
96
96
|
continue;
|
|
97
97
|
}
|
|
@@ -116,7 +116,7 @@ export const setAuthParams = async ({ security, ...options }) => {
|
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
}
|
|
119
|
+
}
|
|
120
120
|
export const buildUrl = (options) => getUrl({
|
|
121
121
|
baseUrl: options.baseUrl,
|
|
122
122
|
path: options.path,
|
|
@@ -147,9 +147,7 @@ export const mergeHeaders = (...headers) => {
|
|
|
147
147
|
if (!header) {
|
|
148
148
|
continue;
|
|
149
149
|
}
|
|
150
|
-
const iterator = header instanceof Headers
|
|
151
|
-
? headersEntries(header)
|
|
152
|
-
: Object.entries(header);
|
|
150
|
+
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
153
151
|
for (const [key, value] of iterator) {
|
|
154
152
|
if (value === null) {
|
|
155
153
|
mergedHeaders.delete(key);
|
|
@@ -160,7 +158,7 @@ export const mergeHeaders = (...headers) => {
|
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
160
|
else if (value !== undefined) {
|
|
163
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
161
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
164
162
|
// content value in OpenAPI specification is 'application/json'
|
|
165
163
|
mergedHeaders.set(key, typeof value === 'object' ? JSON.stringify(value) : value);
|
|
166
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../src/api/client.gen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAA8B,MAAM,UAAU,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzJ,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../src/api/client.gen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAA8B,MAAM,UAAU,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzJ,eAAO,MAAM,MAAM,2BAAsF,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { createClient, createConfig } from './client';
|
|
3
|
-
export const client = createClient(createConfig({
|
|
4
|
-
baseUrl: 'https://localhost:44308'
|
|
5
|
-
}));
|
|
3
|
+
export const client = createClient(createConfig({ baseUrl: 'https://localhost:44308/' }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/auth.gen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3C,MAAM,WAAW,IAAI;IACnB;;;;OAIG;IACH,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,IAAI,EACV,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,KACrE,OAAO,CAAC,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"auth.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/auth.gen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3C,MAAM,WAAW,IAAI;IACnB;;;;OAIG;IACH,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,IAAI,EACV,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,KACrE,OAAO,CAAC,MAAM,GAAG,SAAS,CAgB5B,CAAC"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen';
|
|
2
2
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
3
|
-
export type BodySerializer = (body:
|
|
4
|
-
|
|
3
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
4
|
+
type QuerySerializerOptionsObject = {
|
|
5
5
|
allowReserved?: boolean;
|
|
6
|
-
array?: SerializerOptions<ArrayStyle
|
|
7
|
-
object?: SerializerOptions<ObjectStyle
|
|
8
|
-
}
|
|
6
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
7
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
8
|
+
};
|
|
9
|
+
export type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
10
|
+
/**
|
|
11
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
12
|
+
* override the global array/object settings for specific parameter names.
|
|
13
|
+
*/
|
|
14
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
15
|
+
};
|
|
9
16
|
export declare const formDataBodySerializer: {
|
|
10
|
-
bodySerializer:
|
|
17
|
+
bodySerializer: (body: unknown) => FormData;
|
|
11
18
|
};
|
|
12
19
|
export declare const jsonBodySerializer: {
|
|
13
|
-
bodySerializer:
|
|
20
|
+
bodySerializer: (body: unknown) => string;
|
|
14
21
|
};
|
|
15
22
|
export declare const urlSearchParamsBodySerializer: {
|
|
16
|
-
bodySerializer:
|
|
23
|
+
bodySerializer: (body: unknown) => string;
|
|
17
24
|
};
|
|
25
|
+
export {};
|
|
18
26
|
//# sourceMappingURL=bodySerializer.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodySerializer.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/bodySerializer.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bodySerializer.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/bodySerializer.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAEzE,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;AAExD,KAAK,4BAA4B,GAAG;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,4BAA4B,GAAG;IAClE;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;CAC3D,CAAC;AAoBF,eAAO,MAAM,sBAAsB;2BACV,OAAO,KAAG,QAAQ;CAgB1C,CAAC;AAEF,eAAO,MAAM,kBAAkB;2BACN,OAAO,KAAG,MAAM;CAExC,CAAC;AAEF,eAAO,MAAM,6BAA6B;2BACjB,OAAO,KAAG,MAAM;CAgBxC,CAAC"}
|
|
@@ -36,7 +36,7 @@ export const formDataBodySerializer = {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
export const jsonBodySerializer = {
|
|
39
|
-
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === 'bigint' ? value.toString() : value),
|
|
39
|
+
bodySerializer: (body) => JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
40
40
|
};
|
|
41
41
|
export const urlSearchParamsBodySerializer = {
|
|
42
42
|
bodySerializer: (body) => {
|
|
@@ -17,6 +17,16 @@ export type Field = {
|
|
|
17
17
|
*/
|
|
18
18
|
key?: string;
|
|
19
19
|
map?: string;
|
|
20
|
+
} | {
|
|
21
|
+
/**
|
|
22
|
+
* Field name. This is the name we want the user to see and use.
|
|
23
|
+
*/
|
|
24
|
+
key: string;
|
|
25
|
+
/**
|
|
26
|
+
* Field mapped name. This is the name we want to use in the request.
|
|
27
|
+
* If `in` is omitted, `map` aliases `key` to the transport layer.
|
|
28
|
+
*/
|
|
29
|
+
map: Slot;
|
|
20
30
|
};
|
|
21
31
|
export interface Fields {
|
|
22
32
|
allowExtra?: Partial<Record<Slot, boolean>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/params.gen.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,KAAK,GACb;IACE,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GACD;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AC;AA+CzD,UAAU,MAAM;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAUD,eAAO,MAAM,iBAAiB,GAAI,MAAM,aAAa,CAAC,OAAO,CAAC,EAAE,QAAQ,YAAY,WAgEnF,CAAC"}
|
|
@@ -19,6 +19,11 @@ const buildKeyMap = (fields, map) => {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
else if ('key' in config) {
|
|
23
|
+
map.set(config.key, {
|
|
24
|
+
map: config.map,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
22
27
|
else if (config.args) {
|
|
23
28
|
buildKeyMap(config.args, map);
|
|
24
29
|
}
|
|
@@ -27,17 +32,17 @@ const buildKeyMap = (fields, map) => {
|
|
|
27
32
|
};
|
|
28
33
|
const stripEmptySlots = (params) => {
|
|
29
34
|
for (const [slot, value] of Object.entries(params)) {
|
|
30
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
35
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
31
36
|
delete params[slot];
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
};
|
|
35
40
|
export const buildClientParams = (args, fields) => {
|
|
36
41
|
const params = {
|
|
37
|
-
body:
|
|
38
|
-
headers:
|
|
39
|
-
path:
|
|
40
|
-
query:
|
|
42
|
+
body: Object.create(null),
|
|
43
|
+
headers: Object.create(null),
|
|
44
|
+
path: Object.create(null),
|
|
45
|
+
query: Object.create(null),
|
|
41
46
|
};
|
|
42
47
|
const map = buildKeyMap(fields);
|
|
43
48
|
let config;
|
|
@@ -52,7 +57,9 @@ export const buildClientParams = (args, fields) => {
|
|
|
52
57
|
if (config.key) {
|
|
53
58
|
const field = map.get(config.key);
|
|
54
59
|
const name = field.map || config.key;
|
|
55
|
-
|
|
60
|
+
if (field.in) {
|
|
61
|
+
params[field.in][name] = arg;
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
else {
|
|
58
65
|
params.body = arg;
|
|
@@ -62,8 +69,13 @@ export const buildClientParams = (args, fields) => {
|
|
|
62
69
|
for (const [key, value] of Object.entries(arg ?? {})) {
|
|
63
70
|
const field = map.get(key);
|
|
64
71
|
if (field) {
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
if (field.in) {
|
|
73
|
+
const name = field.map || key;
|
|
74
|
+
params[field.in][name] = value;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
params[field.map] = value;
|
|
78
|
+
}
|
|
67
79
|
}
|
|
68
80
|
else {
|
|
69
81
|
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
|
@@ -71,8 +83,8 @@ export const buildClientParams = (args, fields) => {
|
|
|
71
83
|
const [prefix, slot] = extra;
|
|
72
84
|
params[slot][key.slice(prefix.length)] = value;
|
|
73
85
|
}
|
|
74
|
-
else {
|
|
75
|
-
for (const [slot, allowed] of Object.entries(config.allowExtra
|
|
86
|
+
else if ('allowExtra' in config && config.allowExtra) {
|
|
87
|
+
for (const [slot, allowed] of Object.entries(config.allowExtra)) {
|
|
76
88
|
if (allowed) {
|
|
77
89
|
params[slot][key] = value;
|
|
78
90
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathSerializer.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/pathSerializer.gen.ts"],"names":[],"mappings":"AAEA,UAAU,gBAAgB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"pathSerializer.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/pathSerializer.gen.ts"],"names":[],"mappings":"AAEA,UAAU,gBAAgB,CAAC,CAAC,CAAE,SAAQ,yBAAyB,EAAE,iBAAiB,CAAC,C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|
|
62
62
|
});
|
|
63
63
|
})
|
|
64
64
|
.join(separator);
|
|
65
|
-
return style === 'label' || style === 'matrix'
|
|
66
|
-
? separator + joinedValues
|
|
67
|
-
: joinedValues;
|
|
65
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
68
66
|
};
|
|
69
67
|
export const serializePrimitiveParam = ({ allowReserved, name, value, }) => {
|
|
70
68
|
if (value === undefined || value === null) {
|
|
@@ -82,11 +80,7 @@ export const serializeObjectParam = ({ allowReserved, explode, name, style, valu
|
|
|
82
80
|
if (style !== 'deepObject' && !explode) {
|
|
83
81
|
let values = [];
|
|
84
82
|
Object.entries(value).forEach(([key, v]) => {
|
|
85
|
-
values = [
|
|
86
|
-
...values,
|
|
87
|
-
key,
|
|
88
|
-
allowReserved ? v : encodeURIComponent(v),
|
|
89
|
-
];
|
|
83
|
+
values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
|
|
90
84
|
});
|
|
91
85
|
const joinedValues = values.join(',');
|
|
92
86
|
switch (style) {
|
|
@@ -108,7 +102,5 @@ export const serializeObjectParam = ({ allowReserved, explode, name, style, valu
|
|
|
108
102
|
value: v,
|
|
109
103
|
}))
|
|
110
104
|
.join(separator);
|
|
111
|
-
return style === 'label' || style === 'matrix'
|
|
112
|
-
? separator + joinedValues
|
|
113
|
-
: joinedValues;
|
|
105
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
114
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryKeySerializer.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/queryKeySerializer.gen.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,EAAE,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"queryKeySerializer.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/queryKeySerializer.gen.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,EAAE,OAAO,OAAO,0BAWhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,SAAS,GAAG,SAUjE,CAAC;AAqCF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,SAAS,GAAG,SAkCnE,CAAC"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
4
4
|
*/
|
|
5
5
|
export const queryKeyJsonReplacer = (_key, value) => {
|
|
6
|
-
if (value === undefined ||
|
|
7
|
-
typeof value === 'function' ||
|
|
8
|
-
typeof value === 'symbol') {
|
|
6
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
9
7
|
return undefined;
|
|
10
8
|
}
|
|
11
9
|
if (typeof value === 'bigint') {
|
|
@@ -69,14 +67,10 @@ export const serializeQueryKeyValue = (value) => {
|
|
|
69
67
|
if (value === null) {
|
|
70
68
|
return null;
|
|
71
69
|
}
|
|
72
|
-
if (typeof value === 'string' ||
|
|
73
|
-
typeof value === 'number' ||
|
|
74
|
-
typeof value === 'boolean') {
|
|
70
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
75
71
|
return value;
|
|
76
72
|
}
|
|
77
|
-
if (value === undefined ||
|
|
78
|
-
typeof value === 'function' ||
|
|
79
|
-
typeof value === 'symbol') {
|
|
73
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
80
74
|
return undefined;
|
|
81
75
|
}
|
|
82
76
|
if (typeof value === 'bigint') {
|
|
@@ -88,8 +82,7 @@ export const serializeQueryKeyValue = (value) => {
|
|
|
88
82
|
if (Array.isArray(value)) {
|
|
89
83
|
return stringifyToJsonValue(value);
|
|
90
84
|
}
|
|
91
|
-
if (typeof URLSearchParams !== 'undefined' &&
|
|
92
|
-
value instanceof URLSearchParams) {
|
|
85
|
+
if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) {
|
|
93
86
|
return serializeSearchParams(value);
|
|
94
87
|
}
|
|
95
88
|
if (isPlainObject(value)) {
|
|
@@ -68,5 +68,5 @@ export interface StreamEvent<TData = unknown> {
|
|
|
68
68
|
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
69
69
|
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
70
70
|
};
|
|
71
|
-
export declare
|
|
71
|
+
export declare function createSseClient<TData = unknown>({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }: ServerSentEventsOptions): ServerSentEventsResult<TData>;
|
|
72
72
|
//# sourceMappingURL=serverSentEvents.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverSentEvents.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/serverSentEvents.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,uBAAuB,CAAC,KAAK,GAAG,OAAO,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"serverSentEvents.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/serverSentEvents.gen.ts"],"names":[],"mappings":"AAEA,OA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AO,IAAI;IACrF,MAAM,EAAE,cAAc,CACpB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,EAClE,OAAO,EACP,KAAK,CACN,CAAC;CACH,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EAC/C,SAAS,EACT,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,GAAG,EACH,GAAG,OAAO,EACX,EAAE,uBAAuB,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAoJzD"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export
|
|
2
|
+
export function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
3
3
|
let lastEventId;
|
|
4
|
-
const sleep = sseSleepFn ??
|
|
5
|
-
((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
4
|
+
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
6
5
|
const createStream = async function* () {
|
|
7
6
|
let retryDelay = sseDefaultRetryDelay ?? 3000;
|
|
8
7
|
let attempt = 0;
|
|
@@ -37,9 +36,7 @@ export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTra
|
|
|
37
36
|
throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
38
37
|
if (!response.body)
|
|
39
38
|
throw new Error('No body in SSE response');
|
|
40
|
-
const reader = response.body
|
|
41
|
-
.pipeThrough(new TextDecoderStream())
|
|
42
|
-
.getReader();
|
|
39
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
43
40
|
let buffer = '';
|
|
44
41
|
const abortHandler = () => {
|
|
45
42
|
try {
|
|
@@ -56,6 +53,7 @@ export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTra
|
|
|
56
53
|
if (done)
|
|
57
54
|
break;
|
|
58
55
|
buffer += value;
|
|
56
|
+
buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings
|
|
59
57
|
const chunks = buffer.split('\n\n');
|
|
60
58
|
buffer = chunks.pop() ?? '';
|
|
61
59
|
for (const chunk of chunks) {
|
|
@@ -120,8 +118,7 @@ export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTra
|
|
|
120
118
|
catch (error) {
|
|
121
119
|
// connection failed or aborted; retry after delay
|
|
122
120
|
onSseError?.(error);
|
|
123
|
-
if (sseMaxRetryAttempts !== undefined &&
|
|
124
|
-
attempt >= sseMaxRetryAttempts) {
|
|
121
|
+
if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
|
|
125
122
|
break; // stop after firing error
|
|
126
123
|
}
|
|
127
124
|
// exponential backoff: double retry each attempt, cap at 30s
|
|
@@ -132,4 +129,4 @@ export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTra
|
|
|
132
129
|
};
|
|
133
130
|
const stream = createStream();
|
|
134
131
|
return { stream };
|
|
135
|
-
}
|
|
132
|
+
}
|
|
@@ -61,7 +61,7 @@ export interface Config {
|
|
|
61
61
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
62
62
|
/**
|
|
63
63
|
* A function transforming response data before it's returned. This is useful
|
|
64
|
-
* for post-processing data, e.g
|
|
64
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
65
65
|
*/
|
|
66
66
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
67
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/types.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,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AAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ5E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,aAAa,QAAgB,CAAC;AAE3C,eAAO,MAAM,qBAAqB,GAAI,qBAAqB,cAAc,
|
|
1
|
+
{"version":3,"file":"utils.gen.d.ts","sourceRoot":"","sources":["../../../src/api/core/utils.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ5E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,aAAa,QAAgB,CAAC;AAE3C,eAAO,MAAM,qBAAqB,GAAI,qBAAqB,cAAc,WAiExE,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,uDAMpB;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;CACb,WAcA,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,WAuBA"}
|
|
@@ -75,7 +75,7 @@ export function getValidRequestBody(options) {
|
|
|
75
75
|
const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
|
|
76
76
|
return hasSerializedBody ? options.serializedBody : null;
|
|
77
77
|
}
|
|
78
|
-
// not all clients implement a serializedBody property (i.e
|
|
78
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
79
79
|
return options.body !== '' ? options.body : null;
|
|
80
80
|
}
|
|
81
81
|
// plain/text body
|
package/dist-cms/api/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { type Options, TinyMceService } from './sdk.gen';
|
|
2
|
+
export type { ClientOptions, GetConfigData, GetConfigError, GetConfigErrors, GetConfigResponse, GetConfigResponses, OpenAiApiConfig, ProblemDetails, RichTextEditorCommand, RichTextEditorCommandModeModel, RichTextEditorSettings, TinyMceConfig, TinyMceConfigResponseModel } from './types.gen';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAEA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC"}
|
package/dist-cms/api/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Client, Options as Options2, TDataShape } from './client';
|
|
2
2
|
import type { GetConfigData, GetConfigErrors, GetConfigResponses } from './types.gen';
|
|
3
|
-
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
3
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
6
6
|
* individual options. This might be also useful if you want to implement a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/api/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtF,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAAE,YAAY,SAAS,OAAO,GAAG,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/api/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtF,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAAE,YAAY,SAAS,OAAO,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,CAAC,GAAG;IACjK;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,qBAAa,cAAc;WACT,SAAS,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC;CAO/G"}
|
package/dist-cms/api/sdk.gen.js
CHANGED
|
@@ -3,12 +3,7 @@ import { client } from './client.gen';
|
|
|
3
3
|
export class TinyMceService {
|
|
4
4
|
static getConfig(options) {
|
|
5
5
|
return (options?.client ?? client).get({
|
|
6
|
-
security: [
|
|
7
|
-
{
|
|
8
|
-
scheme: 'bearer',
|
|
9
|
-
type: 'http'
|
|
10
|
-
}
|
|
11
|
-
],
|
|
6
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
12
7
|
url: '/umbraco/management/api/v1/tiny-mce/config',
|
|
13
8
|
...options
|
|
14
9
|
});
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
export type ClientOptions = {
|
|
2
|
-
baseUrl: 'https://localhost:44308' | (string & {});
|
|
2
|
+
baseUrl: 'https://localhost:44308/' | (string & {});
|
|
3
3
|
};
|
|
4
4
|
export type OpenAiApiConfig = {
|
|
5
5
|
model: string;
|
|
6
6
|
developerMessage: string;
|
|
7
|
-
temperature: number;
|
|
8
|
-
maxCompletionTokens: number;
|
|
7
|
+
temperature: number | string;
|
|
8
|
+
maxCompletionTokens: number | string;
|
|
9
9
|
};
|
|
10
10
|
export type ProblemDetails = {
|
|
11
|
-
type?:
|
|
12
|
-
title?:
|
|
13
|
-
status?: number |
|
|
14
|
-
detail?:
|
|
15
|
-
instance?:
|
|
16
|
-
[key: string]: unknown | string | null | string | null | number | null | string | null | string | null | undefined;
|
|
11
|
+
type?: null | string;
|
|
12
|
+
title?: null | string;
|
|
13
|
+
status?: null | number | string;
|
|
14
|
+
detail?: null | string;
|
|
15
|
+
instance?: null | string;
|
|
17
16
|
};
|
|
18
17
|
export type RichTextEditorCommand = {
|
|
19
18
|
alias: string;
|
|
20
19
|
name: string;
|
|
21
20
|
mode: RichTextEditorCommandModeModel;
|
|
22
21
|
};
|
|
23
|
-
export
|
|
24
|
-
INSERT = "Insert",
|
|
25
|
-
SELECTION = "Selection",
|
|
26
|
-
ALL = "All"
|
|
27
|
-
}
|
|
22
|
+
export type RichTextEditorCommandModeModel = number;
|
|
28
23
|
export type RichTextEditorSettings = {
|
|
29
24
|
commands: Array<RichTextEditorCommand>;
|
|
30
25
|
plugins: Array<string>;
|
|
31
26
|
customConfig: {
|
|
32
|
-
[key: string]:
|
|
27
|
+
[key: string]: unknown;
|
|
33
28
|
};
|
|
34
29
|
validElements: string;
|
|
35
30
|
invalidElements: string;
|
|
36
|
-
cloudApiKey?:
|
|
31
|
+
cloudApiKey?: null | string;
|
|
37
32
|
};
|
|
38
33
|
export type TinyMceConfig = {
|
|
39
34
|
apikey: string;
|
|
@@ -48,8 +43,8 @@ export type TinyMceConfig = {
|
|
|
48
43
|
};
|
|
49
44
|
};
|
|
50
45
|
export type TinyMceConfigResponseModel = {
|
|
51
|
-
richTextEditor?:
|
|
52
|
-
config?:
|
|
46
|
+
richTextEditor?: null | RichTextEditorSettings;
|
|
47
|
+
config?: null | TinyMceConfig;
|
|
53
48
|
};
|
|
54
49
|
export type GetConfigData = {
|
|
55
50
|
body?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../src/api/types.gen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../src/api/types.gen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,0BAA0B,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;CACx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G,sBAAsB,CAAC;IAC/C,MAAM,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,GAAG,EAAE,4CAA4C,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG;IAC7B;;OAEG;IACH,GAAG,EAAE,0BAA0B,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export
|
|
3
|
-
(function (RichTextEditorCommandModeModel) {
|
|
4
|
-
RichTextEditorCommandModeModel["INSERT"] = "Insert";
|
|
5
|
-
RichTextEditorCommandModeModel["SELECTION"] = "Selection";
|
|
6
|
-
RichTextEditorCommandModeModel["ALL"] = "All";
|
|
7
|
-
})(RichTextEditorCommandModeModel || (RichTextEditorCommandModeModel = {}));
|
|
2
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
2
2
|
import type { Editor } from '@tiny-mce-umbraco/backoffice/external/tinymce';
|
|
3
3
|
import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
|
|
4
|
-
declare const UmbInputTinyMceElement_base: (new (...args: any[]) => import("@umbraco-ui/uui
|
|
4
|
+
declare const UmbInputTinyMceElement_base: (new (...args: any[]) => import("@umbraco-ui/uui").UUIFormControlMixinElement<FormDataEntryValue | FormData>) & typeof UmbLitElement;
|
|
5
5
|
export declare class UmbInputTinyMceElement extends UmbInputTinyMceElement_base {
|
|
6
6
|
#private;
|
|
7
7
|
configuration?: UmbPropertyEditorConfigCollection;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UmbStylesheetRule } from '../../types.js';
|
|
2
2
|
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
3
|
-
declare const UmbStylesheetRuleInputElement_base: (new (...args: any[]) => import("@umbraco-ui/uui
|
|
3
|
+
declare const UmbStylesheetRuleInputElement_base: (new (...args: any[]) => import("@umbraco-ui/uui").UUIFormControlMixinElement<FormDataEntryValue | FormData>) & typeof UmbLitElement;
|
|
4
4
|
export declare class UmbStylesheetRuleInputElement extends UmbStylesheetRuleInputElement_base {
|
|
5
5
|
#private;
|
|
6
6
|
rules: UmbStylesheetRule[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { client } from '../../api/client.gen.js';
|
|
2
2
|
import { TinyMceService } from '../../api/index.js';
|
|
3
3
|
export async function createAiRequest() {
|
|
4
|
-
const response = await TinyMceService.getConfig({ client
|
|
4
|
+
const response = await TinyMceService.getConfig({ client });
|
|
5
5
|
const apiKey = response.data?.config?.openAiApikey || '';
|
|
6
6
|
const model = response.data?.config?.openAiApiConfig?.model || 'gpt-5';
|
|
7
7
|
const temp = response.data?.config?.openAiApiConfig?.temperature || 1.0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiny-mce-umbraco/backoffice",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "This Umbraco CMS package enables access to the TinyMCE-based Rich Text Editor (RTE) in version 16 and above. It also supports the use of TinyMCE Premium plugins with a valid subscription. Additional features include streamlined configuration for RTE Data Types in Umbraco and enhanced settings that support direct JSON-based configuration via .NET (appsettings.config).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=24.13",
|
|
18
|
+
"npm": ">=11"
|
|
19
|
+
},
|
|
16
20
|
"type": "module",
|
|
17
21
|
"exports": {
|
|
18
22
|
".": null,
|
|
@@ -29,18 +33,18 @@
|
|
|
29
33
|
"build": "tsc && vite build",
|
|
30
34
|
"build:api": "tsc -p tsconfig.api.json",
|
|
31
35
|
"pack:api": "npm pack",
|
|
32
|
-
"generate-client": "node scripts/generate-openapi.js https://localhost:44308/umbraco/
|
|
36
|
+
"generate-client": "node scripts/generate-openapi.js https://localhost:44308/umbraco/openapi/tiny-mce.json"
|
|
33
37
|
},
|
|
34
38
|
"dependencies": {
|
|
35
39
|
"tinymce": "^6.8.5",
|
|
36
40
|
"tinymce-i18n": "^24.12.30"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"@hey-api/openapi-ts": "^0.
|
|
43
|
+
"@hey-api/openapi-ts": "^0.97.0",
|
|
40
44
|
"@rollup/plugin-json": "^6.1.0",
|
|
41
45
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
42
46
|
"@rollup/plugin-replace": "^6.0.2",
|
|
43
|
-
"@umbraco-cms/backoffice": "^
|
|
47
|
+
"@umbraco-cms/backoffice": "^18.0.0",
|
|
44
48
|
"chalk": "^5.3.0",
|
|
45
49
|
"cross-env": "^10.1.0",
|
|
46
50
|
"eslint": "^10.2.0",
|
|
@@ -49,13 +53,13 @@
|
|
|
49
53
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
50
54
|
"rollup-plugin-import-css": "^3.5.8",
|
|
51
55
|
"tiny-glob": "^0.2.9",
|
|
52
|
-
"typescript": "^
|
|
56
|
+
"typescript": "^6.0.3",
|
|
53
57
|
"vite": "^7.3.2",
|
|
54
58
|
"vite-plugin-static-copy": "^3.1.3",
|
|
55
59
|
"vite-tsconfig-paths": "^5.1.4"
|
|
56
60
|
},
|
|
57
61
|
"peerDependencies": {
|
|
58
|
-
"@umbraco-cms/backoffice": "^
|
|
62
|
+
"@umbraco-cms/backoffice": "^18.0.0",
|
|
59
63
|
"tinymce": "^6.8.5",
|
|
60
64
|
"tinymce-i18n": "^24.12.30"
|
|
61
65
|
}
|