@neutron.co.id/operasional-modules 0.0.1-beta.1

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/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ /* Copyright (C) 2021 PT Vortex Buana Edumedia - All Rights Reserved
2
+ * Unauthorized copying of this file, via any medium is strictly prohibited
3
+ * Proprietary and confidential
4
+ * Written by Bian Pratama <bian@vortex.so>, May 2021
5
+ */
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ const kit = require('@nuxt/kit');
4
+
5
+ kit.defineNuxtModule({
6
+ meta: {
7
+ /**
8
+ * Module identifier, will be used in Nuxt.
9
+ * @example '@neutron.co.id/plan-plan'
10
+ * @example '@neon.id/belajar-course'
11
+ * @example '@neutron.co.id/tempat-place'
12
+ */
13
+ name: "@neutron.co.id/operasional-personalia",
14
+ /**
15
+ * Module config key,
16
+ * will be used to set options in nuxt.config.ts.
17
+ * @example 'neu:plan:plan'
18
+ * @example 'neo:belajar:course'
19
+ * @example 'neu:tempat;place'
20
+ */
21
+ configKey: "neu:operasional:personalia",
22
+ compatibility: { nuxt: "^3.0.0" }
23
+ },
24
+ defaults: {},
25
+ setup() {
26
+ console.log("module:neu:operasional:personalia");
27
+ const { resolve } = kit.createResolver((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
28
+ const plugin = resolve("./plugin");
29
+ kit.addPlugin(plugin);
30
+ }
31
+ });
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,29 @@
1
+ import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
2
+
3
+ defineNuxtModule({
4
+ meta: {
5
+ /**
6
+ * Module identifier, will be used in Nuxt.
7
+ * @example '@neutron.co.id/plan-plan'
8
+ * @example '@neon.id/belajar-course'
9
+ * @example '@neutron.co.id/tempat-place'
10
+ */
11
+ name: "@neutron.co.id/operasional-personalia",
12
+ /**
13
+ * Module config key,
14
+ * will be used to set options in nuxt.config.ts.
15
+ * @example 'neu:plan:plan'
16
+ * @example 'neo:belajar:course'
17
+ * @example 'neu:tempat;place'
18
+ */
19
+ configKey: "neu:operasional:personalia",
20
+ compatibility: { nuxt: "^3.0.0" }
21
+ },
22
+ defaults: {},
23
+ setup() {
24
+ console.log("module:neu:operasional:personalia");
25
+ const { resolve } = createResolver(import.meta.url);
26
+ const plugin = resolve("./plugin");
27
+ addPlugin(plugin);
28
+ }
29
+ });
@@ -0,0 +1 @@
1
+ export * from './resources';
@@ -0,0 +1 @@
1
+ export * from "./resources/index.mjs";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@nuxt/schema").NuxtModule<{}>;
2
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { addPlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
2
+ export default defineNuxtModule({
3
+ meta: {
4
+ /**
5
+ * Module identifier, will be used in Nuxt.
6
+ * @example '@neutron.co.id/plan-plan'
7
+ * @example '@neon.id/belajar-course'
8
+ * @example '@neutron.co.id/tempat-place'
9
+ */
10
+ name: "@neutron.co.id/operasional-personalia",
11
+ /**
12
+ * Module config key,
13
+ * will be used to set options in nuxt.config.ts.
14
+ * @example 'neu:plan:plan'
15
+ * @example 'neo:belajar:course'
16
+ * @example 'neu:tempat;place'
17
+ */
18
+ configKey: "neu:operasional:personalia",
19
+ compatibility: { nuxt: "^3.0.0" }
20
+ },
21
+ defaults: {},
22
+ setup() {
23
+ console.log("module:neu:operasional:personalia");
24
+ const { resolve } = createResolver(import.meta.url);
25
+ const plugin = resolve("./plugin");
26
+ addPlugin(plugin);
27
+ }
28
+ });
@@ -0,0 +1,2 @@
1
+ import { Module } from '@neon.id/context';
2
+ export declare const PersonaliaModule: Module;
@@ -0,0 +1,9 @@
1
+ import { Module } from "@neon.id/context";
2
+ import { StaffResource } from "./resources/index.mjs";
3
+ export const PersonaliaModule = Module.define({
4
+ definition: "neu:operasional:personalia",
5
+ label: "Personalia",
6
+ path: "personalia",
7
+ icon: "solid:user",
8
+ resources: [StaffResource]
9
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { useModuleStore } from "@neon.id/context";
2
+ import { PersonaliaModule } from "./module.mjs";
3
+ import { defineNuxtPlugin, useRouter } from "#imports";
4
+ import { OfficePage } from "#components";
5
+ export default defineNuxtPlugin(() => {
6
+ console.log("plugin:personalia");
7
+ const store = useModuleStore();
8
+ const router = useRouter();
9
+ PersonaliaModule.register(store, router, OfficePage);
10
+ });
@@ -0,0 +1 @@
1
+ export * from './staff';
@@ -0,0 +1 @@
1
+ export * from "./staff/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from './staff.views';
2
+ export * from './staff.resource';
@@ -0,0 +1,2 @@
1
+ export * from "./staff.views.mjs";
2
+ export * from "./staff.resource.mjs";
@@ -0,0 +1,6 @@
1
+ export declare const StaffModel: import("@neon.id/model/build/types/model/model.types").Instance<"neu:personalia:staff", "name" | "nik" | "branch" | "branches" | "user" | "image" | "birthPlace" | "birthDate" | "note">;
2
+ export type TStaffModel = typeof StaffModel;
3
+ export declare const fragments: {
4
+ item: Schema.Staff;
5
+ detail: Schema.Staff;
6
+ };
@@ -0,0 +1,36 @@
1
+ import { models } from "@neutron.co.id/personalia-models";
2
+ export const StaffModel = models.StaffModel;
3
+ const item = {
4
+ id: 1,
5
+ display: 1,
6
+ flag: 1,
7
+ name: 1,
8
+ nik: 1,
9
+ birthDate: 1,
10
+ birthPlace: 1,
11
+ image: 1,
12
+ branch: {
13
+ name: 1
14
+ },
15
+ branches: {
16
+ name: 1
17
+ },
18
+ note: 1,
19
+ user: {
20
+ id: 1,
21
+ username: 1,
22
+ email: 1,
23
+ phone: 1,
24
+ roleIds: 1
25
+ }
26
+ };
27
+ const detail = {
28
+ ...item,
29
+ branchId: 1,
30
+ branchIds: 1,
31
+ userId: 1
32
+ };
33
+ export const fragments = {
34
+ item,
35
+ detail
36
+ };
@@ -0,0 +1,2 @@
1
+ import { Resource } from '@neon.id/context';
2
+ export declare const StaffResource: Resource<Schema.Staff, import("@neon.id/model/build/types/model/model.types").Instance<"neu:personalia:staff", "name" | "nik" | "branch" | "branches" | "user" | "image" | "birthPlace" | "birthDate" | "note">>;
@@ -0,0 +1,32 @@
1
+ import { Resource } from "@neon.id/context";
2
+ import { StaffCollectionView, StaffSingleView } from "./staff.views.mjs";
3
+ import { fragments, StaffModel } from "./staff.model.mjs";
4
+ export const StaffResource = Resource.define({
5
+ model: StaffModel,
6
+ collection: {
7
+ title: "Karyawan",
8
+ path: "staffs",
9
+ component: StaffCollectionView,
10
+ menu: true,
11
+ displays: ["table"]
12
+ },
13
+ single: {
14
+ path: "staff/:slug",
15
+ component: StaffSingleView
16
+ },
17
+ views: {
18
+ // collection: {
19
+ // path: 'staffs',
20
+ // label: 'Staffs',
21
+ // icon: 'door-open',
22
+ // menu: true,
23
+ // component: StaffCollectionView,
24
+ // },
25
+ // single: {
26
+ // path: 'staffs/:slug',
27
+ // component: StaffSingleView,
28
+ // },
29
+ },
30
+ fragments,
31
+ renders: {}
32
+ });
@@ -0,0 +1,6 @@
1
+ export declare const StaffCollectionView: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
+ [key: string]: any;
3
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
+ export declare const StaffSingleView: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
5
+ [key: string]: any;
6
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -0,0 +1,9 @@
1
+ import { ResourceUtil } from "@neon.id/office";
2
+ export const StaffCollectionView = ResourceUtil.createCollection({
3
+ definition: "neu:personalia:staff",
4
+ Collection: "StaffCollection"
5
+ });
6
+ export const StaffSingleView = ResourceUtil.createSingle({
7
+ definition: "neu:personalia:staff",
8
+ Single: "StaffSingle"
9
+ });
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@neutron.co.id/operasional-modules",
3
+ "version": "0.0.1-beta.1",
4
+ "description": "Modules of Neutron.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "contributors": [
7
+ "Bian Pratama <bian@prata.ma>"
8
+ ],
9
+ "sideEffects": true,
10
+ "exports": {
11
+ ".": {
12
+ "types": "./build/index.d.ts",
13
+ "import": "./build/index.mjs",
14
+ "require": "./build/index.cjs"
15
+ },
16
+ "./personalia": {
17
+ "types": "./build/personalia/index.d.ts",
18
+ "import": "./build/personalia/index.mjs"
19
+ }
20
+ },
21
+ "main": "build/index.cjs",
22
+ "module": "build/index.mjs",
23
+ "types": "build/index.d.ts",
24
+ "files": [
25
+ "build/**"
26
+ ],
27
+ "scripts": {
28
+ "build": "unbuild",
29
+ "generate:gql": "graphql-codegen --config codegen.ts",
30
+ "lint": "eslint src/ --ext .js,.ts"
31
+ },
32
+ "dependencies": {
33
+ "@neon.id/context": "0.15.0",
34
+ "@neon.id/office": "0.8.1",
35
+ "@neutron.co.id/personalia-models": "1.1.0",
36
+ "@nuxt/kit": "3.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@graphql-codegen/cli": "^2.16.4",
40
+ "@graphql-codegen/client-preset": "^1.2.6",
41
+ "@neon.id/types": "1.36.1",
42
+ "@types/eslint": "8.4.10",
43
+ "@types/node": "18.11.18",
44
+ "@types/prettier": "2.7.2",
45
+ "@vortex.so/eslint-plugin": "0.7.0",
46
+ "eslint": "8.32.0",
47
+ "prettier": "2.8.3",
48
+ "typescript": "4.9.4",
49
+ "unbuild": "1.1.1",
50
+ "vite": "4.0.4",
51
+ "vitest": "0.27.1"
52
+ },
53
+ "peerDependencies": {
54
+ "@neon.id/context": "^0.15.0",
55
+ "@neon.id/office": "^0.8.1",
56
+ "@neutron.co.id/personalia-models": "^1.1.0",
57
+ "@nuxt/kit": "^3.0.0"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "build": 1
63
+ }