@neutron.co.id/operasional-interfaces 1.16.1-beta.3 → 1.16.1-beta.4

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.
@@ -1,13 +1,22 @@
1
1
  import { useToastStore } from "@neon.id/interfaces";
2
- import { ref } from "vue";
2
+ import { computed, ref } from "vue";
3
3
  import { ofetch } from "ofetch";
4
4
  import Papa from "papaparse";
5
5
  import { useOperasionalOfficeStore } from "../office/index.mjs";
6
6
  import { useAuthStore } from "@neon.id/identitas-interfaces";
7
+ import { useAppStore } from "@neon.id/context";
7
8
  export function useImportShift() {
8
9
  const store = useOperasionalOfficeStore();
9
10
  const toast = useToastStore();
10
11
  const authStore = useAuthStore();
12
+ const appStore = useAppStore();
13
+ const officeAppUrl = computed(() => {
14
+ if (appStore.appEnv === "dev")
15
+ return "https://dev.api.office.pendidikan.neutron.neon.id";
16
+ if (appStore.appEnv === "prod")
17
+ return "https://dev.api.office.operasional.neutron.neon.id";
18
+ return "http://localhost:7020";
19
+ });
11
20
  const loadings = ref(/* @__PURE__ */ new Set());
12
21
  const isLoading = ref(false);
13
22
  return {
@@ -20,7 +29,7 @@ export function useImportShift() {
20
29
  isLoading.value = true;
21
30
  try {
22
31
  const response = await ofetch(
23
- `${store.officeApiUrl}/downloadTemplateShift`,
32
+ `${officeAppUrl.value}/downloadTemplateShift`,
24
33
  {
25
34
  method: "GET",
26
35
  headers: {
@@ -83,7 +92,7 @@ export function useImportShift() {
83
92
  try {
84
93
  isLoading.value = true;
85
94
  const response = await ofetch(
86
- `${store.officeApiUrl}/importDataShift`,
95
+ `${officeAppUrl.value}/importDataShift`,
87
96
  {
88
97
  method: "POST",
89
98
  headers: {
@@ -1,7 +1,7 @@
1
1
  export declare const useOperasionalOfficeStore: import("pinia").StoreDefinition<"neu:operasional:office:store", import("pinia")._UnwrapAll<Pick<{
2
- officeApiUrl: import("vue").Ref<string>;
2
+ officeApiUrl: import("vue").Ref<string | undefined>;
3
3
  }, "officeApiUrl">>, Pick<{
4
- officeApiUrl: import("vue").Ref<string>;
4
+ officeApiUrl: import("vue").Ref<string | undefined>;
5
5
  }, never>, Pick<{
6
- officeApiUrl: import("vue").Ref<string>;
6
+ officeApiUrl: import("vue").Ref<string | undefined>;
7
7
  }, never>>;
@@ -3,9 +3,7 @@ import { ref } from "vue";
3
3
  export const useOperasionalOfficeStore = defineStore(
4
4
  "neu:operasional:office:store",
5
5
  () => {
6
- const officeApiUrl = ref(
7
- process.env.APP_ENVIRONMENT === "prod" ? "https://api.office.operasional.neutron.neon.id" : process.env.APP_ENVIRONMENT === "dev" ? "https://dev.api.office.operasional.neutron.neon.id" : process.env.NEU_OPERASIONAL_OFFICE_API_URL
8
- );
6
+ const officeApiUrl = ref();
9
7
  return {
10
8
  officeApiUrl
11
9
  };
@@ -1,7 +1,7 @@
1
1
  export declare const useOperasionalOfficeStore: import("pinia").StoreDefinition<"neu:operasional:office:store", import("pinia")._UnwrapAll<Pick<{
2
- officeApiUrl: import("vue").Ref<string>;
2
+ officeApiUrl: import("vue").Ref<string | undefined>;
3
3
  }, "officeApiUrl">>, Pick<{
4
- officeApiUrl: import("vue").Ref<string>;
4
+ officeApiUrl: import("vue").Ref<string | undefined>;
5
5
  }, never>, Pick<{
6
- officeApiUrl: import("vue").Ref<string>;
6
+ officeApiUrl: import("vue").Ref<string | undefined>;
7
7
  }, never>>;
@@ -12776,18 +12776,24 @@ const Papa = /* @__PURE__ */ getDefaultExportFromCjs(papaparse_minExports);
12776
12776
  const useOperasionalOfficeStore = pinia.defineStore(
12777
12777
  "neu:operasional:office:store",
12778
12778
  () => {
12779
- const officeApiUrl = vue.ref(
12780
- process.env.APP_ENVIRONMENT === "prod" ? "https://api.office.operasional.neutron.neon.id" : process.env.APP_ENVIRONMENT === "dev" ? "https://dev.api.office.operasional.neutron.neon.id" : process.env.NEU_OPERASIONAL_OFFICE_API_URL
12781
- );
12779
+ const officeApiUrl = vue.ref();
12782
12780
  return {
12783
12781
  officeApiUrl
12784
12782
  };
12785
12783
  }
12786
12784
  );
12787
12785
  function useImportShift() {
12788
- const store = useOperasionalOfficeStore();
12786
+ useOperasionalOfficeStore();
12789
12787
  const toast = interfaces.useToastStore();
12790
12788
  const authStore = identitasInterfaces.useAuthStore();
12789
+ const appStore = context.useAppStore();
12790
+ const officeAppUrl = vue.computed(() => {
12791
+ if (appStore.appEnv === "dev")
12792
+ return "https://dev.api.office.pendidikan.neutron.neon.id";
12793
+ if (appStore.appEnv === "prod")
12794
+ return "https://dev.api.office.operasional.neutron.neon.id";
12795
+ return "http://localhost:7020";
12796
+ });
12791
12797
  const loadings = vue.ref(/* @__PURE__ */ new Set());
12792
12798
  const isLoading = vue.ref(false);
12793
12799
  return {
@@ -12800,7 +12806,7 @@ function useImportShift() {
12800
12806
  isLoading.value = true;
12801
12807
  try {
12802
12808
  const response = await ofetch(
12803
- `${store.officeApiUrl}/downloadTemplateShift`,
12809
+ `${officeAppUrl.value}/downloadTemplateShift`,
12804
12810
  {
12805
12811
  method: "GET",
12806
12812
  headers: {
@@ -12863,7 +12869,7 @@ function useImportShift() {
12863
12869
  try {
12864
12870
  isLoading.value = true;
12865
12871
  const response = await ofetch(
12866
- `${store.officeApiUrl}/importDataShift`,
12872
+ `${officeAppUrl.value}/importDataShift`,
12867
12873
  {
12868
12874
  method: "POST",
12869
12875
  headers: {
@@ -23,7 +23,7 @@ import "@neon.id/identitas-interfaces/fluffy.css";
23
23
  import { ComponentUtil } from "@neon.id/utils/component";
24
24
  import { OfficeInterfaces } from "@neon.id/context/helpers";
25
25
  import { useRouter, useRoute } from "vue-router";
26
- import { GraphUtil, useSingle, useCollection, NeonCollection, NeonSingle, NeonCollectionContext, usePermit, useApp, withCollection } from "@neon.id/context";
26
+ import { GraphUtil, useAppStore, useSingle, useCollection, NeonCollection, NeonSingle, NeonCollectionContext, usePermit, useApp, withCollection } from "@neon.id/context";
27
27
  import { defineStore, storeToRefs } from "pinia";
28
28
  import { models as models$2 } from "@neutron.co.id/sentral-models";
29
29
  import { useClientHandle } from "@urql/vue";
@@ -12757,18 +12757,24 @@ const Papa = /* @__PURE__ */ getDefaultExportFromCjs(papaparse_minExports);
12757
12757
  const useOperasionalOfficeStore = defineStore(
12758
12758
  "neu:operasional:office:store",
12759
12759
  () => {
12760
- const officeApiUrl = ref(
12761
- process.env.APP_ENVIRONMENT === "prod" ? "https://api.office.operasional.neutron.neon.id" : process.env.APP_ENVIRONMENT === "dev" ? "https://dev.api.office.operasional.neutron.neon.id" : process.env.NEU_OPERASIONAL_OFFICE_API_URL
12762
- );
12760
+ const officeApiUrl = ref();
12763
12761
  return {
12764
12762
  officeApiUrl
12765
12763
  };
12766
12764
  }
12767
12765
  );
12768
12766
  function useImportShift() {
12769
- const store = useOperasionalOfficeStore();
12767
+ useOperasionalOfficeStore();
12770
12768
  const toast = useToastStore();
12771
12769
  const authStore = useAuthStore();
12770
+ const appStore = useAppStore();
12771
+ const officeAppUrl = computed(() => {
12772
+ if (appStore.appEnv === "dev")
12773
+ return "https://dev.api.office.pendidikan.neutron.neon.id";
12774
+ if (appStore.appEnv === "prod")
12775
+ return "https://dev.api.office.operasional.neutron.neon.id";
12776
+ return "http://localhost:7020";
12777
+ });
12772
12778
  const loadings = ref(/* @__PURE__ */ new Set());
12773
12779
  const isLoading = ref(false);
12774
12780
  return {
@@ -12781,7 +12787,7 @@ function useImportShift() {
12781
12787
  isLoading.value = true;
12782
12788
  try {
12783
12789
  const response = await ofetch(
12784
- `${store.officeApiUrl}/downloadTemplateShift`,
12790
+ `${officeAppUrl.value}/downloadTemplateShift`,
12785
12791
  {
12786
12792
  method: "GET",
12787
12793
  headers: {
@@ -12844,7 +12850,7 @@ function useImportShift() {
12844
12850
  try {
12845
12851
  isLoading.value = true;
12846
12852
  const response = await ofetch(
12847
- `${store.officeApiUrl}/importDataShift`,
12853
+ `${officeAppUrl.value}/importDataShift`,
12848
12854
  {
12849
12855
  method: "POST",
12850
12856
  headers: {
package/build/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "1.16.1-beta.3",
7
+ "version": "1.16.1-beta.4",
8
8
  "builder": {
9
9
  "@neon.id/module-builder": "1.8.0",
10
10
  "unbuild": "2.0.0"
package/build/nuxt.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "1.16.1-beta.3",
7
+ "version": "1.16.1-beta.4",
8
8
  "builder": {
9
9
  "@neon.id/module-builder": "1.8.0",
10
10
  "unbuild": "2.0.0"
package/build/nuxt.mjs CHANGED
@@ -208,8 +208,8 @@ function setupConfig(options) {
208
208
  isDebug: false,
209
209
  isProd: env === "prod",
210
210
  mode: options.mode || "office",
211
- office: {}
212
- // officeApiUrl: process.env.NEU_OPERASIONAL_OFFICE_API_URL as string,
211
+ office: {},
212
+ officeApiUrl: process.env.NEU_OPERASIONAL_OFFICE_API_URL
213
213
  });
214
214
  const key = "neu:operasional:interfaces";
215
215
  nuxt.options.runtimeConfig[key] = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neutron.co.id/operasional-interfaces",
3
- "version": "1.16.1-beta.3",
3
+ "version": "1.16.1-beta.4",
4
4
  "description": "Interface library of Neutron Operasional.",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -164,5 +164,5 @@
164
164
  "publishConfig": {
165
165
  "access": "public"
166
166
  },
167
- "build": 173
167
+ "build": 174
168
168
  }