openapi-explorer 2.1.637 → 2.1.641
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.
@@ -307,7 +307,7 @@ export default function securitySchemeTemplate() {
|
|
307
307
|
}
|
308
308
|
|
309
309
|
const providedApiKeys = schemes.filter(v => v.finalKeyValue);
|
310
|
-
return html` <section id="auth" part="section-auth" class="observe-me ${this.renderStyle === 'focused' ? 'section-gap--focused-mode' : 'section-gap'}"> <slot name="authentication"> <div class="section-padding"> <div class="sub-title regular-font">${getI18nText('headers.authentication')}</div> <div class="small-font-size" style="display:flex;align-items:center;min-height:30px"> ${providedApiKeys.length > 0 ? html` <div class="blue-text"> ${providedApiKeys.length} API key applied </div> <div style="flex:1"></div> <button class="m-btn thin-border" part="btn btn-outline" @click="${() => {
|
310
|
+
return html` <section id="auth" part="section-auth" class="observe-me ${this.renderStyle === 'focused' ? 'section-gap--focused-mode' : 'section-gap'}"> <slot name="authentication"> <div class="section-padding"> <slot name="authentication-header"> <div class="sub-title regular-font">${getI18nText('headers.authentication')}</div> </slot> <div class="small-font-size" style="display:flex;align-items:center;min-height:30px"> ${providedApiKeys.length > 0 ? html` <div class="blue-text"> ${providedApiKeys.length} API key applied </div> <div style="flex:1"></div> <button class="m-btn thin-border" part="btn btn-outline" @click="${() => {
|
311
311
|
onClearAllApiKeys.call(this);
|
312
312
|
}}">CLEAR ALL API KEYS</button>` : html`<div class="red-text">${getI18nText('authentication.no-api-key-applied')}</div>`} </div> ${schemes.length > 0 ? html` <table role="presentation" class="m-table" style="width:100%"> ${schemes.map(v => {
|
313
313
|
var _v$bearerFormat, _v$bearerFormat2;
|
@@ -320,7 +320,7 @@ export default function securitySchemeTemplate() {
|
|
320
320
|
}}"> ${v.finalKeyValue ? 'UPDATE' : 'SET'} </button>`} </form>` : ''} ${v.type && v.type.toLowerCase() === 'http' && v.scheme && v.scheme.toLowerCase() === 'basic' ? html` ${getI18nText('authentication.http-basic-desc')} <form style="display:flex"> <input type="text" value="${v.user}" placeholder="${getI18nText('authentication.username')}" spellcheck="false" class="api-key-user" style="width:100px"> <input class="api-key-password fs-exclude" data-hj-suppress data-sl="mask" type="password" value="${v.password}" placeholder="${getI18nText('authentication.password')}" spellcheck="false" style="width:100px;margin:0 5px"> <button type="submit" class="m-btn thin-border" @click="${e => {
|
321
321
|
onApiKeyChange.call(this, v.apiKeyId, e);
|
322
322
|
}}" part="btn btn-outline"> ${v.finalKeyValue ? 'UPDATE' : getI18nText('authentication.set')} </button> </form>` : ''} </td> </tr> ${v.type.toLowerCase() === 'oauth2' ? html` <tr> <td colspan="2" style="border:none;padding-left:48px"> ${Object.keys(v.flows).map(f => oAuthFlowTemplate.call(this, f, v, v.flows[f]))} </td> </tr> ` : ''} `;
|
323
|
-
})} </table>` : ''} </div> </slot> </section> `;
|
323
|
+
})} </table>` : ''} <slot name="authentication-footer"></slot> </div> </slot> </section> `;
|
324
324
|
}
|
325
325
|
|
326
326
|
function getOauthScopeTemplate(rawScopes) {
|
@@ -110,12 +110,12 @@ export function getTypeInfo(schema, options = {
|
|
110
110
|
});
|
111
111
|
return info;
|
112
112
|
}
|
113
|
-
export function getSampleValueByType(schemaObj, fallbackPropertyName,
|
113
|
+
export function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleIds) {
|
114
114
|
var _Object$values$0$valu, _Object$values$, _schemaObj$type;
|
115
115
|
|
116
116
|
const example = Array.isArray(schemaObj.examples) ? schemaObj.examples[0] : (_Object$values$0$valu = (_Object$values$ = Object.values(schemaObj.examples || {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.value) !== null && _Object$values$0$valu !== void 0 ? _Object$values$0$valu : schemaObj.example;
|
117
117
|
|
118
|
-
if (
|
118
|
+
if (skipExampleIds && typeof example === 'string' && fallbackPropertyName.match(/id$/i)) {
|
119
119
|
return '';
|
120
120
|
}
|
121
121
|
|
@@ -161,7 +161,7 @@ export function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampl
|
|
161
161
|
return null;
|
162
162
|
}
|
163
163
|
|
164
|
-
if (
|
164
|
+
if (skipExampleIds && typeValue.match(/^string/g) && fallbackPropertyName.match(/id$/i)) {
|
165
165
|
return '';
|
166
166
|
}
|
167
167
|
|
@@ -382,7 +382,7 @@ function getSimpleValueResult(schema, config, namespace, prefix, xmlAttributes,
|
|
382
382
|
return config.xml ? [xmlTagProperties] : objectExamples;
|
383
383
|
}
|
384
384
|
|
385
|
-
const value = getSampleValueByType(schema, config.propertyName, config.
|
385
|
+
const value = getSampleValueByType(schema, config.propertyName, config.skipExampleIds);
|
386
386
|
return [value];
|
387
387
|
}
|
388
388
|
|
@@ -659,7 +659,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
659
659
|
}
|
660
660
|
/* Create Example object */
|
661
661
|
|
662
|
-
export function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType,
|
662
|
+
export function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType, skipExampleIds = false) {
|
663
663
|
const mimeType = rawMimeType || 'application/json';
|
664
664
|
const finalExamples = []; // First check if examples is provided
|
665
665
|
|
@@ -755,7 +755,7 @@ export function generateExample(examples, example, schema, rawMimeType, includeR
|
|
755
755
|
const config = {
|
756
756
|
includeReadOnly,
|
757
757
|
includeWriteOnly,
|
758
|
-
|
758
|
+
skipExampleIds,
|
759
759
|
xml: mimeType.toLowerCase().includes('xml')
|
760
760
|
};
|
761
761
|
const samples = getExampleValuesFromSchema(schema, config);
|
@@ -320,7 +320,7 @@ function securitySchemeTemplate() {
|
|
320
320
|
}
|
321
321
|
|
322
322
|
const providedApiKeys = schemes.filter(v => v.finalKeyValue);
|
323
|
-
return (0, _lit.html)` <section id="auth" part="section-auth" class="observe-me ${this.renderStyle === 'focused' ? 'section-gap--focused-mode' : 'section-gap'}"> <slot name="authentication"> <div class="section-padding"> <div class="sub-title regular-font">${(0, _index.getI18nText)('headers.authentication')}</div> <div class="small-font-size" style="display:flex;align-items:center;min-height:30px"> ${providedApiKeys.length > 0 ? (0, _lit.html)` <div class="blue-text"> ${providedApiKeys.length} API key applied </div> <div style="flex:1"></div> <button class="m-btn thin-border" part="btn btn-outline" @click="${() => {
|
323
|
+
return (0, _lit.html)` <section id="auth" part="section-auth" class="observe-me ${this.renderStyle === 'focused' ? 'section-gap--focused-mode' : 'section-gap'}"> <slot name="authentication"> <div class="section-padding"> <slot name="authentication-header"> <div class="sub-title regular-font">${(0, _index.getI18nText)('headers.authentication')}</div> </slot> <div class="small-font-size" style="display:flex;align-items:center;min-height:30px"> ${providedApiKeys.length > 0 ? (0, _lit.html)` <div class="blue-text"> ${providedApiKeys.length} API key applied </div> <div style="flex:1"></div> <button class="m-btn thin-border" part="btn btn-outline" @click="${() => {
|
324
324
|
onClearAllApiKeys.call(this);
|
325
325
|
}}">CLEAR ALL API KEYS</button>` : (0, _lit.html)`<div class="red-text">${(0, _index.getI18nText)('authentication.no-api-key-applied')}</div>`} </div> ${schemes.length > 0 ? (0, _lit.html)` <table role="presentation" class="m-table" style="width:100%"> ${schemes.map(v => {
|
326
326
|
var _v$bearerFormat, _v$bearerFormat2;
|
@@ -333,7 +333,7 @@ function securitySchemeTemplate() {
|
|
333
333
|
}}"> ${v.finalKeyValue ? 'UPDATE' : 'SET'} </button>`} </form>` : ''} ${v.type && v.type.toLowerCase() === 'http' && v.scheme && v.scheme.toLowerCase() === 'basic' ? (0, _lit.html)` ${(0, _index.getI18nText)('authentication.http-basic-desc')} <form style="display:flex"> <input type="text" value="${v.user}" placeholder="${(0, _index.getI18nText)('authentication.username')}" spellcheck="false" class="api-key-user" style="width:100px"> <input class="api-key-password fs-exclude" data-hj-suppress data-sl="mask" type="password" value="${v.password}" placeholder="${(0, _index.getI18nText)('authentication.password')}" spellcheck="false" style="width:100px;margin:0 5px"> <button type="submit" class="m-btn thin-border" @click="${e => {
|
334
334
|
onApiKeyChange.call(this, v.apiKeyId, e);
|
335
335
|
}}" part="btn btn-outline"> ${v.finalKeyValue ? 'UPDATE' : (0, _index.getI18nText)('authentication.set')} </button> </form>` : ''} </td> </tr> ${v.type.toLowerCase() === 'oauth2' ? (0, _lit.html)` <tr> <td colspan="2" style="border:none;padding-left:48px"> ${Object.keys(v.flows).map(f => oAuthFlowTemplate.call(this, f, v, v.flows[f]))} </td> </tr> ` : ''} `;
|
336
|
-
})} </table>` : ''} </div> </slot> </section> `;
|
336
|
+
})} </table>` : ''} <slot name="authentication-footer"></slot> </div> </slot> </section> `;
|
337
337
|
}
|
338
338
|
|
339
339
|
function getOauthScopeTemplate(rawScopes) {
|
@@ -127,12 +127,12 @@ function getTypeInfo(schema, options = {
|
|
127
127
|
return info;
|
128
128
|
}
|
129
129
|
|
130
|
-
function getSampleValueByType(schemaObj, fallbackPropertyName,
|
130
|
+
function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleIds) {
|
131
131
|
var _Object$values$0$valu, _Object$values$, _schemaObj$type;
|
132
132
|
|
133
133
|
const example = Array.isArray(schemaObj.examples) ? schemaObj.examples[0] : (_Object$values$0$valu = (_Object$values$ = Object.values(schemaObj.examples || {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.value) !== null && _Object$values$0$valu !== void 0 ? _Object$values$0$valu : schemaObj.example;
|
134
134
|
|
135
|
-
if (
|
135
|
+
if (skipExampleIds && typeof example === 'string' && fallbackPropertyName.match(/id$/i)) {
|
136
136
|
return '';
|
137
137
|
}
|
138
138
|
|
@@ -178,7 +178,7 @@ function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleString
|
|
178
178
|
return null;
|
179
179
|
}
|
180
180
|
|
181
|
-
if (
|
181
|
+
if (skipExampleIds && typeValue.match(/^string/g) && fallbackPropertyName.match(/id$/i)) {
|
182
182
|
return '';
|
183
183
|
}
|
184
184
|
|
@@ -400,7 +400,7 @@ function getSimpleValueResult(schema, config, namespace, prefix, xmlAttributes,
|
|
400
400
|
return config.xml ? [xmlTagProperties] : objectExamples;
|
401
401
|
}
|
402
402
|
|
403
|
-
const value = getSampleValueByType(schema, config.propertyName, config.
|
403
|
+
const value = getSampleValueByType(schema, config.propertyName, config.skipExampleIds);
|
404
404
|
return [value];
|
405
405
|
}
|
406
406
|
|
@@ -679,7 +679,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
679
679
|
/* Create Example object */
|
680
680
|
|
681
681
|
|
682
|
-
function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType,
|
682
|
+
function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType, skipExampleIds = false) {
|
683
683
|
const mimeType = rawMimeType || 'application/json';
|
684
684
|
const finalExamples = []; // First check if examples is provided
|
685
685
|
|
@@ -775,7 +775,7 @@ function generateExample(examples, example, schema, rawMimeType, includeReadOnly
|
|
775
775
|
const config = {
|
776
776
|
includeReadOnly,
|
777
777
|
includeWriteOnly,
|
778
|
-
|
778
|
+
skipExampleIds,
|
779
779
|
xml: mimeType.toLowerCase().includes('xml')
|
780
780
|
};
|
781
781
|
const samples = getExampleValuesFromSchema(schema, config);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "openapi-explorer",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.641",
|
4
4
|
"description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
|
5
5
|
"author": "Authress Developers <developers@authress.io>",
|
6
6
|
"type": "module",
|