zova-module-rest-resource 5.1.44 → 5.1.45

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/index.js CHANGED
@@ -8,6 +8,15 @@ import { z } from "zod";
8
8
  import { ZovaJsx } from "zova-jsx";
9
9
  import { Controller, Scope } from "zova-module-a-bean";
10
10
  import { Virtual } from "zova-core";
11
+ //#region src/lib/deleteRequest.ts
12
+ function prepareDeleteRequestConfig(config, body) {
13
+ if (body === void 0) return config;
14
+ return {
15
+ ...config,
16
+ data: body
17
+ };
18
+ }
19
+ //#endregion
11
20
  //#region src/model/resource.ts
12
21
  var _dec$4, _dec2$4, _dec3$3, _dec4$2, _class$4, _class2$2, _descriptor;
13
22
  function _initializerDefineProperty(e, i, r, l) {
@@ -145,8 +154,10 @@ var ModelResource = (_dec$4 = Model({ enableSelector: true }), _dec2$4 = BeanInf
145
154
  return this.mutationItem({
146
155
  id,
147
156
  action: "delete",
148
- mutationFn: async () => {
149
- return this.$fetch.delete(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id }), this.sys.util.apiActionConfigPrepare());
157
+ mutationFn: async (body) => {
158
+ const apiPath = this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id });
159
+ const apiConfig = prepareDeleteRequestConfig(this.sys.util.apiActionConfigPrepare(), body);
160
+ return this.$fetch.delete(apiPath, apiConfig);
150
161
  }
151
162
  });
152
163
  }
@@ -162,6 +173,9 @@ var ModelResource = (_dec$4 = Model({ enableSelector: true }), _dec2$4 = BeanInf
162
173
  get apiSchemasUpdate() {
163
174
  return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, "patch");
164
175
  }
176
+ get apiSchemasDelete() {
177
+ return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, "delete");
178
+ }
165
179
  getFormSchema(formMeta) {
166
180
  const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);
