inugami-ng 0.0.16 → 0.0.18

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.
@@ -0,0 +1,36 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, inject, signal, computed, Component } from '@angular/core';
3
+ import { CacheServiceTracking } from 'inugami-ng/services';
4
+ import { UuidUtils, InuStringUtils } from 'inugami-ng/utils';
5
+
6
+ class InuFooter {
7
+ //==================================================================================================================
8
+ // ATTRIBUTES
9
+ //==================================================================================================================
10
+ displayVersion = input(true, ...(ngDevMode ? [{ debugName: "displayVersion" }] : []));
11
+ cacheServiceTracking = inject(CacheServiceTracking, { optional: true });
12
+ tracking = signal(this.cacheServiceTracking ?? new CacheServiceTracking({
13
+ sessionUid: signal(UuidUtils.buildUid()),
14
+ env: signal('PRD'),
15
+ application: signal('inugami'),
16
+ version: signal('0.0.0')
17
+ }), ...(ngDevMode ? [{ debugName: "tracking" }] : []));
18
+ styleClass = computed(() => [
19
+ 'inu-footer',
20
+ InuStringUtils.normalize(this.tracking().env()).toUpperCase(),
21
+ InuStringUtils.normalize(this.tracking().application()).toUpperCase(),
22
+ ].join(' '), ...(ngDevMode ? [{ debugName: "styleClass" }] : []));
23
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: InuFooter, deps: [], target: i0.ɵɵFactoryTarget.Component });
24
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: InuFooter, isStandalone: true, selector: "inu-footer", inputs: { displayVersion: { classPropertyName: "displayVersion", publicName: "displayVersion", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<footer [class]=\"styleClass()\">\n <div class=\"inu-footer-border-top\"></div>\n @if(displayVersion()){\n <div class=\"inu-footer-application-detail\">\n <div class=\"inu-footer-application-env\">\n <div>{{tracking().env()}}</div>\n </div>\n <div class=\"inu-footer-application-name\">\n <div>{{tracking().application()}}</div>\n </div>\n <div class=\"inu-footer-application-version\">\n <div>{{tracking().version()}}</div>\n </div>\n </div>\n }\n\n <div class=\"inu-footer-content\">\n <ng-content />\n </div>\n <div class=\"inu-footer-border-bottom\"></div>\n</footer>\n", styles: ["footer{position:fixed;bottom:0;width:100%;background-color:var(--neutral-light);display:flex;flex-direction:column;gap:.25rem;-webkit-box-shadow:0px 0px 20px 0px var(--neutral-light);box-shadow:0 0 20px 0 var(--neutral-light)}footer .inu-footer-border-top{height:.25rem;background-color:var(--neutral)}footer .inu-footer-application-detail{display:flex;flex-direction:row;gap:.5rem;padding:.25rem;align-items:center;justify-content:center;font-weight:700}footer .inu-footer-application-detail .inu-footer-application-env{background-color:var(--neutral-dark-extra);color:var(--neutral-light);padding:.25rem .5rem}footer.PRD .inu-footer-application-detail .inu-footer-application-env{background-color:var(--primary-dark)}\n"] });
25
+ }
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: InuFooter, decorators: [{
27
+ type: Component,
28
+ args: [{ selector: 'inu-footer', standalone: true, imports: [], template: "<footer [class]=\"styleClass()\">\n <div class=\"inu-footer-border-top\"></div>\n @if(displayVersion()){\n <div class=\"inu-footer-application-detail\">\n <div class=\"inu-footer-application-env\">\n <div>{{tracking().env()}}</div>\n </div>\n <div class=\"inu-footer-application-name\">\n <div>{{tracking().application()}}</div>\n </div>\n <div class=\"inu-footer-application-version\">\n <div>{{tracking().version()}}</div>\n </div>\n </div>\n }\n\n <div class=\"inu-footer-content\">\n <ng-content />\n </div>\n <div class=\"inu-footer-border-bottom\"></div>\n</footer>\n", styles: ["footer{position:fixed;bottom:0;width:100%;background-color:var(--neutral-light);display:flex;flex-direction:column;gap:.25rem;-webkit-box-shadow:0px 0px 20px 0px var(--neutral-light);box-shadow:0 0 20px 0 var(--neutral-light)}footer .inu-footer-border-top{height:.25rem;background-color:var(--neutral)}footer .inu-footer-application-detail{display:flex;flex-direction:row;gap:.5rem;padding:.25rem;align-items:center;justify-content:center;font-weight:700}footer .inu-footer-application-detail .inu-footer-application-env{background-color:var(--neutral-dark-extra);color:var(--neutral-light);padding:.25rem .5rem}footer.PRD .inu-footer-application-detail .inu-footer-application-env{background-color:var(--primary-dark)}\n"] }]
29
+ }], propDecorators: { displayVersion: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayVersion", required: false }] }] } });
30
+
31
+ /**
32
+ * Generated bundle index. Do not edit.
33
+ */
34
+
35
+ export { InuFooter };
36
+ //# sourceMappingURL=inugami-ng-components-inu-footer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inugami-ng-components-inu-footer.mjs","sources":["../../../projects/inugami-ng/components/inu-footer/inu-footer.ts","../../../projects/inugami-ng/components/inu-footer/inu-footer.html","../../../projects/inugami-ng/components/inu-footer/inugami-ng-components-inu-footer.ts"],"sourcesContent":["import {Component, computed, inject, input, signal} from '@angular/core';\nimport {CacheServiceTracking} from 'inugami-ng/services'\nimport {InuStringUtils, UuidUtils} from 'inugami-ng/utils'\n\n@Component({\n selector: 'inu-footer',\n standalone: true,\n imports: [],\n templateUrl: './inu-footer.html',\n styleUrl: './inu-footer.scss',\n})\nexport class InuFooter {\n\n //==================================================================================================================\n // ATTRIBUTES\n //==================================================================================================================\n displayVersion = input<boolean>(true);\n private cacheServiceTracking = inject(CacheServiceTracking, {optional: true});\n\n tracking = signal<CacheServiceTracking>(this.cacheServiceTracking ?? new CacheServiceTracking(\n {\n sessionUid : signal<string>(UuidUtils.buildUid()),\n env : signal<string>('PRD'),\n application: signal<string>('inugami'),\n version : signal<string>('0.0.0')\n }\n ));\n\n styleClass = computed<string>(()=> [\n 'inu-footer',\n InuStringUtils.normalize(this.tracking().env()).toUpperCase(),\n InuStringUtils.normalize(this.tracking().application()).toUpperCase(),\n ].join(' '));\n}\n","<footer [class]=\"styleClass()\">\n <div class=\"inu-footer-border-top\"></div>\n @if(displayVersion()){\n <div class=\"inu-footer-application-detail\">\n <div class=\"inu-footer-application-env\">\n <div>{{tracking().env()}}</div>\n </div>\n <div class=\"inu-footer-application-name\">\n <div>{{tracking().application()}}</div>\n </div>\n <div class=\"inu-footer-application-version\">\n <div>{{tracking().version()}}</div>\n </div>\n </div>\n }\n\n <div class=\"inu-footer-content\">\n <ng-content />\n </div>\n <div class=\"inu-footer-border-bottom\"></div>\n</footer>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAWa,SAAS,CAAA;;;;AAKpB,IAAA,cAAc,GAAG,KAAK,CAAU,IAAI,0DAAC;IAC7B,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAE7E,QAAQ,GAAe,MAAM,CAAuB,IAAI,CAAC,oBAAoB,IAAI,IAAI,oBAAoB,CACvG;AACE,QAAA,UAAU,EAAG,MAAM,CAAS,SAAS,CAAC,QAAQ,EAAE,CAAC;AACjD,QAAA,GAAG,EAAU,MAAM,CAAS,KAAK,CAAC;AAClC,QAAA,WAAW,EAAE,MAAM,CAAS,SAAS,CAAC;AACtC,QAAA,OAAO,EAAM,MAAM,CAAS,OAAO;AACpC,KAAA,CACF,oDAAC;AAEF,IAAA,UAAU,GAAG,QAAQ,CAAS,MAAK;QACjC,YAAY;AACZ,QAAA,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW,EAAE;AAC7D,QAAA,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE;AACtE,KAAA,CAAC,IAAI,CAAC,GAAG,CAAC,sDAAC;uGArBD,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,qOCXtB,ioBAqBA,EAAA,MAAA,EAAA,CAAA,mtBAAA,CAAA,EAAA,CAAA;;2FDVa,SAAS,EAAA,UAAA,EAAA,CAAA;kBAPrB,SAAS;+BACE,YAAY,EAAA,UAAA,EACV,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,QAAA,EAAA,ioBAAA,EAAA,MAAA,EAAA,CAAA,mtBAAA,CAAA,EAAA;;;AEPb;;AAEG;;;;"}
@@ -240,7 +240,6 @@ class InuOpenApiServices {
240
240
  contentType = Object.keys(value.content)[0];
241
241
  let schemaData = this.extractSchema(value, contentType);
242
242
  const objectType = this.renderType(schemaData, schemaTypes, objectTypeCache);
243
- console.log('request', objectType);
244
243
  schema = {
245
244
  type: schemaData?.type,
246
245
  ref: objectType?.value,
@@ -314,6 +313,18 @@ class InuOpenApiServices {
314
313
  });
315
314
  }
316
315
  }
