@xxmachina/components 19.0.0-preview.11 → 19.0.0-preview.13
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/fesm2022/xxmachina-components-molecules-weekly-header.mjs +2 -2
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs +2 -2
- package/fesm2022/xxmachina-components-pages-command.mjs +2 -2
- package/fesm2022/xxmachina-components-pages-query.mjs +2 -2
- package/fesm2022/xxmachina-components-routes-commands.mjs +1 -1
- package/fesm2022/xxmachina-components-routes-commands.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-queries.mjs +1 -1
- package/fesm2022/xxmachina-components-routes-queries.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-resources-resource.routes-DzGgwitX.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-resources.mjs +2 -2
- package/fesm2022/xxmachina-components-routes-resources.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-query-config.mjs +5 -5
- package/fesm2022/xxmachina-components-services-query-config.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-query.mjs +3 -0
- package/fesm2022/xxmachina-components-services-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-validators-query.mjs +6 -3
- package/fesm2022/xxmachina-components-validators-query.mjs.map +1 -1
- package/package.json +5 -5
- package/services/query-config/query-config.service.d.ts +1 -6
|
@@ -12,7 +12,7 @@ class WeeklyHeaderMolecule {
|
|
|
12
12
|
<div class="day-container" *ngFor="let day of ['日', '月', '火', '水', '木', '金', '土']">
|
|
13
13
|
<span>{{ day }}</span>
|
|
14
14
|
</div>
|
|
15
|
-
`, isInline: true, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-
|
|
15
|
+
`, isInline: true, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-xS55m9cz: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-xS55m9cz: var(--secondary-color)}:host{display:grid;width:100%;grid-template-columns:repeat(7,1fr);background-color:var(--primary-color-SCOPED-IN-xS55m9cz)}:host .day-container{display:flex;justify-content:center;align-items:center;color:#fff;font-weight:700;width:calc(hvar(--width) / 7)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WeeklyHeaderMolecule, decorators: [{
|
|
18
18
|
type: Component,
|
|
@@ -22,7 +22,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
22
22
|
<div class="day-container" *ngFor="let day of ['日', '月', '火', '水', '木', '金', '土']">
|
|
23
23
|
<span>{{ day }}</span>
|
|
24
24
|
</div>
|
|
25
|
-
`, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-
|
|
25
|
+
`, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-xS55m9cz: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-xS55m9cz: var(--secondary-color)}:host{display:grid;width:100%;grid-template-columns:repeat(7,1fr);background-color:var(--primary-color-SCOPED-IN-xS55m9cz)}:host .day-container{display:flex;justify-content:center;align-items:center;color:#fff;font-weight:700;width:calc(hvar(--width) / 7)}\n"] }]
|
|
26
26
|
}], ctorParameters: () => [] });
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -58,7 +58,7 @@ class CalendarSectionOrganism {
|
|
|
58
58
|
></molecules-daily-cell>
|
|
59
59
|
</ng-container>
|
|
60
60
|
</div>
|
|
61
|
-
`, isInline: true, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-
|
|
61
|
+
`, isInline: true, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-lYNBlrjN: var(--row);--row-num: 0;--row-num-SCOPED-IN-lYNBlrjN: var(--row-num);--border-color: #9E9E9E;--border-color-SCOPED-IN-lYNBlrjN: var(--border-color);--primary-color: #404040;--primary-color-SCOPED-IN-lYNBlrjN: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-lYNBlrjN: var(--secondary-color)}:host{width:100%;height:auto}:host .calendar.header molecules-weekly-header{--height: 32px}:host .calendar.contents{display:grid;width:var(--width);border:1px solid var(--border-color-SCOPED-IN-lYNBlrjN);grid-gap:1px;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(var(--row-num-SCOPED-IN-lYNBlrjN),var(--row-SCOPED-IN-lYNBlrjN));box-sizing:border-box;background-color:var(--border-color-SCOPED-IN-lYNBlrjN)}:host .calendar.contents molecules-daily-cell{--width: calc((var(--width) - 8px) / 7);--height: var(--row-SCOPED-IN-lYNBlrjN);background-color:#fff}:host .calendar.description{display:flex;justify-content:flex-end;width:var(--width);height:32px;padding-right:16px}:host .calendar.description .description.container{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px}:host .calendar.description .description.container .circle{display:flex;width:20px;height:20px;justify-content:center;align-items:center;border-radius:50%;color:#fff;background:#00f}:host .calendar.description .description.container label{padding-left:4px;padding-right:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: DailyCellMolecule, selector: "molecules-daily-cell", inputs: ["date", "schedules", "displayDate", "noSchedulesText", "toolTipText", "marked", "markingColor"] }, { kind: "component", type: WeeklyHeaderMolecule, selector: "molecules-weekly-header" }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i2.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
62
62
|
}
|
|
63
63
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CalendarSectionOrganism, decorators: [{
|
|
64
64
|
type: Component,
|
|
@@ -92,7 +92,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
92
92
|
></molecules-daily-cell>
|
|
93
93
|
</ng-container>
|
|
94
94
|
</div>
|
|
95
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-
|
|
95
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-lYNBlrjN: var(--row);--row-num: 0;--row-num-SCOPED-IN-lYNBlrjN: var(--row-num);--border-color: #9E9E9E;--border-color-SCOPED-IN-lYNBlrjN: var(--border-color);--primary-color: #404040;--primary-color-SCOPED-IN-lYNBlrjN: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-lYNBlrjN: var(--secondary-color)}:host{width:100%;height:auto}:host .calendar.header molecules-weekly-header{--height: 32px}:host .calendar.contents{display:grid;width:var(--width);border:1px solid var(--border-color-SCOPED-IN-lYNBlrjN);grid-gap:1px;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(var(--row-num-SCOPED-IN-lYNBlrjN),var(--row-SCOPED-IN-lYNBlrjN));box-sizing:border-box;background-color:var(--border-color-SCOPED-IN-lYNBlrjN)}:host .calendar.contents molecules-daily-cell{--width: calc((var(--width) - 8px) / 7);--height: var(--row-SCOPED-IN-lYNBlrjN);background-color:#fff}:host .calendar.description{display:flex;justify-content:flex-end;width:var(--width);height:32px;padding-right:16px}:host .calendar.description .description.container{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px}:host .calendar.description .description.container .circle{display:flex;width:20px;height:20px;justify-content:center;align-items:center;border-radius:50%;color:#fff;background:#00f}:host .calendar.description .description.container label{padding-left:4px;padding-right:8px}\n"] }]
|
|
96
96
|
}], propDecorators: { label: [{
|
|
97
97
|
type: Input
|
|
98
98
|
}], displayDays: [{
|
|
@@ -280,7 +280,7 @@ class CommandPage extends NgAtomicComponent {
|
|
|
280
280
|
</frames-tabs>
|
|
281
281
|
</templates-form>
|
|
282
282
|
</frames-router-outlet>
|
|
283
|
-
`, isInline: true, styles: [":host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-command-
|
|
283
|
+
`, isInline: true, styles: [":host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-command-VO0R: var(--page-width-lv1)}:host .template{--first-content-height: 0px;width:var(--page-width-lv1-SCOPED-IN-command-VO0R)}:host .template div[dashboard]{padding:0;box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: RouterOutletFrame, selector: "frames-router-outlet", outputs: ["events"] }, { kind: "component", type: FormTemplate, selector: "templates-form" }, { kind: "component", type: TabsFrame, selector: "frames-tabs", inputs: ["labels"] }, { kind: "component", type: CommandFormGroup, selector: "groups-command-form", inputs: ["apiJsonUrls"] }, { kind: "component", type: QueryFormGroup, selector: "groups-query-form", inputs: ["keyActions"] }] }); }
|
|
284
284
|
}
|
|
285
285
|
__decorate([
|
|
286
286
|
Effect(FormTemplateStore.ActionId.FILE_SELECTED),
|
|
@@ -329,7 +329,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
329
329
|
'formFieldMap',
|
|
330
330
|
]
|
|
331
331
|
},
|
|
332
|
-
], styles: [":host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-command-
|
|
332
|
+
], styles: [":host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-command-VO0R: var(--page-width-lv1)}:host .template{--first-content-height: 0px;width:var(--page-width-lv1-SCOPED-IN-command-VO0R)}:host .template div[dashboard]{padding:0;box-sizing:border-box}\n"] }]
|
|
333
333
|
}], propDecorators: { onFileSelected: [] } });
|
|
334
334
|
|
|
335
335
|
/**
|
|
@@ -403,7 +403,7 @@ class QueryPage extends NgAtomicComponent {
|
|
|
403
403
|
<groups-query-form dashboard (action)="dispatch($event)" />
|
|
404
404
|
</templates-index>
|
|
405
405
|
</frames-router-outlet>
|
|
406
|
-
`, isInline: true, styles: ["@charset \"UTF-8\";:host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-query-
|
|
406
|
+
`, isInline: true, styles: ["@charset \"UTF-8\";:host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-query-SeGs: var(--page-width-lv1)}:host templates-index{--first-content-height: 300px;padding-left:0;box-sizing:border-box;transition:padding-left .3s}:host templates-index div[navDashboard]{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;padding:16px;box-sizing:border-box}:host templates-index div[navDashboard] ng-atomic-form-section-builder{--horizontal-padding: 0}\n"], dependencies: [{ kind: "component", type: IndexTemplate, selector: "templates-index" }, { kind: "component", type: RouterOutletFrame, selector: "frames-router-outlet", outputs: ["events"] }, { kind: "component", type: NgAtomicFormSectionBuilder, selector: "ng-atomic-form-section-builder", inputs: ["form", "formFlatExcludes", "fieldMap"] }, { kind: "component", type: QueryFormGroup, selector: "groups-query-form", inputs: ["keyActions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
407
407
|
}
|
|
408
408
|
__decorate([
|
|
409
409
|
Effect(IndexTemplateStore.ActionId.BACK),
|
|
@@ -473,7 +473,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
473
473
|
'variablesFormFieldMap',
|
|
474
474
|
]
|
|
475
475
|
},
|
|
476
|
-
], styles: ["@charset \"UTF-8\";:host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-query-
|
|
476
|
+
], styles: ["@charset \"UTF-8\";:host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-query-SeGs: var(--page-width-lv1)}:host templates-index{--first-content-height: 300px;padding-left:0;box-sizing:border-box;transition:padding-left .3s}:host templates-index div[navDashboard]{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;padding:16px;box-sizing:border-box}:host templates-index div[navDashboard] ng-atomic-form-section-builder{--horizontal-padding: 0}\n"] }]
|
|
477
477
|
}], ctorParameters: () => [], propDecorators: { back: [], navigateToIframe: [], expandPage: [] } });
|
|
478
478
|
|
|
479
479
|
/**
|
|
@@ -5,7 +5,7 @@ import { provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';
|
|
|
5
5
|
import { provideLangMap } from '@ng-atomic/common/pipes/domain';
|
|
6
6
|
import { IndexPageStore, IndexPage } from '@ng-atomic/components/pages/_index';
|
|
7
7
|
import { provideEffect, applyToInput } from '@ng-atomic/core';
|
|
8
|
-
import { getLangMap } from '@nx-ddd/common/domain
|
|
8
|
+
import { getLangMap } from '@nx-ddd/common/domain';
|
|
9
9
|
import { get } from 'lodash-es';
|
|
10
10
|
|
|
11
11
|
var ActionId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-routes-commands.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/commands/commands.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/commands/xxmachina-components-routes-commands.ts"],"sourcesContent":["import { effect, inject } from '@angular/core';\nimport { Routes } from '@angular/router';\nimport { WebAPiRequestCommand } from '@xxmachina/common/domain/models';\nimport { CommandService } from '@xxmachina/components/services/command';\nimport { provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { provideLangMap } from '@ng-atomic/common/pipes/domain';\nimport { IndexPage, IndexPageStore } from '@ng-atomic/components/pages/_index';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { getLangMap } from '@nx-ddd/common/domain
|
|
1
|
+
{"version":3,"file":"xxmachina-components-routes-commands.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/commands/commands.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/commands/xxmachina-components-routes-commands.ts"],"sourcesContent":["import { effect, inject } from '@angular/core';\nimport { Routes } from '@angular/router';\nimport { WebAPiRequestCommand } from '@xxmachina/common/domain/models';\nimport { CommandService } from '@xxmachina/components/services/command';\nimport { provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { provideLangMap } from '@ng-atomic/common/pipes/domain';\nimport { IndexPage, IndexPageStore } from '@ng-atomic/components/pages/_index';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { getLangMap } from '@nx-ddd/common/domain';\nimport { get } from 'lodash-es';\n\nenum ActionId {\n\tREFRESH = 'refresh',\n}\n\nexport default <Routes>[\n\t{\n\t\tpath: '',\n\t\tcomponent: IndexPage,\n\t\tloadChildren: () => import('./pages/pages.routes'),\n\t\tproviders: [\n\t\t\tprovideLangMap(() => getLangMap(WebAPiRequestCommand, {\n\t\t\t\tno: 'No',\n\t\t\t\tid: 'ID',\n\t\t\t\ttitle: 'コマンド名',\n\t\t\t\tmethod: 'メソッド',\n\t\t\t\tendpoint: 'エンドポイント',\n\t\t\t\tdescription: '説明',\n\t\t\t\tauthorization: '認証',\n\t\t\t\tgroups: '認可(グループ)'\n\t\t\t})),\n\t\t\tprovideDataAccessor(() => (item, key, index) => {\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase 'no': return item['index'] + 1;\n\t\t\t\t\tcase 'title': return get(item, 'name');\n\t\t\t\t\tcase 'description': return get(item, ['description']);\n\t\t\t\t\tcase 'method': return get(item, ['webApiRequest', 'method']);\n\t\t\t\t\tcase 'endpoint': return get(item, ['webApiRequest', 'path']);\n\t\t\t\t\tcase 'authorization': return '◯';\n\t\t\t\t\tcase 'groups': {\n\t\t\t\t\t\tconst securities = get(item, ['webApiRequest', 'security']) as {groups: string[]}[];\n\t\t\t\t\t\tconst groupIds = securities.map((s) => s.groups).flat()\n\t\t\t\t\t\t\t.map(id => id.startsWith('2ac') ? '管理者' : '記入者');\n\t\t\t\t\t\treturn groupIds.join(', ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tIndexPageStore.provideDefault(),\n\t\t\tIndexPageStore.Config.provide(() => {\n\t\t\t\treturn (config) => ({\n\t\t\t\t\t...config,\n\t\t\t\t\ttype: 'list',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...config.style,\n\t\t\t\t\t\twidth: 'var(--page-width-lv1)',\n\t\t\t\t\t\t// width: 'var(--page-width-lv3)',\n\t\t\t\t\t},\n\t\t\t\t\ttitle: 'コマンド一覧',\n\t\t\t\t\tnavEndActions: [\n\t\t\t\t\t\t{ id: ActionId.REFRESH, name: '更新', icon: 'refresh' },\n\t\t\t\t\t],\n\t\t\t\t})\n\t\t\t}),\n\t\t\tIndexPageStore.Config.provide(() => (config) => ({\n\t\t\t\t...config,\n\t\t\t\ttype: 'table',\n\t\t\t\tstyle: {\n\t\t\t\t\t...config.style,\n\t\t\t\t\twidth: 'var(--page-width-lv3)'\n\t\t\t\t}\n\t\t\t})),\n\t\t\tIndexPageStore.provideColumnsInitializer(() => [\n\t\t\t\t'no',\n\t\t\t\t'id',\n\t\t\t\t'title',\n\t\t\t\t'endpoint',\n\t\t\t\t'method',\n\t\t\t\t'description',\n\t\t\t\t'authorization',\n\t\t\t\t'groups',\n\t\t\t\t'__actions',\n\t\t\t]),\n\t\t\tIndexPageStore.Initializer.provide((store) => {\n\t\t\t\tconst service = inject(CommandService);\n\t\t\t\teffect(() => {\n\t\t\t\t\tapplyToInput(store, 'items', service.commands().map((command, i) => ({ ...command, index: i })));\n\t\t\t\t});\n\t\t\t}),\n\t\t\tprovideEffect(ActionId.REFRESH, () => {\n\t\t\t\tconst commandService = inject(CommandService);\n\t\t\t\treturn () => { commandService.refresh(); };\n\t\t\t}),\n\t\t]\n\t}\n];","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAWA,IAAK,QAEJ;AAFD,CAAA,UAAK,QAAQ,EAAA;AACZ,IAAA,QAA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,KAAK,KAAI;AAC5C,gBAAA,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC;gBACtC,MAAM,CAAC,MAAK;AACX,oBAAA,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACjG,iBAAC,CAAC;AACH,aAAC,CAAC;AACF,YAAA,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAK;AACpC,gBAAA,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;gBAC7C,OAAO,MAAK,EAAG,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE;AAC3C,aAAC,CAAC;AACF;AACD;CACD;;AC9FD;;AAEG"}
|
|
@@ -8,7 +8,7 @@ import { injectAll } from '@ng-atomic/common/stores/entities';
|
|
|
8
8
|
import { AppFrameStore } from '@ng-atomic/components/frames/app';
|
|
9
9
|
import { IndexPageStore, IndexPage } from '@ng-atomic/components/pages/_index';
|
|
10
10
|
import { provideEffect, applyToInput } from '@ng-atomic/core';
|
|
11
|
-
import { plainToInstanceWithValid } from '@nx-ddd/core
|
|
11
|
+
import { plainToInstanceWithValid } from '@nx-ddd/core';
|
|
12
12
|
import dayjs, { isDayjs } from 'dayjs';
|
|
13
13
|
|
|
14
14
|
var ActionId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-routes-queries.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/queries/queries.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/queries/xxmachina-components-routes-queries.ts"],"sourcesContent":["import { computed, effect, inject } from '@angular/core';\nimport { ActivatedRoute, Routes } from '@angular/router';\nimport { Query } from '@xxmachina/common/domain/models';\nimport { QueryHasuraRepository } from '@xxmachina/common/infrastructure/repository/hasura/query';\nimport { defaultDataAccessor, provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { AppService } from '@ng-atomic/common/services/app';\nimport { injectAll } from '@ng-atomic/common/stores/entities';\nimport { AppFrameStore } from '@ng-atomic/components/frames/app';\nimport { IndexPage, IndexPageStore } from '@ng-atomic/components/pages/_index';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { plainToInstanceWithValid } from '@nx-ddd/core
|
|
1
|
+
{"version":3,"file":"xxmachina-components-routes-queries.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/queries/queries.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/queries/xxmachina-components-routes-queries.ts"],"sourcesContent":["import { computed, effect, inject } from '@angular/core';\nimport { ActivatedRoute, Routes } from '@angular/router';\nimport { Query } from '@xxmachina/common/domain/models';\nimport { QueryHasuraRepository } from '@xxmachina/common/infrastructure/repository/hasura/query';\nimport { defaultDataAccessor, provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { AppService } from '@ng-atomic/common/services/app';\nimport { injectAll } from '@ng-atomic/common/stores/entities';\nimport { AppFrameStore } from '@ng-atomic/components/frames/app';\nimport { IndexPage, IndexPageStore } from '@ng-atomic/components/pages/_index';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { plainToInstanceWithValid } from '@nx-ddd/core';\nimport dayjs, { isDayjs } from 'dayjs';\n\nenum ActionId {\n\tEXPORT_QUERIES = '[@xxmachina/app] EXPORT_QUERIES',\n\tIMPORT_QUERIES = '[@xxmachina/app] IMPORT_QUERIES',\n}\n\nexport default <Routes>[\n\t{\n\t\tpath: '',\n\t\tcomponent: IndexPage,\n\t\tloadChildren: () => import('./pages/pages.routes'),\n\t\tdata: { preload: true },\n\t\tproviders: [\n\t\t\tprovideDataAccessor(() => (item: Query, key) => {\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase 'description': return item?.graphql?.query;\n\t\t\t\t\tcase 'subLine': return item?.createdAt?.format('YYYY/MM/DD HH:mm:ss');\n\t\t\t\t\tdefault: return defaultDataAccessor(item, key);\n\t\t\t\t}\n\t\t\t}, {merge: false}),\n\t\t\tIndexPageStore.provideDefault(),\n\t\t\tIndexPageStore.Config.provide(() => {\n\t\t\t\tconst route = inject(ActivatedRoute);\n\t\t\t\treturn config => ({\n\t\t\t\t\t...config,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...config.style,\n\t\t\t\t\t\twidth: 'var(--page-width-lv1)',\n\t\t\t\t\t},\n\t\t\t\t\tnavEndActions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'menu',\n\t\t\t\t\t\t\ticon: 'more_vert',\n\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: AppFrameStore.ActionId.NAVIGATE,\n\t\t\t\t\t\t\t\t\ticon: 'add',\n\t\t\t\t\t\t\t\t\tname: 'クエリの作成',\n\t\t\t\t\t\t\t\t\tpayload: {commands: ['new'], extras: {relativeTo: route}},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: ActionId.EXPORT_QUERIES,\n\t\t\t\t\t\t\t\t\ticon: 'download',\n\t\t\t\t\t\t\t\t\tname: 'クエリのエクスポート'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: ActionId.IMPORT_QUERIES,\n\t\t\t\t\t\t\t\t\ticon: 'upload',\n\t\t\t\t\t\t\t\t\tname: 'クエリのインポート'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\ttitle: 'クエリ一覧',\n\t\t\t\t\ttype: 'list',\n\t\t\t\t\ttableChildrenKey: null,\n\t\t\t\t\tgroupedBy: null,\n\t\t\t\t})\n\t\t\t}),\n\t\t\tIndexPageStore.Initializer.provide((store) => {\n\t\t\t\tconst queries = injectAll(Query);\n\t\t\t\tconst compare = (a, b) => {\n\t\t\t\t\tif (isDayjs(a.createdAt) && isDayjs(b.createdAt)) {\n\t\t\t\t\t\treturn a.createdAt.isBefore(b.createdAt) ? 1 : -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn a.createdAt < b.createdAt ? 1 : -1;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tfunction isISO8601(value) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn dayjs(value).toISOString() === value;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst itemsMap = computed(() => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'名前付き': {\n\t\t\t\t\t\t\titems: queries().filter((query) => !isISO8601(query.title)).sort(compare),\n\t\t\t\t\t\t\titemsLength: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'履歴': {\n\t\t\t\t\t\t\titems: queries().filter((query) => query).sort(compare),\n\t\t\t\t\t\t\titemsLength: 0,\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\teffect(() => { applyToInput(store, 'itemsMap', itemsMap()); });\n\t\t\t}),\n\t\t\tprovideEffect(ActionId.EXPORT_QUERIES, () => {\n\t\t\t\tconst store = inject(IndexPageStore);\n\t\t\t\tconst app = inject(AppService);\n\t\t\t\treturn () => {\n\t\t\t\t\tapp.clipboard.copy(JSON.stringify(store.itemsMap()['名前付き'].items, null, 2));\n\t\t\t\t\tapp.snackBar.open('JSONをコピーしました');\n\t\t\t\t}\n\t\t\t}),\n\t\t\tprovideEffect(ActionId.IMPORT_QUERIES, () => {\n\t\t\t\tconst repo = inject(QueryHasuraRepository);\n\t\t\t\tconst app = inject(AppService);\n\t\t\t\treturn () => {\n\t\t\t\t\tconst json = prompt('JSONを貼り付けてください');\n\t\t\t\t\tif (!json) return;\t\n\t\t\t\t\tconst items = JSON.parse(json) as any[];\n\t\t\t\t\tconst queries = items.map(item => plainToInstanceWithValid(Query, item));\n\t\t\t\t\tapp.loading.await(() => {\n\t\t\t\t\t\treturn repo.saveMany(queries).then(() => {\n\t\t\t\t\t\t\tapp.snackBar.open('クエリをインポートしました');\n\t\t\t\t\t\t}).catch((error) => {\n\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\tapp.snackBar.open('クエリのインポートに失敗しました');\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t]\n\t}\n];","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaA,IAAK,QAGJ;AAHD,CAAA,UAAK,QAAQ,EAAA;AACZ,IAAA,QAAA,CAAA,gBAAA,CAAA,GAAA,iCAAkD;AAClD,IAAA,QAAA,CAAA,gBAAA,CAAA,GAAA,iCAAkD;AACnD,CAAC,EAHI,QAAQ,KAAR,QAAQ,GAGZ,EAAA,CAAA,CAAA;AAED,qBAAuB;AACtB,IAAA;AACC,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,YAAY,EAAE,MAAM,OAAO,iEAAsB,CAAC;AAClD,QAAA,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;AACvB,QAAA,SAAS,EAAE;YACV,mBAAmB,CAAC,MAAM,CAAC,IAAW,EAAE,GAAG,KAAI;gBAC9C,QAAQ,GAAG;oBACV,KAAK,aAAa,EAAE,OAAO,IAAI,EAAE,OAAO,EAAE,KAAK;AAC/C,oBAAA,KAAK,SAAS,EAAE,OAAO,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC;oBACrE,SAAS,OAAO,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC;;AAEhD,aAAC,EAAE,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC;YAClB,cAAc,CAAC,cAAc,EAAE;AAC/B,YAAA,cAAc,CAAC,MAAM,CAAC,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 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-routes-resources-resource.routes-DzGgwitX.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/resources/pages/resource/resource.routes.ts"],"sourcesContent":["import { S } from '@angular/cdk/keycodes';\nimport { computed, effect, inject } from '@angular/core';\nimport { FormBuilder } from '@angular/forms';\nimport { Routes } from '@angular/router';\nimport { Resource } from '@xxmachina/common/domain/models';\nimport { ResourceHasuraRepository } from '@xxmachina/common/infrastructure/repository/hasura/resource';\nimport { provideLangMap, provideModelName } from '@ng-atomic/common/pipes/domain';\nimport { FormFieldMap } from '@ng-atomic/common/pipes/smart-field';\nimport { AppService } from '@ng-atomic/common/services/app';\nimport { injectEntityStore, injectOne } from '@ng-atomic/common/stores/entities';\nimport { computedRawValue, getValue, injectRouteParam } from '@ng-atomic/common/utils';\n// import { ResourcePage } from './resource.page';\nimport { FormPage, FormPageStore, provideEntityIdName } from '@ng-atomic/components/pages/form';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { getLangMap } from '@nx-ddd/common/domain
|
|
1
|
+
{"version":3,"file":"xxmachina-components-routes-resources-resource.routes-DzGgwitX.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/resources/pages/resource/resource.routes.ts"],"sourcesContent":["import { S } from '@angular/cdk/keycodes';\nimport { computed, effect, inject } from '@angular/core';\nimport { FormBuilder } from '@angular/forms';\nimport { Routes } from '@angular/router';\nimport { Resource } from '@xxmachina/common/domain/models';\nimport { ResourceHasuraRepository } from '@xxmachina/common/infrastructure/repository/hasura/resource';\nimport { provideLangMap, provideModelName } from '@ng-atomic/common/pipes/domain';\nimport { FormFieldMap } from '@ng-atomic/common/pipes/smart-field';\nimport { AppService } from '@ng-atomic/common/services/app';\nimport { injectEntityStore, injectOne } from '@ng-atomic/common/stores/entities';\nimport { computedRawValue, getValue, injectRouteParam } from '@ng-atomic/common/utils';\n// import { ResourcePage } from './resource.page';\nimport { FormPage, FormPageStore, provideEntityIdName } from '@ng-atomic/components/pages/form';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { getLangMap } from '@nx-ddd/common/domain';\n\nexport default <Routes>[\n\t{\n\t\tpath: '',\n\t\tcomponent: FormPage,\n\t\t// loadChildren: () => import('./pages/pages.routes').then(m => m.routes)\n\t\tproviders: [\n\t\t\tprovideModelName(() => 'リソース'),\n\t\t\tprovideEntityIdName('resourceId'),\n\t\t\tFormPageStore.provideDefault(),\n\t\t\tFormPageStore.Initializer.provide((store) => {\n\t\t\t\tconst fb = inject(FormBuilder).nonNullable;\n\t\t\t\tconst form = fb.group({\n\t\t\t\t\tid: [''],\n\t\t\t\t\tprojectId: [''],\n\t\t\t\t\tname: [''],\n\t\t\t\t\ttype: ['graphql'],\n\t\t\t\t\topenapi: fb.group({\n\t\t\t\t\t\turl: [''],\n\t\t\t\t\t}),\n\t\t\t\t\tgraphql: fb.group({\n\t\t\t\t\t\turl: [''],\n\t\t\t\t\t}),\n\t\t\t\t\tcreatedAt: [{value: '', disabled: true}],\n\t\t\t\t\tupdatedAt: [{value: '', disabled: true}],\n\t\t\t\t});\n\t\t\t\tapplyToInput(store, 'form', form);\n\t\t\t}),\n\t\t\tFormPageStore.Initializer.provide((store) => {\n\t\t\t\tconst value = computedRawValue(() => store.form())\n\t\t\t\tconst formFieldMap = computed<FormFieldMap>(() => ({\n\t\t\t\t\tid: { type: 'hidden' },\n\t\t\t\t\tprojectId: { type: 'hidden' },\n\t\t\t\t\tname: { type: 'text' },\n\t\t\t\t\ttype: {\n\t\t\t\t\t\ttype: 'select',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ name: 'GraphQL', value: 'graphql' },\n\t\t\t\t\t\t\t{ name: 'OpenAPI', value: 'openapi' },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t'openapi.url': { type: value()?.type === 'openapi' ? 'text' : 'hidden' },\n\t\t\t\t\t'graphql.url': { type: value()?.type === 'graphql' ? 'text' : 'hidden' },\n\t\t\t\t\tcreatedAt: {\n\t\t\t\t\t\ttype: 'date',\n\t\t\t\t\t},\n\t\t\t\t\tupdatedAt: {\n\t\t\t\t\t\ttype: 'date',\n\t\t\t\t\t},\n\t\t\t\t}));\n\t\t\t\teffect(() => {\n\t\t\t\t\tapplyToInput(store, 'fieldMap', formFieldMap());\n\t\t\t\t});\n\t\t\t}),\n\t\t\tFormPageStore.Initializer.provide((store) => {\n\t\t\t\tconst resourceId = injectRouteParam('resourceId');\n\t\t\t\tconst resource = injectOne(Resource, { id: resourceId });\n\t\t\t\teffect(() => {\n\t\t\t\t\tconsole.debug('resourceId:', resourceId());\n\t\t\t\t\tconsole.debug('resource:', resource());\n\t\t\t\t\tstore.form().patchValue(resource());\n\t\t\t\t});\n\t\t\t}),\n\t\t\tprovideEffect(FormPageStore.ActionId.CREATE, () => {\n\t\t\t\tconst entity = injectEntityStore(Resource);\n\t\t\t\tconst app = inject(AppService);\n\t\t\t\tconst store = inject(FormPageStore);\n\t\t\t\treturn () => {\n\t\t\t\t\tconst value = store.form().getRawValue();\n\t\t\t\t\tconsole.debug('value:', value);\n\t\t\t\t\tapp.loading.await(() => {\n\t\t\t\t\t\treturn entity.create({\n\t\t\t\t\t\t\tid: undefined,\n\t\t\t\t\t\t\tprojectId: 'default',\n\t\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\t\tname: value.name,\n\t\t\t\t\t\t\topenapi: value.openapi,\n\t\t\t\t\t\t\tgraphql: value.graphql,\n\t\t\t\t\t\t\tcreatedAt: undefined,\n\t\t\t\t\t\t\tupdatedAt: undefined,\n\t\t\t\t\t\t}).then(() => {\n\t\t\t\t\t\t\tapp.snackBar.open('リソースを作成しました');\n\t\t\t\t\t\t}).catch((error) => {\n\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\tapp.snackBar.open('リソースの作成に失敗しました');\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}),\n\t\t\tprovideEffect(FormPageStore.ActionId.UPDATE, () => {\n\t\t\t\tconst entity = injectEntityStore(Resource);\n\t\t\t\tconst app = inject(AppService);\n\t\t\t\tconst store = inject(FormPageStore);\n\t\t\t\tconst resourceId = injectRouteParam('resourceId');\n\t\t\t\treturn () => {\n\t\t\t\t\tconst value = store.form().getRawValue();\n\t\t\t\t\tconsole.debug('value:', value);\n\t\t\t\t\tapp.loading.await(() => {\n\t\t\t\t\t\treturn entity.update({\n\t\t\t\t\t\t\tid: resourceId(),\n\t\t\t\t\t\t\tprojectId: 'default',\n\t\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\t\tname: value.name,\n\t\t\t\t\t\t\topenapi: value.openapi,\n\t\t\t\t\t\t\tgraphql: value.graphql,\n\t\t\t\t\t\t\tcreatedAt: undefined,\n\t\t\t\t\t\t\tupdatedAt: undefined,\n\t\t\t\t\t\t}).then(() => {\n\t\t\t\t\t\t\tapp.snackBar.open('リソースを更新しました');\n\t\t\t\t\t\t}).catch((error) => {\n\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\tapp.snackBar.open('リソースの更新に失敗しました');\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}),\n\t\t]\n\t}\n];"],"names":[],"mappings":";;;;;;;;;;AAgBA,sBAAuB;AACtB,IAAA;AACC,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,QAAQ;;AAEnB,QAAA,SAAS,EAAE;AACV,YAAA,gBAAgB,CAAC,MAAM,MAAM,CAAC;YAC9B,mBAAmB,CAAC,YAAY,CAAC;YACjC,aAAa,CAAC,cAAc,EAAE;YAC9B,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;gBAC3C,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW;AAC1C,gBAAA,MAAM,IAAI,GAAI,EAAE,CAAC,KAAK,CAAC;oBACtB,EAAE,EAAE,CAAC,EAAE,CAAC;oBACR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CAAC,OAAO,CAAC,KAAK,CAAC,MAAK;wBACtB,OAAO,MAAM,CAAC,MAAM,CAAC;4BACpB,EAAE,EAAE,UAAU,EAAE;AAChB,4BAAA,SAAS,EAAE,SAAS;4BACpB,IAAI,EAAE,KAAK,CAAC,IAAI;4BAChB,IAAI,EAAE,KAAK,CAAC,IAAI;4BAChB,OAAO,EAAE,KAAK,CAAC,OAAO;4BACtB,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,4BAAA,SAAS,EAAE,SAAS;AACpB,4BAAA,SAAS,EAAE,SAAS;AACpB,yBAAA,CAAC,CAAC,IAAI,CAAC,MAAK;AACZ,4BAAA,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;AACjC,yBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAI;AAClB,4BAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACpB,4BAAA,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC;AACpC,yBAAC,CAAC;AACH,qBAAC,CAAC;AACH,iBAAC;AACF,aAAC,CAAC;AACF;AACD;CACD;;;;"}
|
|
@@ -8,8 +8,8 @@ import { injectAll } from '@ng-atomic/common/stores/entities';
|
|
|
8
8
|
import { injectIndexForm, buildColumns } from '@ng-atomic/components/organisms/table';
|
|
9
9
|
import { IndexPageStore, IndexPage } from '@ng-atomic/components/pages/_index';
|
|
10
10
|
import { provideEffect, applyToInput } from '@ng-atomic/core';
|
|
11
|
-
import { getLangMap } from '@nx-ddd/common/domain
|
|
12
|
-
import { plainToInstanceWithValid } from '@nx-ddd/core
|
|
11
|
+
import { getLangMap } from '@nx-ddd/common/domain';
|
|
12
|
+
import { plainToInstanceWithValid } from '@nx-ddd/core';
|
|
13
13
|
|
|
14
14
|
var ActionId;
|
|
15
15
|
(function (ActionId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-routes-resources.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/resources/resources.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/resources/xxmachina-components-routes-resources.ts"],"sourcesContent":["import { effect, inject } from '@angular/core';\nimport { Routes } from '@angular/router';\nimport { Resource, ResourceHelper } from '@xxmachina/common/domain/models';\nimport { ResourceHasuraRepository } from '@xxmachina/common/infrastructure/repository/hasura/resource';\nimport { provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { provideLangMap } from '@ng-atomic/common/pipes/domain';\nimport { AppService } from '@ng-atomic/common/services/app';\nimport { injectAll } from '@ng-atomic/common/stores/entities';\nimport { buildColumns, injectIndexForm } from '@ng-atomic/components/organisms/table';\nimport { IndexPage, IndexPageStore } from '@ng-atomic/components/pages/_index';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { getLangMap } from '@nx-ddd/common/domain
|
|
1
|
+
{"version":3,"file":"xxmachina-components-routes-resources.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/resources/resources.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/resources/xxmachina-components-routes-resources.ts"],"sourcesContent":["import { effect, inject } from '@angular/core';\nimport { Routes } from '@angular/router';\nimport { Resource, ResourceHelper } from '@xxmachina/common/domain/models';\nimport { ResourceHasuraRepository } from '@xxmachina/common/infrastructure/repository/hasura/resource';\nimport { provideDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { provideLangMap } from '@ng-atomic/common/pipes/domain';\nimport { AppService } from '@ng-atomic/common/services/app';\nimport { injectAll } from '@ng-atomic/common/stores/entities';\nimport { buildColumns, injectIndexForm } from '@ng-atomic/components/organisms/table';\nimport { IndexPage, IndexPageStore } from '@ng-atomic/components/pages/_index';\nimport { applyToInput, provideEffect } from '@ng-atomic/core';\nimport { getLangMap } from '@nx-ddd/common/domain';\nimport { plainToInstanceWithValid } from '@nx-ddd/core';\n\nenum ActionId {\n\tEXPORT_RESOURCES = '[@xxmachina/app] EXPORT_RESOURCES',\n\tIMPORT_RESOURCES = '[@xxmachina/app] IMPORT_RESOURCES',\n}\n\nexport default <Routes>[\n\t{\n\t\tpath: '',\n\t\tcomponent: IndexPage,\n\t\tloadChildren: () => import('./pages/pages.routes'),\n\t\tproviders: [\n\t\t\tprovideLangMap(() => getLangMap(Resource, {\n\t\t\t\tdescription: '説明',\n\t\t\t\t'graphql.url': 'GraphQL URL',\n\t\t\t\t'openapi.url': 'OpenAPI URL',\n\t\t\t})),\n\t\t\tprovideDataAccessor(() => {\n\t\t\t\treturn (item: Resource, key) => {\n\t\t\t\t\tswitch (key) {\n\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\treturn ResourceHelper.getDescription(item);\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn item[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tIndexPageStore.provideDefault(),\n\t\t\tIndexPageStore.Config.provide(() => {\n\t\t\t\treturn config => ({\n\t\t\t\t\t...config,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...config.style,\n\t\t\t\t\t\twidth: 'var(--page-width-lv2)',\n\t\t\t\t\t},\n\t\t\t\t\ttitle: 'リソース一覧',\n\t\t\t\t\tnavEndActions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'menu',\n\t\t\t\t\t\t\ticon: 'more_vert',\n\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: IndexPageStore.ActionId.ADD,\n\t\t\t\t\t\t\t\t\tname: '追加',\n\t\t\t\t\t\t\t\t\ticon: 'add',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: ActionId.EXPORT_RESOURCES,\n\t\t\t\t\t\t\t\t\ticon: 'download',\n\t\t\t\t\t\t\t\t\tname: 'リソースのエクスポート'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: ActionId.IMPORT_RESOURCES,\n\t\t\t\t\t\t\t\t\ticon: 'upload',\n\t\t\t\t\t\t\t\t\tname: 'リソースのインポート'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\titemActions: (item: Resource) => [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: IndexPageStore.ActionId.DETAIL,\n\t\t\t\t\t\t\tname: '詳細',\n\t\t\t\t\t\t\ticon: 'open_in_new',\n\t\t\t\t\t\t\tpayload: item,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})\n\t\t\t}),\n\t\t\tIndexPageStore.Initializer.provide((store) => {\n\t\t\t\tconst form = injectIndexForm({\n\t\t\t\t\tcolumns: buildColumns([\n\t\t\t\t\t\t'id', 'name', 'type', 'description', '__actions'\n\t\t\t\t\t])\n\t\t\t\t})\n\t\t\t\tapplyToInput(store, 'form', form);\n\t\t\t\tconst resources = injectAll(Resource);\n\t\t\t\teffect(() => {\n\t\t\t\t\tapplyToInput(store, 'items', resources());\n\t\t\t\t});\n\t\t\t}),\n\t\t\tprovideEffect(ActionId.EXPORT_RESOURCES, () => {\n\t\t\t\tconst store = inject(IndexPageStore);\n\t\t\t\tconst app = inject(AppService);\n\t\t\t\treturn () => {\n\t\t\t\t\tapp.clipboard.copy(JSON.stringify(store.items(), null, 2));\n\t\t\t\t\tapp.snackBar.open('JSONをコピーしました');\n\t\t\t\t}\n\t\t\t}),\n\t\t\tprovideEffect(ActionId.IMPORT_RESOURCES, () => {\n\t\t\t\tconst repo = inject(ResourceHasuraRepository);\n\t\t\t\tconst app = inject(AppService);\n\t\t\t\treturn () => {\n\t\t\t\t\tconst json = prompt('JSONを貼り付けてください');\n\t\t\t\t\tif (!json) return;\t\n\t\t\t\t\tconst items = JSON.parse(json) as any[];\n\t\t\t\t\tconst queries = items.map(item => plainToInstanceWithValid(Resource, item));\n\t\t\t\t\tapp.loading.await(() => {\n\t\t\t\t\t\treturn repo.saveMany(queries).then(() => {\n\t\t\t\t\t\t\tapp.snackBar.open('リソースをインポートしました');\n\t\t\t\t\t\t}).catch((error) => {\n\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\tapp.snackBar.open('リソースのインポートに失敗しました');\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t]\n\t}\n];","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAcA,IAAK,QAGJ;AAHD,CAAA,UAAK,QAAQ,EAAA;AACZ,IAAA,QAAA,CAAA,kBAAA,CAAA,GAAA,mCAAsD;AACtD,IAAA,QAAA,CAAA,kBAAA,CAAA,GAAA,mCAAsD;AACvD,CAAC,EAHI,QAAQ,KAAR,QAAQ,GAGZ,EAAA,CAAA,CAAA;AAED,uBAAuB;AACtB,IAAA;AACC,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,YAAY,EAAE,MAAM,OAAO,mEAAsB,CAAC;AAClD,QAAA,SAAS,EAAE;AACV,YAAA,cAAc,CAAC,MAAM,UAAU,CAAC,QAAQ,EAAE;AACzC,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,aAAa,EAAE,aAAa;AAC5B,gBAAA,aAAa,EAAE,aAAa;AAC5B,aAAA,CAAC,CAAC;YACH,mBAAmB,CAAC,MAAK;AACxB,gBAAA,OAAO,CAAC,IAAc,EAAE,GAAG,KAAI;oBAC9B,QAAQ,GAAG;AACV,wBAAA,KAAK,aAAa;AACjB,4BAAA,OAAO,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC;AAC3C,wBAAA;AACC,4BAAA,OAAO,IAAI,CAAC,GAAG,CAAC;;AAEnB,iBAAC;AACF,aAAC,CAAC;YACF,cAAc,CAAC,cAAc,EAAE;AAC/B,YAAA,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,MAAK;AA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,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC;AACpC,yBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAI;AAClB,4BAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACpB,4BAAA,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC;AACvC,yBAAC,CAAC;AACH,qBAAC,CAAC;AACH,iBAAC;AACF,aAAC,CAAC;AACF;AACD;CACD;;AC1HD;;AAEG"}
|
|
@@ -2,20 +2,20 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { signal, inject, Injectable } from '@angular/core';
|
|
3
3
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { AuthService } from '@xxmachina/common/auth';
|
|
5
|
-
import { reconstruct } from '@nx-ddd/core
|
|
6
|
-
import { filter, map } from 'rxjs';
|
|
5
|
+
import { reconstruct } from '@nx-ddd/core';
|
|
6
|
+
import { shareReplay, filter, map } from 'rxjs';
|
|
7
7
|
|
|
8
8
|
class QueryConfigService {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.config = signal(null);
|
|
11
|
-
this.config$ = toObservable(this.config);
|
|
11
|
+
this.config$ = toObservable(this.config).pipe(shareReplay(1));
|
|
12
12
|
this.auth = inject(AuthService);
|
|
13
13
|
this.auth.accessToken$.subscribe((accessToken) => {
|
|
14
|
+
console.debug('[QueryConfigService] accessToken:', accessToken);
|
|
14
15
|
this.config.update((config) => ({ ...config, auth: { accessToken } }));
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
replace(params, _config = this.config()) {
|
|
18
|
+
replace(params, _config) {
|
|
19
19
|
if (typeof params === 'string') {
|
|
20
20
|
return params.replaceAll("$MACHINA_AUTH_ACCESS_TOKEN", _config?.auth?.accessToken ?? '');
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-services-query-config.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/query-config/query-config.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/query-config/xxmachina-components-services-query-config.ts"],"sourcesContent":["import { inject, Injectable, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport { AuthService } from \"@xxmachina/common/auth\";\nimport { reconstruct } from \"@nx-ddd/core
|
|
1
|
+
{"version":3,"file":"xxmachina-components-services-query-config.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/query-config/query-config.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/query-config/xxmachina-components-services-query-config.ts"],"sourcesContent":["import { inject, Injectable, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport { AuthService } from \"@xxmachina/common/auth\";\nimport { reconstruct } from \"@nx-ddd/core\";\nimport { filter, map, Observable, shareReplay } from \"rxjs\";\n\n@Injectable({providedIn: 'root'})\nexport class QueryConfigService {\n readonly config = signal<{\n auth?: {\n accessToken?: string;\n }\n }>(null);\n readonly config$ = toObservable(this.config).pipe(shareReplay(1));\n readonly auth = inject(AuthService);\n\n constructor() {\n this.auth.accessToken$.subscribe((accessToken) => {\n console.debug('[QueryConfigService] accessToken:', accessToken);\n this.config.update((config) => ({ ...config, auth: { accessToken } }));\n });\n }\n\n protected replace<T extends Record<string, any> | string>(params: T, _config): T {\n if (typeof params === 'string') {\n return params.replaceAll(\"$MACHINA_AUTH_ACCESS_TOKEN\", _config?.auth?.accessToken ?? '') as T;\n }\n const resonstruceted = reconstruct(params, (_, value) => {\n if (typeof value === 'string') {\n const newValue = value.replaceAll(\"$MACHINA_AUTH_ACCESS_TOKEN\", _config?.auth?.accessToken ?? '');\n return [true, newValue];\n }\n return [false];\n });\n return resonstruceted as T;\n }\n\n resolve<T extends object>(params: T): Observable<T> {\n return this.config$.pipe(\n filter((config) => !!config?.auth?.accessToken),\n map(config => this.replace(params, config)),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n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AAI,CAAC,OAAO,CAAC,IAAI,CACtB,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,EAC/C,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAC5C;;8GAlCQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADN,MAAM,EAAA,CAAA,CAAA;;2FAClB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;ACNhC;;AAEG;;;;"}
|
|
@@ -45,6 +45,9 @@ class QueryService {
|
|
|
45
45
|
}));
|
|
46
46
|
}
|
|
47
47
|
subscribe(query, { endpoint, headers = { 'content-type': 'application/json' }, variables = {}, } = {}, transformer = (result) => QueryHelper.parseResult(result)) {
|
|
48
|
+
if (typeof headers['Authorization'] === 'undefined') {
|
|
49
|
+
throw new Error(`Authorization is not ' ${query}`);
|
|
50
|
+
}
|
|
48
51
|
if (!endpoint) {
|
|
49
52
|
throw new Error(`endpoint is required ${query}`);
|
|
50
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-services-query.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/query/query.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/query/xxmachina-components-services-query.ts"],"sourcesContent":["import { HttpClient } from \"@angular/common/http\";\nimport { inject, Injectable } from \"@angular/core\";\nimport { map, lastValueFrom, switchMap, tap } from \"rxjs\";\nimport { gql } from 'apollo-angular';\nimport { getIntrospectionQuery } from \"graphql\";\nimport { Query, QueryHelper } from \"@xxmachina/common/domain/models\";\nimport { QueryConfigService } from \"@xxmachina/components/services/query-config\";\nimport { ApolloMultiService } from \"@nx-ddd/hasura\";\nimport { Observable } from \"rxjs\";\n\n@Injectable({providedIn: 'root'})\nexport class QueryService {\n protected readonly http = inject(HttpClient);\n readonly config = inject(QueryConfigService);\n readonly apolloMulti = inject(ApolloMultiService);\n\n execute(\n query: string,\n options: {\n endpoint?: string,\n headers?: Record<string, string>,\n } = {\n endpoint: '',\n headers: {\n 'content-type': 'application/json',\n }\n },\n ) {\n return this.config.resolve(options).pipe(\n switchMap(({endpoint, headers}) => this.http.post(endpoint, { query }, { headers }))\n );\n }\n\n getSchema(endpoint: string, options: {\n headers?: Record<string, string>,\n } = {\n headers: {\n 'content-type': 'application/json',\n }\n }) {\n return this.execute(getIntrospectionQuery(), {...options, endpoint});\n }\n\n subscribeSchema(endpoint: string, options: {\n headers?: Record<string, string>,\n }) {\n return this.subscribe(getIntrospectionQuery(), {\n headers: options.headers,\n endpoint\n }, (result) => result);\n }\n\n subscribeQuery(_query: Pick<Query, 'graphql'>): Observable<Record<string, any>> {\n return this.config.resolve(_query).pipe(\n switchMap((query) => {\n const client = this.apolloMulti.getClient(query.graphql.endpoint, () => this.config.resolve(_query.graphql.headers));\n return client.subscribe<Record<string, any>>({\n query: gql`${query.graphql.query}`,\n variables: query.graphql.variables,\n }).pipe(\n tap((result) => console.debug('[QueryService] result:', result)),\n map((result) => QueryHelper.parseResult(result as any)),\n )}\n ),\n );\n }\n\n subscribe(\n query: string,\n {\n endpoint,\n headers = { 'content-type': 'application/json' },\n variables = {},\n }: {\n endpoint?: string,\n headers?: Record<string, string>,\n variables?: Record<string, any>,\n } = { },\n transformer = (result: any) => QueryHelper.parseResult(result),\n ) {\n if (!endpoint) {\n throw new Error(`endpoint is required ${query}`);\n }\n return this.config.resolve({query, endpoint, variables}).pipe(\n switchMap(({query, endpoint, variables}) => {\n const client = this.apolloMulti.getClient(endpoint, () => this.config.resolve(headers));\n return client.subscribe<Record<string, any>>({\n query: gql`${query}`,\n variables: variables,\n fetchPolicy: 'network-only',\n }).pipe(\n tap((result) => console.debug('[QueryService] result:', result)),\n map(transformer),\n )}\n ),\n );\n }\n \n async generate(\n instructions: string,\n options: {\n baseUrl: string\n } = {\n baseUrl: '',\n },\n ) {\n const endpoint = `${options.baseUrl}/generate`;\n return lastValueFrom(this.http.post<{query: string}>(endpoint, { instructions }));\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAWa,YAAY,CAAA;AADzB,IAAA,WAAA,GAAA;AAEqB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACnC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACnC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"xxmachina-components-services-query.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/query/query.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/query/xxmachina-components-services-query.ts"],"sourcesContent":["import { HttpClient } from \"@angular/common/http\";\nimport { inject, Injectable } from \"@angular/core\";\nimport { map, lastValueFrom, switchMap, tap } from \"rxjs\";\nimport { gql } from 'apollo-angular';\nimport { getIntrospectionQuery } from \"graphql\";\nimport { Query, QueryHelper } from \"@xxmachina/common/domain/models\";\nimport { QueryConfigService } from \"@xxmachina/components/services/query-config\";\nimport { ApolloMultiService } from \"@nx-ddd/hasura\";\nimport { Observable } from \"rxjs\";\n\n@Injectable({providedIn: 'root'})\nexport class QueryService {\n protected readonly http = inject(HttpClient);\n readonly config = inject(QueryConfigService);\n readonly apolloMulti = inject(ApolloMultiService);\n\n execute(\n query: string,\n options: {\n endpoint?: string,\n headers?: Record<string, string>,\n } = {\n endpoint: '',\n headers: {\n 'content-type': 'application/json',\n }\n },\n ) {\n return this.config.resolve(options).pipe(\n switchMap(({endpoint, headers}) => this.http.post(endpoint, { query }, { headers }))\n );\n }\n\n getSchema(endpoint: string, options: {\n headers?: Record<string, string>,\n } = {\n headers: {\n 'content-type': 'application/json',\n }\n }) {\n return this.execute(getIntrospectionQuery(), {...options, endpoint});\n }\n\n subscribeSchema(endpoint: string, options: {\n headers?: Record<string, string>,\n }) {\n return this.subscribe(getIntrospectionQuery(), {\n headers: options.headers,\n endpoint\n }, (result) => result);\n }\n\n subscribeQuery(_query: Pick<Query, 'graphql'>): Observable<Record<string, any>> {\n return this.config.resolve(_query).pipe(\n switchMap((query) => {\n const client = this.apolloMulti.getClient(query.graphql.endpoint, () => this.config.resolve(_query.graphql.headers));\n return client.subscribe<Record<string, any>>({\n query: gql`${query.graphql.query}`,\n variables: query.graphql.variables,\n }).pipe(\n tap((result) => console.debug('[QueryService] result:', result)),\n map((result) => QueryHelper.parseResult(result as any)),\n )}\n ),\n );\n }\n\n subscribe(\n query: string,\n {\n endpoint,\n headers = { 'content-type': 'application/json' },\n variables = {},\n }: {\n endpoint?: string,\n headers?: Record<string, string>,\n variables?: Record<string, any>,\n } = { },\n transformer = (result: any) => QueryHelper.parseResult(result),\n ) {\n if (typeof headers['Authorization'] === 'undefined') {\n throw new Error(`Authorization is not ' ${query}`);\n }\n\n if (!endpoint) {\n throw new Error(`endpoint is required ${query}`);\n }\n return this.config.resolve({query, endpoint, variables}).pipe(\n switchMap(({query, endpoint, variables}) => {\n const client = this.apolloMulti.getClient(endpoint, () => this.config.resolve(headers));\n return client.subscribe<Record<string, any>>({\n query: gql`${query}`,\n variables: variables,\n fetchPolicy: 'network-only',\n }).pipe(\n tap((result) => console.debug('[QueryService] result:', result)),\n map(transformer),\n )}\n ),\n );\n }\n \n async generate(\n instructions: string,\n options: {\n baseUrl: string\n } = {\n baseUrl: '',\n },\n ) {\n const endpoint = `${options.baseUrl}/generate`;\n return lastValueFrom(this.http.post<{query: string}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"}
|
|
@@ -4,18 +4,21 @@ import { AuthService } from '@xxmachina/common/auth';
|
|
|
4
4
|
import { QueryHelper } from '@xxmachina/common/domain/models';
|
|
5
5
|
import { QueryService } from '@xxmachina/components/services/query';
|
|
6
6
|
import { isEqual } from 'lodash-es';
|
|
7
|
-
import { ReplaySubject, distinctUntilChanged, filter,
|
|
7
|
+
import { ReplaySubject, distinctUntilChanged, filter, tap, switchMap, shareReplay, combineLatest, startWith } from 'rxjs';
|
|
8
8
|
|
|
9
9
|
class QueryValidators {
|
|
10
10
|
static graphql() {
|
|
11
11
|
const service = inject(QueryService);
|
|
12
12
|
const auth = inject(AuthService);
|
|
13
13
|
const params$ = new ReplaySubject(1);
|
|
14
|
-
const result$ = params$.pipe(distinctUntilChanged((a, b) => isEqual(a, b)), filter(({ endpoint }) => !!endpoint),
|
|
14
|
+
const result$ = params$.pipe(distinctUntilChanged((a, b) => isEqual(a, b)), filter(({ endpoint }) => !!endpoint), tap(({ endpoint, headersJson }) => {
|
|
15
|
+
console.debug('[QueryValidators] endpoint:', endpoint);
|
|
16
|
+
console.debug('[QueryValidators] headersJson:', headersJson);
|
|
17
|
+
}), switchMap(({ endpoint, headersJson }) => {
|
|
15
18
|
return service.subscribeSchema(endpoint, {
|
|
16
19
|
headers: QueryHelper.tryParseJson(headersJson),
|
|
17
20
|
});
|
|
18
|
-
}), tap((result) => console.debug('QueryValidators
|
|
21
|
+
}), tap((result) => console.debug('[QueryValidators] result:', result)), shareReplay(1), takeUntilDestroyed());
|
|
19
22
|
return (formGroup) => {
|
|
20
23
|
return combineLatest({
|
|
21
24
|
accessToken: auth.accessToken$,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-validators-query.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/validators/query/query.validators.ts","../../../../../packages/@xxmachina/components/src/lib/validators/query/xxmachina-components-validators-query.ts"],"sourcesContent":["import { inject } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { AsyncValidatorFn, FormControl, FormGroup } from \"@angular/forms\";\nimport { AuthService } from \"@xxmachina/common/auth\";\nimport { QueryHelper } from \"@xxmachina/common/domain/models\";\nimport { QueryService } from \"@xxmachina/components/services/query\";\nimport { isEqual } from \"lodash-es\";\nimport { combineLatest, distinctUntilChanged, filter, map, ReplaySubject, shareReplay, startWith, switchMap, tap } from \"rxjs\";\n\nexport class QueryValidators {\n static graphql(): AsyncValidatorFn {\n const service = inject(QueryService);\n const auth = inject(AuthService);\n const params$ = new ReplaySubject<{endpoint: string, headersJson: string}>(1);\n const result$ = params$.pipe(\n distinctUntilChanged((a, b) => isEqual(a, b)),\n filter(({endpoint}) => !!endpoint),\n switchMap(({ endpoint, headersJson}) => {\n return service.subscribeSchema(endpoint, {\n headers: QueryHelper.tryParseJson(headersJson),\n })\n }),\n tap((result) => console.debug('QueryValidators
|
|
1
|
+
{"version":3,"file":"xxmachina-components-validators-query.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/validators/query/query.validators.ts","../../../../../packages/@xxmachina/components/src/lib/validators/query/xxmachina-components-validators-query.ts"],"sourcesContent":["import { inject } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { AsyncValidatorFn, FormControl, FormGroup } from \"@angular/forms\";\nimport { AuthService } from \"@xxmachina/common/auth\";\nimport { QueryHelper } from \"@xxmachina/common/domain/models\";\nimport { QueryService } from \"@xxmachina/components/services/query\";\nimport { isEqual } from \"lodash-es\";\nimport { combineLatest, distinctUntilChanged, filter, map, ReplaySubject, shareReplay, startWith, switchMap, tap } from \"rxjs\";\n\nexport class QueryValidators {\n static graphql(): AsyncValidatorFn {\n const service = inject(QueryService);\n const auth = inject(AuthService);\n const params$ = new ReplaySubject<{endpoint: string, headersJson: string}>(1);\n const result$ = params$.pipe(\n distinctUntilChanged((a, b) => isEqual(a, b)),\n filter(({endpoint}) => !!endpoint),\n tap(({endpoint, headersJson}) => {\n console.debug('[QueryValidators] endpoint:', endpoint);\n console.debug('[QueryValidators] headersJson:', headersJson);\n }),\n switchMap(({ endpoint, headersJson}) => {\n return service.subscribeSchema(endpoint, {\n headers: QueryHelper.tryParseJson(headersJson),\n })\n }),\n tap((result) => console.debug('[QueryValidators] result:', result)),\n shareReplay(1),\n takeUntilDestroyed(),\n );\n\n return (formGroup: FormGroup<{\n endpoint: FormControl<string>,\n headersJson: FormControl<string>,\n }>) => {\n return combineLatest({\n accessToken: auth.accessToken$,\n value: formGroup.valueChanges.pipe(startWith(formGroup.value)),\n }).pipe(\n switchMap(({accessToken, value}) => {\n if (!accessToken ) return Promise.resolve(null);\n params$.next({endpoint: value.endpoint, headersJson: value.headersJson});\n return result$;\n }),\n )\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MASa,eAAe,CAAA;AAC1B,IAAA,OAAO,OAAO,GAAA;AACZ,QAAA,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,MAAM,OAAO,GAAG,IAAI,aAAa,CAA0C,CAAC,CAAC;QAC7E,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAC1B,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC7C,MAAM,CAAC,CAAC,EAAC,QAAQ,EAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAClC,GAAG,CAAC,CAAC,EAAC,QAAQ,EAAE,WAAW,EAAC,KAAI;AAC9B,YAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,QAAQ,CAAC;AACtD,YAAA,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,WAAW,CAAC;SAC7D,CAAC,EACF,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAC,KAAI;AACrC,YAAA,OAAO,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE;AACvC,gBAAA,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC;AAC/C,aAAA,CAAC;SACH,CAAC,EACF,GAAG,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,EACnE,WAAW,CAAC,CAAC,CAAC,EACd,kBAAkB,EAAE,CACrB;QAED,OAAO,CAAC,SAGN,KAAI;AACJ,YAAA,OAAO,aAAa,CAAC;gBACnB,WAAW,EAAE,IAAI,CAAC,YAAY;AAC9B,gBAAA,KAAK,EAAE,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/D,aAAA,CAAC,CAAC,IAAI,CACL,SAAS,CAAC,CAAC,EAAC,WAAW,EAAE,KAAK,EAAC,KAAI;AACjC,gBAAA,IAAI,CAAC,WAAW;AAAG,oBAAA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;AAC/C,gBAAA,OAAO,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAC,CAAC;AACxE,gBAAA,OAAO,OAAO;aACf,CAAC,CACH;AACH,SAAC;;AAEJ;;AC/CD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xxmachina/components",
|
|
3
|
-
"version": "19.0.0-preview.
|
|
3
|
+
"version": "19.0.0-preview.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./routes/index.d.ts",
|
|
19
19
|
"default": "./fesm2022/xxmachina-components-routes.mjs"
|
|
20
20
|
},
|
|
21
|
+
"./features/command": {
|
|
22
|
+
"types": "./features/command/index.d.ts",
|
|
23
|
+
"default": "./fesm2022/xxmachina-components-features-command.mjs"
|
|
24
|
+
},
|
|
21
25
|
"./features/query": {
|
|
22
26
|
"types": "./features/query/index.d.ts",
|
|
23
27
|
"default": "./fesm2022/xxmachina-components-features-query.mjs"
|
|
@@ -34,10 +38,6 @@
|
|
|
34
38
|
"types": "./molecules/calendar-paginator/index.d.ts",
|
|
35
39
|
"default": "./fesm2022/xxmachina-components-molecules-calendar-paginator.mjs"
|
|
36
40
|
},
|
|
37
|
-
"./features/command": {
|
|
38
|
-
"types": "./features/command/index.d.ts",
|
|
39
|
-
"default": "./fesm2022/xxmachina-components-features-command.mjs"
|
|
40
|
-
},
|
|
41
41
|
"./molecules/daily-cell": {
|
|
42
42
|
"types": "./molecules/daily-cell/index.d.ts",
|
|
43
43
|
"default": "./fesm2022/xxmachina-components-molecules-daily-cell.mjs"
|
|
@@ -14,12 +14,7 @@ export declare class QueryConfigService {
|
|
|
14
14
|
}>;
|
|
15
15
|
readonly auth: AuthService;
|
|
16
16
|
constructor();
|
|
17
|
-
|
|
18
|
-
protected replace<T extends Record<string, any> | string>(params: T, _config?: {
|
|
19
|
-
auth?: {
|
|
20
|
-
accessToken?: string;
|
|
21
|
-
};
|
|
22
|
-
}): T;
|
|
17
|
+
protected replace<T extends Record<string, any> | string>(params: T, _config: any): T;
|
|
23
18
|
resolve<T extends object>(params: T): Observable<T>;
|
|
24
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<QueryConfigService, never>;
|
|
25
20
|
static ɵprov: i0.ɵɵInjectableDeclaration<QueryConfigService>;
|