167
181
  if (formScene === "view") return this.schemaView;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isNil","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","formMetaFromFormScene","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageEntrySchemaParams","object","resource","string","id","optional","formScene","ControllerPageEntry","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","formMeta","formProvider","formSchema","jsxZova","$$modelResource","$params","entryId","__init__","$computed","getFormSchema","_prepareJsx","getFormApiSchemas","sdk","bean","_newBeanSimple","components","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor","Virtual","Controller","ControllerPageEntry","ControllerPageEntrySchemaParams","ControllerPageEntryCreateSchemaParams","ControllerPageEntryCreate","_dec","_dec2","_dec3","__z_BeanInfo","module","_class","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageResourceSchemaParams","object","resource","string","ControllerPageResource","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","jsxZova","$$modelResource","$params","__init__","_prepareJsx","apiSchemasSelect","sdk","bean","_newBeanSimple","schemaRow","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor"],"sources":["../src/model/resource.ts","../src/page/entry/controller.tsx","../src/page/entryCreate/controller.tsx","../src/page/resource/controller.tsx","../src/.metadata/page/entry.ts","../src/.metadata/page/entryCreate.ts","../src/.metadata/page/resource.ts","../src/routes.ts","../src/.metadata/index.ts"],"sourcesContent":["var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { hashkey, isNil } from '@cabloy/utils';\nimport { UseScope } from 'zova';\nimport { formSceneFromFormMeta } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded, BeanModelBase, Model } from 'zova-module-a-model';\nimport { SymbolOpenapiSchemaName } from 'zova-module-a-openapi';\nexport let ModelResource = (_dec = Model({\n enableSelector: true\n}), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec3 = UseScope(\"a-openapi\"), _dec4 = Reflect.metadata(\"design:type\", typeof ScopeModuleAOpenapi === \"undefined\" ? Object : ScopeModuleAOpenapi), _dec(_class = _dec2(_class = (_class2 = class ModelResource extends BeanModelBase {\n constructor(...args) {\n super(...args);\n this.resource = void 0;\n this.resourceApi = void 0;\n this.permissions = void 0;\n this.formProvider = void 0;\n this.schemaView = void 0;\n this.schemaCreate = void 0;\n this.schemaUpdate = void 0;\n this.schemaFilter = void 0;\n this.schemaRow = void 0;\n this.schemaPages = void 0;\n _initializerDefineProperty(this, \"$$scopeOpenapi\", _descriptor, this);\n }\n async __init__(resource) {\n if (!resource) throw new Error('resource not specified');\n await super.__init__(resource);\n this.resource = resource;\n this.permissions = this.$computed(() => {\n if (this.$ssr.cookieDisabledOnServer) return;\n const permissions = this.$sdk.getPermissions(this.resource);\n return permissions.data;\n });\n this.formProvider = this.$computed(() => {\n return this.$$scopeOpenapi.config.formProvider;\n });\n this.schemaView = this.$computed(() => {\n return this.apiSchemasView.responseBody;\n });\n this.schemaCreate = this.$computed(() => {\n return this.apiSchemasCreate.requestBody;\n });\n this.schemaUpdate = this.$computed(() => {\n return this.apiSchemasUpdate.requestBody;\n });\n this.schemaFilter = this.$computed(() => {\n return this.apiSchemasSelect.filter;\n });\n this.schemaRow = this.$computed(() => {\n return this.apiSchemasSelect.row;\n });\n this.schemaPages = this.$computed(() => {\n return this.apiSchemasSelect.paged;\n });\n // bootstrap\n await this._bootstrap();\n }\n selectGeneral(actionPath, query) {\n return this.$useStateData({\n queryKey: this.keySelect(actionPath, query),\n queryFn: async () => {\n const apiPath = actionPath ? `${this.resourceApi}/${actionPath}` : this.resourceApi;\n return this.$fetch.get(this.sys.util.apiActionPathTranslate(apiPath), this.sys.util.apiActionConfigPrepare(undefined, {\n query\n }));\n }\n });\n }\n select(query) {\n return this.selectGeneral(undefined, query);\n }\n query(action, queryFn) {\n return this.$useStateData({\n queryKey: this.keySelect(action),\n queryFn\n });\n }\n queryItem(options) {\n const {\n id,\n action,\n queryFn,\n meta\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useStateData({\n queryKey: this.keyItem(id, action),\n queryFn,\n meta\n });\n }\n view(id) {\n return this.queryItem({\n id,\n action: 'view',\n queryFn: async () => {\n const res = await this.$fetch.get(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), this.sys.util.apiActionConfigPrepare());\n return res ?? null;\n }\n });\n }\n create() {\n return this.$useMutationData({\n mutationKey: ['create'],\n mutationFn: async params => {\n return this.$fetch.post(this.sys.util.apiActionPathTranslate(this.resourceApi), params, this.sys.util.apiActionConfigPrepare());\n },\n onSuccess: () => {\n this.$invalidateQueries({\n queryKey: ['select']\n });\n }\n });\n }\n mutationItem(options) {\n const {\n id,\n action,\n mutationFn,\n onSuccess,\n invalidateSelect = true\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useMutationData({\n mutationKey: [...this.keyItem(id, action), 'mutation'],\n mutationFn,\n onSuccess: async (data, variables, context) => {\n if (invalidateSelect) {\n this.$invalidateQueries({\n queryKey: ['select']\n });\n }\n this.$invalidateQueries({\n queryKey: this.keyItemRoot(id)\n });\n await onSuccess?.(data, variables, context);\n }\n });\n }\n update(id) {\n return this.mutationItem({\n id,\n action: 'update',\n mutationFn: async params => {\n return this.$fetch.patch(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), params, this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n delete(id) {\n return this.mutationItem({\n id,\n action: 'delete',\n mutationFn: async () => {\n return this.$fetch.delete(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n get apiSchemasSelect() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'get');\n }\n get apiSchemasView() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'get');\n }\n get apiSchemasCreate() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'post');\n }\n get apiSchemasUpdate() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'patch');\n }\n getFormSchema(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.schemaView;\n if (formScene === 'create') return this.schemaCreate;\n if (formScene === 'edit') return this.schemaUpdate;\n }\n getFormApiSchemas(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.apiSchemasView;\n if (formScene === 'create') return this.apiSchemasCreate;\n if (formScene === 'edit') return this.apiSchemasUpdate;\n throw new Error('invalid parameters');\n }\n getFormMutationSubmit(formMeta, id) {\n if (formMeta.formMode !== 'edit') return;\n if (formMeta.editMode === 'create') {\n return this.create();\n } else if (formMeta.editMode === 'update') {\n return this.update(id);\n }\n }\n getFormData(formMeta, id) {\n if (formMeta.formMode === 'edit' && formMeta.editMode === 'create') {\n return this.getQueryDataDefaultValue(this.schemaCreate);\n }\n if (isNil(id)) return undefined;\n return this.view(id).data;\n }\n getQueryDataDefaultValue(schemaName) {\n if (!schemaName) return;\n if (typeof schemaName === 'object') {\n schemaName = schemaName[SymbolOpenapiSchemaName];\n }\n return this.$sdk.getSchemaDefaultValue(schemaName);\n }\n keySelect(actionPath, query) {\n return ['select', actionPath ?? '', hashkey(query)];\n }\n keyItemRoot(id) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id];\n }\n keyItem(id, action) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id, action];\n }\n async _bootstrap() {\n const queryBootstrap = await $QueryEnsureLoaded(() => this.$sdk.getBootstrap(this.resource));\n if (!queryBootstrap?.data) {\n throw new Error(`not found sdk of resource: ${this.resource}`);\n }\n this.resourceApi = this.sys.util.parseResourceApi(this.resource, queryBootstrap.data.apiPath);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$scopeOpenapi\", [_dec3, _dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class);","import type {\n IFormMeta,\n IFormProvider,\n ISchemaObjectExtensionField,\n TypeFormScene,\n} from 'zova-module-a-openapi';\n\nimport { isNil } from '@cabloy/utils';\nimport { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { formMetaFromFormScene } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageEntrySchemaParams = z.object({\n resource: z.string(),\n id: z.string().optional(),\n formScene: z.string().optional(),\n});\n\n@Controller()\nexport class ControllerPageEntry extends BeanControllerPageBase {\n formMeta: IFormMeta;\n formProvider: IFormProvider;\n formSchema?: ISchemaObjectExtensionField;\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n get entryId() {\n return this.$params.id;\n }\n\n get formScene() {\n return (\n (this.$params.formScene as TypeFormScene | undefined) ??\n (isNil(this.entryId) ? 'create' : 'view')\n );\n }\n\n protected async __init__() {\n this.formMeta = this.$computed(() => {\n return formMetaFromFormScene(this.formScene);\n });\n this.formProvider = this.$computed(() => {\n return this.$$modelResource.formProvider;\n });\n this.formSchema = this.$computed(() => {\n return this.$$modelResource.getFormSchema(this.formMeta);\n });\n // jsx\n this._prepareJsx();\n // load schema\n await $QueryEnsureLoaded(() => this.$$modelResource.getFormApiSchemas(this.formMeta)?.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false, this.formProvider.components);\n }\n\n protected render() {\n const blocks = this.formSchema?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n id: this.entryId,\n formScene: this.formScene,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { Virtual } from 'zova-core';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { ControllerPageEntry, ControllerPageEntrySchemaParams } from '../entry/controller.jsx';\n\nexport const ControllerPageEntryCreateSchemaParams = ControllerPageEntrySchemaParams;\n\n@Controller()\n@Virtual()\nexport class ControllerPageEntryCreate extends ControllerPageEntry {}\n","import { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageResourceSchemaParams = z.object({\n resource: z.string(),\n});\n\n@Controller()\nexport class ControllerPageResource extends BeanControllerPageBase {\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n protected async __init__() {\n // jsx\n this._prepareJsx();\n // load schema/data\n await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);\n }\n\n get schemaRow() {\n return this.$$modelResource.schemaRow;\n }\n\n public render() {\n const blocks = this.schemaRow?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntry } from '../../page/entry/controller.jsx';\nimport { ControllerPageEntrySchemaParams } from '../../page/entry/controller.jsx';\nexport let NSControllerPageEntry;\n(function (_NSControllerPageEntry) {\n const paramsSchema = _NSControllerPageEntry.paramsSchema = ControllerPageEntrySchemaParams;\n})(NSControllerPageEntry || (NSControllerPageEntry = {}));\nexport const ZPageEntry = createZovaComponentPage(ControllerPageEntry, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntryCreate } from '../../page/entryCreate/controller.jsx';\nimport { ControllerPageEntryCreateSchemaParams } from '../../page/entryCreate/controller.jsx';\nexport let NSControllerPageEntryCreate;\n(function (_NSControllerPageEntryCreate) {\n const paramsSchema = _NSControllerPageEntryCreate.paramsSchema = ControllerPageEntryCreateSchemaParams;\n})(NSControllerPageEntryCreate || (NSControllerPageEntryCreate = {}));\nexport const ZPageEntryCreate = createZovaComponentPage(ControllerPageEntryCreate, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageResource } from '../../page/resource/controller.jsx';\nimport { ControllerPageResourceSchemaParams } from '../../page/resource/controller.jsx';\nexport let NSControllerPageResource;\n(function (_NSControllerPageResource) {\n const paramsSchema = _NSControllerPageResource.paramsSchema = ControllerPageResourceSchemaParams;\n})(NSControllerPageResource || (NSControllerPageResource = {}));\nexport const ZPageResource = createZovaComponentPage(ControllerPageResource, undefined, undefined);","import { ZPageEntry } from './.metadata/page/entry.js';\nimport { ZPageEntryCreate } from './.metadata/page/entryCreate.js';\nimport { ZPageResource } from './.metadata/page/resource.js';\nexport const routes = [{\n name: 'resource',\n path: ':resource',\n component: ZPageResource,\n meta: {\n tabKey,\n ssrProfile: 'session'\n }\n}, {\n name: 'entryCreate',\n path: ':resource/create',\n component: ZPageEntryCreate,\n meta: {\n tabKey,\n ssrProfile: 'session'\n }\n}, {\n name: 'entry',\n path: ':resource/:id/:formScene?',\n component: ZPageEntry,\n meta: {\n tabKey,\n ssrProfile: 'session'\n }\n}];\nfunction tabKey(route) {\n return `/rest/resource/${encodeURIComponent(route.params.resource)}`;\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/resource.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\nimport { ModelResource } from '../model/resource.js';\nimport 'zova';\n/** model: end */\n/** controller: begin */\nexport * from '../page/entry/controller.jsx';\nexport * from '../page/entryCreate/controller.jsx';\nexport * from '../page/resource/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\nimport { ControllerPageEntry } from '../page/entry/controller.jsx';\nimport { ControllerPageEntryCreate } from '../page/entryCreate/controller.jsx';\nimport { ControllerPageResource } from '../page/resource/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** pages: begin */\nexport * from './page/entry.js';\nimport { NSControllerPageEntry } from './page/entry.js';\nexport * from './page/entryCreate.js';\nimport { NSControllerPageEntryCreate } from './page/entryCreate.js';\nexport * from './page/resource.js';\nimport { NSControllerPageResource } from './page/resource.js';\nexport * from '../routes.js';\nimport 'zova';\nexport const pagePathSchemas = {};\nexport const pageNameSchemas = {\n 'rest-resource:entry': {\n params: NSControllerPageEntry.paramsSchema\n },\n 'rest-resource:entryCreate': {\n params: NSControllerPageEntryCreate.paramsSchema\n },\n 'rest-resource:resource': {\n params: NSControllerPageResource.paramsSchema\n }\n};\n/** pages: end */\n\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleRestResource = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec(_class = _dec2(_class = class ScopeModuleRestResource extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;;;;;;AAAA,IAAI,QAAM,SAAO,SAAO,SAAO,UAAQ,WAAS;AAChD,SAAS,2BAA2B,GAAG,GAAG,GAAG,GAAG;CAAE,KAAK,OAAO,eAAe,GAAG,GAAG;EAAE,YAAY,EAAE;EAAY,cAAc,EAAE;EAAc,UAAU,EAAE;EAAU,OAAO,EAAE,cAAc,EAAE,YAAY,KAAK,CAAC,IAAI,KAAK;CAAE,CAAC;AAAG;AAC7N,SAAS,4BAA0B,GAAG,GAAG,GAAG,GAAG,GAAG;CAAE,IAAI,IAAI,CAAC;CAAG,OAAO,OAA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Q;AACnE;;;;;AC9BA,IAAI,MAAM,OAAO;AAgCjB,IAAa,kBAAkB,CAAC;AAChC,IAAa,kBAAkB;CAC7B,uBAAuB,EACrB,QAAQ,sBAAsB,aAChC;CACA,6BAA6B,EAC3B,QAAQ,4BAA4B,aACtC;CACA,0BAA0B,EACxB,QAAQ,yBAAyB,aACnC;AACF;AAMA,IAAW,2BAA2B,OAAO,MAAM,GAAG,QAAQ,SAAa,EACzE,QAAQ,gBACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,gCAAgC,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
1
+ {"version":3,"file":"index.js","names":["isNil","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","formMetaFromFormScene","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageEntrySchemaParams","object","resource","string","id","optional","formScene","ControllerPageEntry","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","formMeta","formProvider","formSchema","jsxZova","$$modelResource","$params","entryId","__init__","$computed","getFormSchema","_prepareJsx","getFormApiSchemas","sdk","bean","_newBeanSimple","components","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor","Virtual","Controller","ControllerPageEntry","ControllerPageEntrySchemaParams","ControllerPageEntryCreateSchemaParams","ControllerPageEntryCreate","_dec","_dec2","_dec3","__z_BeanInfo","module","_class","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageResourceSchemaParams","object","resource","string","ControllerPageResource","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","jsxZova","$$modelResource","$params","__init__","_prepareJsx","apiSchemasSelect","sdk","bean","_newBeanSimple","schemaRow","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor"],"sources":["../src/lib/deleteRequest.ts","../src/model/resource.ts","../src/page/entry/controller.tsx","../src/page/entryCreate/controller.tsx","../src/page/resource/controller.tsx","../src/.metadata/page/entry.ts","../src/.metadata/page/entryCreate.ts","../src/.metadata/page/resource.ts","../src/routes.ts","../src/.metadata/index.ts"],"sourcesContent":["export function prepareDeleteRequestConfig(config, body) {\n if (body === undefined) return config;\n return {\n ...config,\n data: body\n };\n}","var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { hashkey, isNil } from '@cabloy/utils';\nimport { UseScope } from 'zova';\nimport { formSceneFromFormMeta } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded, BeanModelBase, Model } from 'zova-module-a-model';\nimport { SymbolOpenapiSchemaName } from 'zova-module-a-openapi';\nimport { prepareDeleteRequestConfig } from '../lib/deleteRequest.js';\nexport let ModelResource = (_dec = Model({\n enableSelector: true\n}), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec3 = UseScope(\"a-openapi\"), _dec4 = Reflect.metadata(\"design:type\", typeof ScopeModuleAOpenapi === \"undefined\" ? Object : ScopeModuleAOpenapi), _dec(_class = _dec2(_class = (_class2 = class ModelResource extends BeanModelBase {\n constructor(...args) {\n super(...args);\n this.resource = void 0;\n this.resourceApi = void 0;\n this.permissions = void 0;\n this.formProvider = void 0;\n this.schemaView = void 0;\n this.schemaCreate = void 0;\n this.schemaUpdate = void 0;\n this.schemaFilter = void 0;\n this.schemaRow = void 0;\n this.schemaPages = void 0;\n _initializerDefineProperty(this, \"$$scopeOpenapi\", _descriptor, this);\n }\n async __init__(resource) {\n if (!resource) throw new Error('resource not specified');\n await super.__init__(resource);\n this.resource = resource;\n this.permissions = this.$computed(() => {\n if (this.$ssr.cookieDisabledOnServer) return;\n const permissions = this.$sdk.getPermissions(this.resource);\n return permissions.data;\n });\n this.formProvider = this.$computed(() => {\n return this.$$scopeOpenapi.config.formProvider;\n });\n this.schemaView = this.$computed(() => {\n return this.apiSchemasView.responseBody;\n });\n this.schemaCreate = this.$computed(() => {\n return this.apiSchemasCreate.requestBody;\n });\n this.schemaUpdate = this.$computed(() => {\n return this.apiSchemasUpdate.requestBody;\n });\n this.schemaFilter = this.$computed(() => {\n return this.apiSchemasSelect.filter;\n });\n this.schemaRow = this.$computed(() => {\n return this.apiSchemasSelect.row;\n });\n this.schemaPages = this.$computed(() => {\n return this.apiSchemasSelect.paged;\n });\n // bootstrap\n await this._bootstrap();\n }\n selectGeneral(actionPath, query) {\n return this.$useStateData({\n queryKey: this.keySelect(actionPath, query),\n queryFn: async () => {\n const apiPath = actionPath ? `${this.resourceApi}/${actionPath}` : this.resourceApi;\n return this.$fetch.get(this.sys.util.apiActionPathTranslate(apiPath), this.sys.util.apiActionConfigPrepare(undefined, {\n query\n }));\n }\n });\n }\n select(query) {\n return this.selectGeneral(undefined, query);\n }\n query(action, queryFn) {\n return this.$useStateData({\n queryKey: this.keySelect(action),\n queryFn\n });\n }\n queryItem(options) {\n const {\n id,\n action,\n queryFn,\n meta\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useStateData({\n queryKey: this.keyItem(id, action),\n queryFn,\n meta\n });\n }\n view(id) {\n return this.queryItem({\n id,\n action: 'view',\n queryFn: async () => {\n const res = await this.$fetch.get(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), this.sys.util.apiActionConfigPrepare());\n return res ?? null;\n }\n });\n }\n create() {\n return this.$useMutationData({\n mutationKey: ['create'],\n mutationFn: async params => {\n return this.$fetch.post(this.sys.util.apiActionPathTranslate(this.resourceApi), params, this.sys.util.apiActionConfigPrepare());\n },\n onSuccess: () => {\n this.$invalidateQueries({\n queryKey: ['select']\n });\n }\n });\n }\n mutationItem(options) {\n const {\n id,\n action,\n mutationFn,\n onSuccess,\n invalidateSelect = true\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useMutationData({\n mutationKey: [...this.keyItem(id, action), 'mutation'],\n mutationFn,\n onSuccess: async (data, variables, context) => {\n if (invalidateSelect) {\n this.$invalidateQueries({\n queryKey: ['select']\n });\n }\n this.$invalidateQueries({\n queryKey: this.keyItemRoot(id)\n });\n await onSuccess?.(data, variables, context);\n }\n });\n }\n update(id) {\n return this.mutationItem({\n id,\n action: 'update',\n mutationFn: async params => {\n return this.$fetch.patch(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), params, this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n delete(id) {\n return this.mutationItem({\n id,\n action: 'delete',\n mutationFn: async body => {\n const apiPath = this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n });\n const apiConfig = prepareDeleteRequestConfig(this.sys.util.apiActionConfigPrepare(), body);\n return this.$fetch.delete(apiPath, apiConfig);\n }\n });\n }\n get apiSchemasSelect() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'get');\n }\n get apiSchemasView() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'get');\n }\n get apiSchemasCreate() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'post');\n }\n get apiSchemasUpdate() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'patch');\n }\n get apiSchemasDelete() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'delete');\n }\n getFormSchema(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.schemaView;\n if (formScene === 'create') return this.schemaCreate;\n if (formScene === 'edit') return this.schemaUpdate;\n }\n getFormApiSchemas(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.apiSchemasView;\n if (formScene === 'create') return this.apiSchemasCreate;\n if (formScene === 'edit') return this.apiSchemasUpdate;\n throw new Error('invalid parameters');\n }\n getFormMutationSubmit(formMeta, id) {\n if (formMeta.formMode !== 'edit') return;\n if (formMeta.editMode === 'create') {\n return this.create();\n } else if (formMeta.editMode === 'update') {\n return this.update(id);\n }\n }\n getFormData(formMeta, id) {\n if (formMeta.formMode === 'edit' && formMeta.editMode === 'create') {\n return this.getQueryDataDefaultValue(this.schemaCreate);\n }\n if (isNil(id)) return undefined;\n return this.view(id).data;\n }\n getQueryDataDefaultValue(schemaName) {\n if (!schemaName) return;\n if (typeof schemaName === 'object') {\n schemaName = schemaName[SymbolOpenapiSchemaName];\n }\n return this.$sdk.getSchemaDefaultValue(schemaName);\n }\n keySelect(actionPath, query) {\n return ['select', actionPath ?? '', hashkey(query)];\n }\n keyItemRoot(id) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id];\n }\n keyItem(id, action) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id, action];\n }\n async _bootstrap() {\n const queryBootstrap = await $QueryEnsureLoaded(() => this.$sdk.getBootstrap(this.resource));\n if (!queryBootstrap?.data) {\n throw new Error(`not found sdk of resource: ${this.resource}`);\n }\n this.resourceApi = this.sys.util.parseResourceApi(this.resource, queryBootstrap.data.apiPath);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$scopeOpenapi\", [_dec3, _dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class);","import type {\n IFormMeta,\n IFormProvider,\n ISchemaObjectExtensionField,\n TypeFormScene,\n} from 'zova-module-a-openapi';\n\nimport { isNil } from '@cabloy/utils';\nimport { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { formMetaFromFormScene } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageEntrySchemaParams = z.object({\n resource: z.string(),\n id: z.string().optional(),\n formScene: z.string().optional(),\n});\n\n@Controller()\nexport class ControllerPageEntry extends BeanControllerPageBase {\n formMeta: IFormMeta;\n formProvider: IFormProvider;\n formSchema?: ISchemaObjectExtensionField;\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n get entryId() {\n return this.$params.id;\n }\n\n get formScene() {\n return (\n (this.$params.formScene as TypeFormScene | undefined) ??\n (isNil(this.entryId) ? 'create' : 'view')\n );\n }\n\n protected async __init__() {\n this.formMeta = this.$computed(() => {\n return formMetaFromFormScene(this.formScene);\n });\n this.formProvider = this.$computed(() => {\n return this.$$modelResource.formProvider;\n });\n this.formSchema = this.$computed(() => {\n return this.$$modelResource.getFormSchema(this.formMeta);\n });\n // jsx\n this._prepareJsx();\n // load schema\n await $QueryEnsureLoaded(() => this.$$modelResource.getFormApiSchemas(this.formMeta)?.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false, this.formProvider.components);\n }\n\n protected render() {\n const blocks = this.formSchema?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n id: this.entryId,\n formScene: this.formScene,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { Virtual } from 'zova-core';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { ControllerPageEntry, ControllerPageEntrySchemaParams } from '../entry/controller.jsx';\n\nexport const ControllerPageEntryCreateSchemaParams = ControllerPageEntrySchemaParams;\n\n@Controller()\n@Virtual()\nexport class ControllerPageEntryCreate extends ControllerPageEntry {}\n","import { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageResourceSchemaParams = z.object({\n resource: z.string(),\n});\n\n@Controller()\nexport class ControllerPageResource extends BeanControllerPageBase {\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n protected async __init__() {\n // jsx\n this._prepareJsx();\n // load schema/data\n await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);\n }\n\n get schemaRow() {\n return this.$$modelResource.schemaRow;\n }\n\n public render() {\n const blocks = this.schemaRow?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntry } from '../../page/entry/controller.jsx';\nimport { ControllerPageEntrySchemaParams } from '../../page/entry/controller.jsx';\nexport let NSControllerPageEntry;\n(function (_NSControllerPageEntry) {\n const paramsSchema = _NSControllerPageEntry.paramsSchema = ControllerPageEntrySchemaParams;\n})(NSControllerPageEntry || (NSControllerPageEntry = {}));\nexport const ZPageEntry = createZovaComponentPage(ControllerPageEntry, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntryCreate } from '../../page/entryCreate/controller.jsx';\nimport { ControllerPageEntryCreateSchemaParams } from '../../page/entryCreate/controller.jsx';\nexport let NSControllerPageEntryCreate;\n(function (_NSControllerPageEntryCreate) {\n const paramsSchema = _NSControllerPageEntryCreate.paramsSchema = ControllerPageEntryCreateSchemaParams;\n})(NSControllerPageEntryCreate || (NSControllerPageEntryCreate = {}));\nexport const ZPageEntryCreate = createZovaComponentPage(ControllerPageEntryCreate, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageResource } from '../../page/resource/controller.jsx';\nimport { ControllerPageResourceSchemaParams } from '../../page/resource/controller.jsx';\nexport let NSControllerPageResource;\n(function (_NSControllerPageResource) {\n const paramsSchema = _NSControllerPageResource.paramsSchema = ControllerPageResourceSchemaParams;\n})(NSControllerPageResource || (NSControllerPageResource = {}));\nexport const ZPageResource = createZovaComponentPage(ControllerPageResource, undefined, undefined);","import { ZPageEntry } from './.metadata/page/entry.js';\nimport { ZPageEntryCreate } from './.metadata/page/entryCreate.js';\nimport { ZPageResource } from './.metadata/page/resource.js';\nexport const routes = [{\n name: 'resource',\n path: ':resource',\n component: ZPageResource,\n meta: {\n tabKey,\n ssrProfile: 'session'\n }\n}, {\n name: 'entryCreate',\n path: ':resource/create',\n component: ZPageEntryCreate,\n meta: {\n tabKey,\n ssrProfile: 'session'\n }\n}, {\n name: 'entry',\n path: ':resource/:id/:formScene?',\n component: ZPageEntry,\n meta: {\n tabKey,\n ssrProfile: 'session'\n }\n}];\nfunction tabKey(route) {\n return `/rest/resource/${encodeURIComponent(route.params.resource)}`;\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/resource.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\nimport { ModelResource } from '../model/resource.js';\nimport 'zova';\n/** model: end */\n/** controller: begin */\nexport * from '../page/entry/controller.jsx';\nexport * from '../page/entryCreate/controller.jsx';\nexport * from '../page/resource/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\nimport { ControllerPageEntry } from '../page/entry/controller.jsx';\nimport { ControllerPageEntryCreate } from '../page/entryCreate/controller.jsx';\nimport { ControllerPageResource } from '../page/resource/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** pages: begin */\nexport * from './page/entry.js';\nimport { NSControllerPageEntry } from './page/entry.js';\nexport * from './page/entryCreate.js';\nimport { NSControllerPageEntryCreate } from './page/entryCreate.js';\nexport * from './page/resource.js';\nimport { NSControllerPageResource } from './page/resource.js';\nexport * from '../routes.js';\nimport 'zova';\nexport const pagePathSchemas = {};\nexport const pageNameSchemas = {\n 'rest-resource:entry': {\n params: NSControllerPageEntry.paramsSchema\n },\n 'rest-resource:entryCreate': {\n params: NSControllerPageEntryCreate.paramsSchema\n },\n 'rest-resource:resource': {\n params: NSControllerPageResource.paramsSchema\n }\n};\n/** pages: end */\n\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleRestResource = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec(_class = _dec2(_class = class ScopeModuleRestResource extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;;;;;;AAAA,SAAgB,2BAA2B,QAAQ,MAAM;CACvD,IAAI,SAAS,KAAA,GAAW,OAAO;CAC/B,OAAO;EACL,GAAG;EACH,MAAM;CACR;AACF;;;ACNA,IAAI,QAAM,SAAO,SAAO,SAAO,UAAQ,WAAS;AAChD,SAAS,2BAA2B,GAAG,GAAG,GAAG,GAAG;CAAE,KAAK,OAAO,eAAe,GAAG,GAAG;EAAE,YAAY,EAAE;EAAY,cAAc,EAAE;EAAc,UAAU,EAAE;EAAU,OAAO,EAAE,cAAc,EAAE,YAAY,KAAK,CAAC,IAAI,KAAK;CAAE,CAAC;AAAG;AAC7N,SAAS,4BAA0B,GAAG,GAAG,GAAG,GAAG,GAAG;CAAE,IAAI,IAAI,CAAC;CAAG,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,SAAU,GAAG;EAAE,EAAE,KAAK,EAAE;CAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,EAAE,eAAe,WAAW,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,IAAI,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,SAAU,GAAG,GAAG;EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,KAAK;CAAG,GAAG,CAAC,GAAG,KAAK,KAAK,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,cAAc,KAAK,IAAI,KAAK,MAAM,EAAE,eAAe,OAAO,eAAe,GAA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AAK,MAAM,KAAK"}
@@ -0,0 +1,3 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ export declare function prepareDeleteRequestConfig<TBody>(config: AxiosRequestConfig<TBody>, body: TBody): AxiosRequestConfig<TBody>;
3
+ //# sourceMappingURL=deleteRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteRequest.d.ts","sourceRoot":"","sources":["../../src/lib/deleteRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEhD,wBAAgB,0BAA0B,CAAC,KAAK,EAC9C,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,EACjC,IAAI,EAAE,KAAK,GACV,kBAAkB,CAAC,KAAK,CAAC,CAM3B"}
@@ -21,7 +21,7 @@ interface IModelResourceMutationItemOptions<TData = void, TVariables = void> {
21
21
  onSuccess?: (data: TData, variables: TVariables, context: unknown) => void | Promise<void>;
22
22
  invalidateSelect?: boolean;
23
23
  }
24
- export declare class ModelResource<Entity = any, EntityCreate = Partial<Entity>, EntityUpdate = Partial<Entity>> extends BeanModelBase {
24
+ export declare class ModelResource<Entity = any, EntityCreate = Partial<Entity>, EntityUpdate = Partial<Entity>, EntityDelete = void> extends BeanModelBase {
25
25
  resource: string;
26
26
  resourceApi: string;
27
27
  permissions?: TypeOpenapiPermissions;
@@ -42,11 +42,12 @@ export declare class ModelResource<Entity = any, EntityCreate = Partial<Entity>,
42
42
  create(): import("vue").UnwrapNestedRefs<import("@tanstack/vue-query").UseMutationReturnType<void, Error, EntityCreate, unknown>>;
43
43
  mutationItem<TData = void, TVariables = void>(options: IModelResourceMutationItemOptions<TData, TVariables>): import("vue").UnwrapNestedRefs<import("@tanstack/vue-query").UseMutationReturnType<TData, Error, TVariables, unknown>>;
44
44
  update(id: TableIdentity): import("vue").UnwrapNestedRefs<import("@tanstack/vue-query").UseMutationReturnType<void, Error, EntityUpdate, unknown>>;
45
- delete(id: TableIdentity): import("vue").UnwrapNestedRefs<import("@tanstack/vue-query").UseMutationReturnType<void, Error, void, unknown>>;
45
+ delete(id: TableIdentity): import("vue").UnwrapNestedRefs<import("@tanstack/vue-query").UseMutationReturnType<void, Error, EntityDelete, unknown>>;
46
46
  get apiSchemasSelect(): import("zova-module-a-openapi").IOpenapiSchemas;
47
47
  get apiSchemasView(): import("zova-module-a-openapi").IOpenapiSchemas;
48
48
  get apiSchemasCreate(): import("zova-module-a-openapi").IOpenapiSchemas;
49
49
  get apiSchemasUpdate(): import("zova-module-a-openapi").IOpenapiSchemas;
50
+ get apiSchemasDelete(): import("zova-module-a-openapi").IOpenapiSchemas;
50
51
  getFormSchema(formMeta: IFormMeta): ISchemaObjectExtensionField | undefined;
51
52
  getFormApiSchemas(formMeta: IFormMeta): import("zova-module-a-openapi").IOpenapiSchemas;
52
53
  getFormMutationSubmit(formMeta: IFormMeta, id?: TableIdentity): DataMutation | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,2BAA2B,EAC3B,WAAW,EACX,SAAS,EACT,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAsB,aAAa,EAAS,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AAErF,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;CAAG;AAExE,UAAU,8BAA8B,CAAC,KAAK;IAC5C,EAAE,EAAE,aAAa,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,OAA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WAAW,CAChB,QAAQ,EAAE,SAAS,EACnB,EAAE,CAAC,EAAE,aAAa,GACjB,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS;IAQ5C,wBAAwB,CAAC,UAAU,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS;IAQ7F,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW;IAI5D,SAAS,CAAC,WAAW,CAAC,EAAE,EAAE,aAAa;IAKvC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM;YAKrC,UAAU;CAOzB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-module-rest-resource",
3
- "version": "5.1.44",
4
- "gitHead": "75a09e6a22891e958802ee649ed454db38f90c16",
3
+ "version": "5.1.45",
4
+ "gitHead": "eb85d771ef75776a439e56df3af8be6a3a36c1c2",
5
5
  "description": "",
6
6
  "keywords": [
7
7
  "Zova Module"
@@ -4,15 +4,15 @@ export * from '../model/resource.js';
4
4
  import { IModelOptionsResource } from '../model/resource.js';
5
5
  import 'zova-module-a-model';
6
6
  declare module 'zova-module-a-model' {
7
-
7
+
8
8
  export interface IModelRecord {
9
9
  'rest-resource:resource': IModelOptionsResource;
10
10
  }
11
11
 
12
-
12
+
13
13
  }
14
14
  declare module 'zova-module-rest-resource' {
15
-
15
+
16
16
  export interface ModelResource {
17
17
  /** @internal */
18
18
  get scope(): ScopeModuleRestResource;
@@ -22,7 +22,7 @@ declare module 'zova-module-rest-resource' {
22
22
  get $beanFullName(): 'rest-resource.model.resource';
23
23
  get $onionName(): 'rest-resource:resource';
24
24
  get $onionOptions(): IModelOptionsResource;
25
- }
25
+ }
26
26
  }
27
27
  /** model: end */
28
28
  /** model: begin */
@@ -41,11 +41,11 @@ export * from '../page/resource/controller.jsx';
41
41
 
42
42
  import 'zova';
43
43
  declare module 'zova' {
44
-
45
-
44
+
45
+
46
46
  }
47
47
  declare module 'zova-module-rest-resource' {
48
-
48
+
49
49
  export interface ControllerPageEntry {
50
50
  /** @internal */
51
51
  get scope(): ScopeModuleRestResource;
@@ -54,7 +54,7 @@ declare module 'zova-module-rest-resource' {
54
54
  export interface ControllerPageResource {
55
55
  /** @internal */
56
56
  get scope(): ScopeModuleRestResource;
57
- }
57
+ }
58
58
  }
59
59
  /** controller: end */
60
60
  /** controller: begin */
@@ -98,15 +98,15 @@ export const pagePathSchemas = {
98
98
  export const pageNameSchemas = {
99
99
  'rest-resource:entry': {
100
100
  params: NSControllerPageEntry.paramsSchema,
101
-
101
+
102
102
  },
103
103
  'rest-resource:entryCreate': {
104
104
  params: NSControllerPageEntryCreate.paramsSchema,
105
-
105
+
106
106
  },
107
107
  'rest-resource:resource': {
108
108
  params: NSControllerPageResource.paramsSchema,
109
-
109
+
110
110
  },
111
111
  };
112
112
  declare module 'zova-module-rest-resource' {
@@ -138,12 +138,12 @@ declare module 'zova' {
138
138
  export interface IBeanScopeRecord {
139
139
  'rest-resource': ScopeModuleRestResource;
140
140
  }
141
-
142
-
143
141
 
144
-
145
142
 
146
-
143
+
144
+
145
+
146
+
147
147
  }
148
148
 
149
149
  /** scope: end */
@@ -0,0 +1,12 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+
3
+ export function prepareDeleteRequestConfig<TBody>(
4
+ config: AxiosRequestConfig<TBody>,
5
+ body: TBody,
6
+ ): AxiosRequestConfig<TBody> {
7
+ if (body === undefined) return config;
8
+ return {
9
+ ...config,
10
+ data: body,
11
+ };
12
+ }
@@ -16,6 +16,8 @@ import { formSceneFromFormMeta } from 'zova-module-a-form';
16
16
  import { $QueryEnsureLoaded, BeanModelBase, Model } from 'zova-module-a-model';
17
17
  import { ScopeModuleAOpenapi, SymbolOpenapiSchemaName } from 'zova-module-a-openapi';
18
18
 
19
+ import { prepareDeleteRequestConfig } from '../lib/deleteRequest.js';
20
+
19
21
  export interface IModelOptionsResource extends IDecoratorModelOptions {}
20
22
 
21
23
  interface IModelResourceQueryItemOptions<TData> {
@@ -42,6 +44,7 @@ export class ModelResource<
42
44
  Entity = any,
43
45
  EntityCreate = Partial<Entity>,
44
46
  EntityUpdate = Partial<Entity>,
47
+ EntityDelete = void,
45
48
  > extends BeanModelBase {
46
49
  public resource: string;
47
50
  public resourceApi: string;
@@ -188,14 +191,13 @@ export class ModelResource<
188
191
  }
189
192
 
190
193
  delete(id: TableIdentity) {
191
- return this.mutationItem<void, void>({
194
+ return this.mutationItem<void, EntityDelete>({
192
195
  id,
193
196
  action: 'delete',
194
- mutationFn: async () => {
195
- return this.$fetch.delete<any, void, void>(
196
- this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id }),
197
- this.sys.util.apiActionConfigPrepare(),
198
- );
197
+ mutationFn: async body => {
198
+ const apiPath = this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id });
199
+ const apiConfig = prepareDeleteRequestConfig(this.sys.util.apiActionConfigPrepare(), body);
200
+ return this.$fetch.delete<any, void, EntityDelete>(apiPath, apiConfig);
199
201
  },
200
202
  });
201
203
  }
@@ -216,6 +218,10 @@ export class ModelResource<
216
218
  return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'patch');
217
219
  }
218
220
 
221
+ public get apiSchemasDelete() {
222
+ return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'delete');
223
+ }
224
+
219
225
  public getFormSchema(formMeta: IFormMeta) {
220
226
  const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);
221
227
  if (formScene === 'view') return this.schemaView;