316
+ if (examples.length == 0) {
317
+ let renderedType = JSON.stringify(schema.array ? [schema.ref] : schema.ref, null, 2);
318
+ if ('{}' == renderedType) {
319
+ if (type == 'string') {
320
+ renderedType = '""';
321
+ }
322
+ }
323
+ examples.push({
324
+ name: 'nominal',
325
+ value: renderedType
326
+ });
327
+ }
317
328
  }
318
329
  }
319
330
  result.push({
@@ -327,30 +338,6 @@ class InuOpenApiServices {
327
338
  }
328
339
  return result;
329
340
  }
330
- extractObjectTypeValue(value) {
331
- if (Array.isArray(value) && value.length > 0) {
332
- return value[0];
333
- }
334
- return value;
335
- }
336
- unmarshallEndpointResponseHeader(value) {
337
- if (!value) {
338
- return undefined;
339
- }
340
- const result = [];
341
- const keys = Object.keys(value);
342
- keys.sort();
343
- for (let key of keys) {
344
- const item = value[key];
345
- result.push({
346
- name: key,
347
- description: item.description,
348
- externalDocs: item.externalDocs,
349
- style: item.style
350
- });
351
- }
352
- return result;
353
- }
354
341
  unmarshallEndpointResponseExample(value) {
355
342
  const result = [];
356
343
  const keys = Object.keys(value);
@@ -377,6 +364,30 @@ class InuOpenApiServices {
377
364
  }
378
365
  return result;
379
366
  }
367
+ extractObjectTypeValue(value) {
368
+ if (Array.isArray(value) && value.length > 0) {
369
+ return value[0];
370
+ }
371
+ return value;
372
+ }
373
+ unmarshallEndpointResponseHeader(value) {
374
+ if (!value) {
375
+ return undefined;
376
+ }
377
+ const result = [];
378
+ const keys = Object.keys(value);
379
+ keys.sort();
380
+ for (let key of keys) {
381
+ const item = value[key];
382
+ result.push({
383
+ name: key,
384
+ description: item.description,
385
+ externalDocs: item.externalDocs,
386
+ style: item.style
387
+ });
388
+ }
389
+ return result;
390
+ }
380
391
  extractExtension(value) {
381
392
  if (!value) {
382
393
  return undefined;
@@ -437,29 +448,46 @@ class InuOpenApiServices {
437
448
  if (array) {
438
449
  if (schema.items) {
439
450
  type = schema.items['$ref'];
451
+ if (!type && schema.items.type) {
452
+ type = schema.items.type;
453
+ }
440
454
  }
441
455
  }
442
456
  else {
443
457
  type = schema.ref;
444
458
  }
445
459
  let currentType = undefined;
446
- if (schemaTypes?.schemas) {
447
- for (let item of schemaTypes?.schemas) {
448
- if (type == item.id) {
449
- currentType = item;
450
- break;
460
+ let object = {};
461
+ if (type) {
462
+ if (schemaTypes?.schemas) {
463
+ for (let item of schemaTypes?.schemas) {
464
+ if (type == item.id) {
465
+ currentType = item;
466
+ break;
467
+ }
451
468
  }
452
469
  }
453
- }
454
- if (currentType?.name) {
455
- const cachedValue = objectTypeCache.find(v => v.name === currentType.name);
456
- if (cachedValue) {
457
- return cachedValue;
470
+ if (currentType?.name) {
471
+ const cachedValue = objectTypeCache.find(v => v.name === currentType.name);
472
+ if (cachedValue) {
473
+ return cachedValue;
474
+ }
475
+ }
476
+ if (currentType && currentType.properties) {
477
+ object = this.convertObjectPropertiesToObject(currentType.properties, currentType.example ? currentType.example : {}, schemaTypes, objectTypeCache, level ? level + 1 : 0);
458
478
  }
459
479
  }
460
- let object = {};
461
- if (currentType && currentType.properties) {
462
- object = this.convertObjectPropertiesToObject(currentType.properties, currentType.example ? currentType.example : {}, schemaTypes, objectTypeCache, level ? level + 1 : 0);
480
+ else if (schema.properties) {
481
+ object = this.convertObjectPropertiesToObject(Object
482
+ .entries(schema.properties)
483
+ .map(e => {
484
+ const value = e[1];
485
+ return {
486
+ name: e[0],
487
+ format: value?.format,
488
+ type: value?.type
489
+ };
490
+ }), {}, schemaTypes, objectTypeCache, level ? level + 1 : 0);
463
491
  }
464
492
  const result = {
465
493
  array: array,