@n8n/stores 1.1.0
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.md +88 -0
- package/LICENSE_EE.md +27 -0
- package/README.md +24 -0
- package/dist/chunk-4NAC3BDH.cjs +39 -0
- package/dist/chunk-4NAC3BDH.cjs.map +1 -0
- package/dist/chunk-GWOUPYDG.js +39 -0
- package/dist/chunk-GWOUPYDG.js.map +1 -0
- package/dist/constants.cjs +7 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +35 -0
- package/dist/constants.d.ts +35 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/useAgentRequestStore.cjs +156 -0
- package/dist/useAgentRequestStore.cjs.map +1 -0
- package/dist/useAgentRequestStore.d.cts +39 -0
- package/dist/useAgentRequestStore.d.ts +39 -0
- package/dist/useAgentRequestStore.js +156 -0
- package/dist/useAgentRequestStore.js.map +1 -0
- package/dist/useRootStore.cjs +163 -0
- package/dist/useRootStore.cjs.map +1 -0
- package/dist/useRootStore.d.cts +158 -0
- package/dist/useRootStore.d.ts +158 -0
- package/dist/useRootStore.js +163 -0
- package/dist/useRootStore.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as pinia from 'pinia';
|
|
2
|
+
import * as vue from 'vue';
|
|
3
|
+
|
|
4
|
+
type RootStoreState = {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
restEndpoint: string;
|
|
7
|
+
defaultLocale: string;
|
|
8
|
+
endpointForm: string;
|
|
9
|
+
endpointFormTest: string;
|
|
10
|
+
endpointFormWaiting: string;
|
|
11
|
+
endpointMcp: string;
|
|
12
|
+
endpointMcpTest: string;
|
|
13
|
+
endpointWebhook: string;
|
|
14
|
+
endpointWebhookTest: string;
|
|
15
|
+
endpointWebhookWaiting: string;
|
|
16
|
+
timezone: string;
|
|
17
|
+
executionTimeout: number;
|
|
18
|
+
maxExecutionTimeout: number;
|
|
19
|
+
versionCli: string;
|
|
20
|
+
oauthCallbackUrls: object;
|
|
21
|
+
n8nMetadata: {
|
|
22
|
+
[key: string]: string | number | undefined;
|
|
23
|
+
};
|
|
24
|
+
pushRef: string;
|
|
25
|
+
urlBaseWebhook: string;
|
|
26
|
+
urlBaseEditor: string;
|
|
27
|
+
instanceId: string;
|
|
28
|
+
binaryDataMode: 'default' | 'filesystem' | 's3';
|
|
29
|
+
};
|
|
30
|
+
declare const useRootStore: pinia.StoreDefinition<"root", Pick<{
|
|
31
|
+
baseUrl: vue.ComputedRef<string>;
|
|
32
|
+
formUrl: vue.ComputedRef<string>;
|
|
33
|
+
formTestUrl: vue.ComputedRef<string>;
|
|
34
|
+
formWaitingUrl: vue.ComputedRef<string>;
|
|
35
|
+
mcpUrl: vue.ComputedRef<string>;
|
|
36
|
+
mcpTestUrl: vue.ComputedRef<string>;
|
|
37
|
+
webhookUrl: vue.ComputedRef<string>;
|
|
38
|
+
webhookTestUrl: vue.ComputedRef<string>;
|
|
39
|
+
webhookWaitingUrl: vue.ComputedRef<string>;
|
|
40
|
+
restUrl: vue.ComputedRef<string>;
|
|
41
|
+
restApiContext: vue.ComputedRef<{
|
|
42
|
+
baseUrl: string;
|
|
43
|
+
pushRef: string;
|
|
44
|
+
}>;
|
|
45
|
+
urlBaseEditor: vue.ComputedRef<string>;
|
|
46
|
+
versionCli: vue.ComputedRef<string>;
|
|
47
|
+
instanceId: vue.ComputedRef<string>;
|
|
48
|
+
pushRef: vue.ComputedRef<string>;
|
|
49
|
+
defaultLocale: vue.ComputedRef<string>;
|
|
50
|
+
binaryDataMode: vue.ComputedRef<"default" | "filesystem" | "s3">;
|
|
51
|
+
OAuthCallbackUrls: vue.ComputedRef<object>;
|
|
52
|
+
executionTimeout: vue.ComputedRef<number>;
|
|
53
|
+
maxExecutionTimeout: vue.ComputedRef<number>;
|
|
54
|
+
timezone: vue.ComputedRef<string>;
|
|
55
|
+
setUrlBaseWebhook: (value: string) => void;
|
|
56
|
+
setUrlBaseEditor: (value: string) => void;
|
|
57
|
+
setEndpointForm: (value: string) => void;
|
|
58
|
+
setEndpointFormTest: (value: string) => void;
|
|
59
|
+
setEndpointFormWaiting: (value: string) => void;
|
|
60
|
+
setEndpointWebhook: (value: string) => void;
|
|
61
|
+
setEndpointWebhookTest: (value: string) => void;
|
|
62
|
+
setEndpointWebhookWaiting: (value: string) => void;
|
|
63
|
+
setTimezone: (value: string) => void;
|
|
64
|
+
setExecutionTimeout: (value: number) => void;
|
|
65
|
+
setMaxExecutionTimeout: (value: number) => void;
|
|
66
|
+
setVersionCli: (value: string) => void;
|
|
67
|
+
setInstanceId: (value: string) => void;
|
|
68
|
+
setOauthCallbackUrls: (value: RootStoreState["oauthCallbackUrls"]) => void;
|
|
69
|
+
setN8nMetadata: (value: RootStoreState["n8nMetadata"]) => void;
|
|
70
|
+
setDefaultLocale: (value: string) => void;
|
|
71
|
+
setBinaryDataMode: (value: RootStoreState["binaryDataMode"]) => void;
|
|
72
|
+
}, never>, Pick<{
|
|
73
|
+
baseUrl: vue.ComputedRef<string>;
|
|
74
|
+
formUrl: vue.ComputedRef<string>;
|
|
75
|
+
formTestUrl: vue.ComputedRef<string>;
|
|
76
|
+
formWaitingUrl: vue.ComputedRef<string>;
|
|
77
|
+
mcpUrl: vue.ComputedRef<string>;
|
|
78
|
+
mcpTestUrl: vue.ComputedRef<string>;
|
|
79
|
+
webhookUrl: vue.ComputedRef<string>;
|
|
80
|
+
webhookTestUrl: vue.ComputedRef<string>;
|
|
81
|
+
webhookWaitingUrl: vue.ComputedRef<string>;
|
|
82
|
+
restUrl: vue.ComputedRef<string>;
|
|
83
|
+
restApiContext: vue.ComputedRef<{
|
|
84
|
+
baseUrl: string;
|
|
85
|
+
pushRef: string;
|
|
86
|
+
}>;
|
|
87
|
+
urlBaseEditor: vue.ComputedRef<string>;
|
|
88
|
+
versionCli: vue.ComputedRef<string>;
|
|
89
|
+
instanceId: vue.ComputedRef<string>;
|
|
90
|
+
pushRef: vue.ComputedRef<string>;
|
|
91
|
+
defaultLocale: vue.ComputedRef<string>;
|
|
92
|
+
binaryDataMode: vue.ComputedRef<"default" | "filesystem" | "s3">;
|
|
93
|
+
OAuthCallbackUrls: vue.ComputedRef<object>;
|
|
94
|
+
executionTimeout: vue.ComputedRef<number>;
|
|
95
|
+
maxExecutionTimeout: vue.ComputedRef<number>;
|
|
96
|
+
timezone: vue.ComputedRef<string>;
|
|
97
|
+
setUrlBaseWebhook: (value: string) => void;
|
|
98
|
+
setUrlBaseEditor: (value: string) => void;
|
|
99
|
+
setEndpointForm: (value: string) => void;
|
|
100
|
+
setEndpointFormTest: (value: string) => void;
|
|
101
|
+
setEndpointFormWaiting: (value: string) => void;
|
|
102
|
+
setEndpointWebhook: (value: string) => void;
|
|
103
|
+
setEndpointWebhookTest: (value: string) => void;
|
|
104
|
+
setEndpointWebhookWaiting: (value: string) => void;
|
|
105
|
+
setTimezone: (value: string) => void;
|
|
106
|
+
setExecutionTimeout: (value: number) => void;
|
|
107
|
+
setMaxExecutionTimeout: (value: number) => void;
|
|
108
|
+
setVersionCli: (value: string) => void;
|
|
109
|
+
setInstanceId: (value: string) => void;
|
|
110
|
+
setOauthCallbackUrls: (value: RootStoreState["oauthCallbackUrls"]) => void;
|
|
111
|
+
setN8nMetadata: (value: RootStoreState["n8nMetadata"]) => void;
|
|
112
|
+
setDefaultLocale: (value: string) => void;
|
|
113
|
+
setBinaryDataMode: (value: RootStoreState["binaryDataMode"]) => void;
|
|
114
|
+
}, "baseUrl" | "defaultLocale" | "timezone" | "executionTimeout" | "maxExecutionTimeout" | "versionCli" | "pushRef" | "urlBaseEditor" | "instanceId" | "binaryDataMode" | "formUrl" | "formTestUrl" | "formWaitingUrl" | "mcpUrl" | "mcpTestUrl" | "webhookUrl" | "webhookTestUrl" | "webhookWaitingUrl" | "restUrl" | "restApiContext" | "OAuthCallbackUrls">, Pick<{
|
|
115
|
+
baseUrl: vue.ComputedRef<string>;
|
|
116
|
+
formUrl: vue.ComputedRef<string>;
|
|
117
|
+
formTestUrl: vue.ComputedRef<string>;
|
|
118
|
+
formWaitingUrl: vue.ComputedRef<string>;
|
|
119
|
+
mcpUrl: vue.ComputedRef<string>;
|
|
120
|
+
mcpTestUrl: vue.ComputedRef<string>;
|
|
121
|
+
webhookUrl: vue.ComputedRef<string>;
|
|
122
|
+
webhookTestUrl: vue.ComputedRef<string>;
|
|
123
|
+
webhookWaitingUrl: vue.ComputedRef<string>;
|
|
124
|
+
restUrl: vue.ComputedRef<string>;
|
|
125
|
+
restApiContext: vue.ComputedRef<{
|
|
126
|
+
baseUrl: string;
|
|
127
|
+
pushRef: string;
|
|
128
|
+
}>;
|
|
129
|
+
urlBaseEditor: vue.ComputedRef<string>;
|
|
130
|
+
versionCli: vue.ComputedRef<string>;
|
|
131
|
+
instanceId: vue.ComputedRef<string>;
|
|
132
|
+
pushRef: vue.ComputedRef<string>;
|
|
133
|
+
defaultLocale: vue.ComputedRef<string>;
|
|
134
|
+
binaryDataMode: vue.ComputedRef<"default" | "filesystem" | "s3">;
|
|
135
|
+
OAuthCallbackUrls: vue.ComputedRef<object>;
|
|
136
|
+
executionTimeout: vue.ComputedRef<number>;
|
|
137
|
+
maxExecutionTimeout: vue.ComputedRef<number>;
|
|
138
|
+
timezone: vue.ComputedRef<string>;
|
|
139
|
+
setUrlBaseWebhook: (value: string) => void;
|
|
140
|
+
setUrlBaseEditor: (value: string) => void;
|
|
141
|
+
setEndpointForm: (value: string) => void;
|
|
142
|
+
setEndpointFormTest: (value: string) => void;
|
|
143
|
+
setEndpointFormWaiting: (value: string) => void;
|
|
144
|
+
setEndpointWebhook: (value: string) => void;
|
|
145
|
+
setEndpointWebhookTest: (value: string) => void;
|
|
146
|
+
setEndpointWebhookWaiting: (value: string) => void;
|
|
147
|
+
setTimezone: (value: string) => void;
|
|
148
|
+
setExecutionTimeout: (value: number) => void;
|
|
149
|
+
setMaxExecutionTimeout: (value: number) => void;
|
|
150
|
+
setVersionCli: (value: string) => void;
|
|
151
|
+
setInstanceId: (value: string) => void;
|
|
152
|
+
setOauthCallbackUrls: (value: RootStoreState["oauthCallbackUrls"]) => void;
|
|
153
|
+
setN8nMetadata: (value: RootStoreState["n8nMetadata"]) => void;
|
|
154
|
+
setDefaultLocale: (value: string) => void;
|
|
155
|
+
setBinaryDataMode: (value: RootStoreState["binaryDataMode"]) => void;
|
|
156
|
+
}, "setUrlBaseWebhook" | "setUrlBaseEditor" | "setEndpointForm" | "setEndpointFormTest" | "setEndpointFormWaiting" | "setEndpointWebhook" | "setEndpointWebhookTest" | "setEndpointWebhookWaiting" | "setTimezone" | "setExecutionTimeout" | "setMaxExecutionTimeout" | "setVersionCli" | "setInstanceId" | "setOauthCallbackUrls" | "setN8nMetadata" | "setDefaultLocale" | "setBinaryDataMode">>;
|
|
157
|
+
|
|
158
|
+
export { type RootStoreState, useRootStore };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
STORES
|
|
3
|
+
} from "./chunk-GWOUPYDG.js";
|
|
4
|
+
|
|
5
|
+
// src/useRootStore.ts
|
|
6
|
+
import { randomString, setGlobalState } from "n8n-workflow";
|
|
7
|
+
import { defineStore } from "pinia";
|
|
8
|
+
import { computed, ref } from "vue";
|
|
9
|
+
var { VUE_APP_URL_BASE_API } = import.meta.env;
|
|
10
|
+
var useRootStore = defineStore(STORES.ROOT, () => {
|
|
11
|
+
const state = ref({
|
|
12
|
+
baseUrl: VUE_APP_URL_BASE_API ?? window.BASE_PATH,
|
|
13
|
+
restEndpoint: !window.REST_ENDPOINT || window.REST_ENDPOINT === "{{REST_ENDPOINT}}" ? "rest" : window.REST_ENDPOINT,
|
|
14
|
+
defaultLocale: "en",
|
|
15
|
+
endpointForm: "form",
|
|
16
|
+
endpointFormTest: "form-test",
|
|
17
|
+
endpointFormWaiting: "form-waiting",
|
|
18
|
+
endpointMcp: "mcp",
|
|
19
|
+
endpointMcpTest: "mcp-test",
|
|
20
|
+
endpointWebhook: "webhook",
|
|
21
|
+
endpointWebhookTest: "webhook-test",
|
|
22
|
+
endpointWebhookWaiting: "webhook-waiting",
|
|
23
|
+
timezone: "America/New_York",
|
|
24
|
+
executionTimeout: -1,
|
|
25
|
+
maxExecutionTimeout: Number.MAX_SAFE_INTEGER,
|
|
26
|
+
versionCli: "0.0.0",
|
|
27
|
+
oauthCallbackUrls: {},
|
|
28
|
+
n8nMetadata: {},
|
|
29
|
+
pushRef: randomString(10).toLowerCase(),
|
|
30
|
+
urlBaseWebhook: "http://localhost:5678/",
|
|
31
|
+
urlBaseEditor: "http://localhost:5678",
|
|
32
|
+
instanceId: "",
|
|
33
|
+
binaryDataMode: "default"
|
|
34
|
+
});
|
|
35
|
+
const baseUrl = computed(() => state.value.baseUrl);
|
|
36
|
+
const formUrl = computed(() => `${state.value.urlBaseWebhook}${state.value.endpointForm}`);
|
|
37
|
+
const formTestUrl = computed(() => `${state.value.urlBaseEditor}${state.value.endpointFormTest}`);
|
|
38
|
+
const formWaitingUrl = computed(
|
|
39
|
+
() => `${state.value.urlBaseEditor}${state.value.endpointFormWaiting}`
|
|
40
|
+
);
|
|
41
|
+
const webhookUrl = computed(() => `${state.value.urlBaseWebhook}${state.value.endpointWebhook}`);
|
|
42
|
+
const webhookTestUrl = computed(
|
|
43
|
+
() => `${state.value.urlBaseEditor}${state.value.endpointWebhookTest}`
|
|
44
|
+
);
|
|
45
|
+
const webhookWaitingUrl = computed(
|
|
46
|
+
() => `${state.value.urlBaseEditor}${state.value.endpointWebhookWaiting}`
|
|
47
|
+
);
|
|
48
|
+
const mcpUrl = computed(() => `${state.value.urlBaseWebhook}${state.value.endpointMcp}`);
|
|
49
|
+
const mcpTestUrl = computed(() => `${state.value.urlBaseEditor}${state.value.endpointMcpTest}`);
|
|
50
|
+
const pushRef = computed(() => state.value.pushRef);
|
|
51
|
+
const binaryDataMode = computed(() => state.value.binaryDataMode);
|
|
52
|
+
const defaultLocale = computed(() => state.value.defaultLocale);
|
|
53
|
+
const urlBaseEditor = computed(() => state.value.urlBaseEditor);
|
|
54
|
+
const instanceId = computed(() => state.value.instanceId);
|
|
55
|
+
const versionCli = computed(() => state.value.versionCli);
|
|
56
|
+
const OAuthCallbackUrls = computed(() => state.value.oauthCallbackUrls);
|
|
57
|
+
const restUrl = computed(() => `${state.value.baseUrl}${state.value.restEndpoint}`);
|
|
58
|
+
const executionTimeout = computed(() => state.value.executionTimeout);
|
|
59
|
+
const maxExecutionTimeout = computed(() => state.value.maxExecutionTimeout);
|
|
60
|
+
const timezone = computed(() => state.value.timezone);
|
|
61
|
+
const restApiContext = computed(() => ({
|
|
62
|
+
baseUrl: restUrl.value,
|
|
63
|
+
pushRef: state.value.pushRef
|
|
64
|
+
}));
|
|
65
|
+
const setUrlBaseWebhook = (value) => {
|
|
66
|
+
const url = value.endsWith("/") ? value : `${value}/`;
|
|
67
|
+
state.value.urlBaseWebhook = url;
|
|
68
|
+
};
|
|
69
|
+
const setUrlBaseEditor = (value) => {
|
|
70
|
+
const url = value.endsWith("/") ? value : `${value}/`;
|
|
71
|
+
state.value.urlBaseEditor = url;
|
|
72
|
+
};
|
|
73
|
+
const setEndpointForm = (value) => {
|
|
74
|
+
state.value.endpointForm = value;
|
|
75
|
+
};
|
|
76
|
+
const setEndpointFormTest = (value) => {
|
|
77
|
+
state.value.endpointFormTest = value;
|
|
78
|
+
};
|
|
79
|
+
const setEndpointFormWaiting = (value) => {
|
|
80
|
+
state.value.endpointFormWaiting = value;
|
|
81
|
+
};
|
|
82
|
+
const setEndpointWebhook = (value) => {
|
|
83
|
+
state.value.endpointWebhook = value;
|
|
84
|
+
};
|
|
85
|
+
const setEndpointWebhookTest = (value) => {
|
|
86
|
+
state.value.endpointWebhookTest = value;
|
|
87
|
+
};
|
|
88
|
+
const setEndpointWebhookWaiting = (value) => {
|
|
89
|
+
state.value.endpointWebhookWaiting = value;
|
|
90
|
+
};
|
|
91
|
+
const setTimezone = (value) => {
|
|
92
|
+
state.value.timezone = value;
|
|
93
|
+
setGlobalState({ defaultTimezone: value });
|
|
94
|
+
};
|
|
95
|
+
const setExecutionTimeout = (value) => {
|
|
96
|
+
state.value.executionTimeout = value;
|
|
97
|
+
};
|
|
98
|
+
const setMaxExecutionTimeout = (value) => {
|
|
99
|
+
state.value.maxExecutionTimeout = value;
|
|
100
|
+
};
|
|
101
|
+
const setVersionCli = (value) => {
|
|
102
|
+
state.value.versionCli = value;
|
|
103
|
+
};
|
|
104
|
+
const setInstanceId = (value) => {
|
|
105
|
+
state.value.instanceId = value;
|
|
106
|
+
};
|
|
107
|
+
const setOauthCallbackUrls = (value) => {
|
|
108
|
+
state.value.oauthCallbackUrls = value;
|
|
109
|
+
};
|
|
110
|
+
const setN8nMetadata = (value) => {
|
|
111
|
+
state.value.n8nMetadata = value;
|
|
112
|
+
};
|
|
113
|
+
const setDefaultLocale = (value) => {
|
|
114
|
+
state.value.defaultLocale = value;
|
|
115
|
+
};
|
|
116
|
+
const setBinaryDataMode = (value) => {
|
|
117
|
+
state.value.binaryDataMode = value;
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
baseUrl,
|
|
121
|
+
formUrl,
|
|
122
|
+
formTestUrl,
|
|
123
|
+
formWaitingUrl,
|
|
124
|
+
mcpUrl,
|
|
125
|
+
mcpTestUrl,
|
|
126
|
+
webhookUrl,
|
|
127
|
+
webhookTestUrl,
|
|
128
|
+
webhookWaitingUrl,
|
|
129
|
+
restUrl,
|
|
130
|
+
restApiContext,
|
|
131
|
+
urlBaseEditor,
|
|
132
|
+
versionCli,
|
|
133
|
+
instanceId,
|
|
134
|
+
pushRef,
|
|
135
|
+
defaultLocale,
|
|
136
|
+
binaryDataMode,
|
|
137
|
+
OAuthCallbackUrls,
|
|
138
|
+
executionTimeout,
|
|
139
|
+
maxExecutionTimeout,
|
|
140
|
+
timezone,
|
|
141
|
+
setUrlBaseWebhook,
|
|
142
|
+
setUrlBaseEditor,
|
|
143
|
+
setEndpointForm,
|
|
144
|
+
setEndpointFormTest,
|
|
145
|
+
setEndpointFormWaiting,
|
|
146
|
+
setEndpointWebhook,
|
|
147
|
+
setEndpointWebhookTest,
|
|
148
|
+
setEndpointWebhookWaiting,
|
|
149
|
+
setTimezone,
|
|
150
|
+
setExecutionTimeout,
|
|
151
|
+
setMaxExecutionTimeout,
|
|
152
|
+
setVersionCli,
|
|
153
|
+
setInstanceId,
|
|
154
|
+
setOauthCallbackUrls,
|
|
155
|
+
setN8nMetadata,
|
|
156
|
+
setDefaultLocale,
|
|
157
|
+
setBinaryDataMode
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
export {
|
|
161
|
+
useRootStore
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=useRootStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/useRootStore.ts"],"sourcesContent":["import { randomString, setGlobalState } from 'n8n-workflow';\nimport { defineStore } from 'pinia';\nimport { computed, ref } from 'vue';\n\nimport { STORES } from './constants';\n\nconst { VUE_APP_URL_BASE_API } = import.meta.env;\n\nexport type RootStoreState = {\n\tbaseUrl: string;\n\trestEndpoint: string;\n\tdefaultLocale: string;\n\tendpointForm: string;\n\tendpointFormTest: string;\n\tendpointFormWaiting: string;\n\tendpointMcp: string;\n\tendpointMcpTest: string;\n\tendpointWebhook: string;\n\tendpointWebhookTest: string;\n\tendpointWebhookWaiting: string;\n\ttimezone: string;\n\texecutionTimeout: number;\n\tmaxExecutionTimeout: number;\n\tversionCli: string;\n\toauthCallbackUrls: object;\n\tn8nMetadata: {\n\t\t[key: string]: string | number | undefined;\n\t};\n\tpushRef: string;\n\turlBaseWebhook: string;\n\turlBaseEditor: string;\n\tinstanceId: string;\n\tbinaryDataMode: 'default' | 'filesystem' | 's3';\n};\n\nexport const useRootStore = defineStore(STORES.ROOT, () => {\n\tconst state = ref<RootStoreState>({\n\t\tbaseUrl: VUE_APP_URL_BASE_API ?? window.BASE_PATH,\n\t\trestEndpoint:\n\t\t\t!window.REST_ENDPOINT || window.REST_ENDPOINT === '{{REST_ENDPOINT}}'\n\t\t\t\t? 'rest'\n\t\t\t\t: window.REST_ENDPOINT,\n\t\tdefaultLocale: 'en',\n\t\tendpointForm: 'form',\n\t\tendpointFormTest: 'form-test',\n\t\tendpointFormWaiting: 'form-waiting',\n\t\tendpointMcp: 'mcp',\n\t\tendpointMcpTest: 'mcp-test',\n\t\tendpointWebhook: 'webhook',\n\t\tendpointWebhookTest: 'webhook-test',\n\t\tendpointWebhookWaiting: 'webhook-waiting',\n\t\ttimezone: 'America/New_York',\n\t\texecutionTimeout: -1,\n\t\tmaxExecutionTimeout: Number.MAX_SAFE_INTEGER,\n\t\tversionCli: '0.0.0',\n\t\toauthCallbackUrls: {},\n\t\tn8nMetadata: {},\n\t\tpushRef: randomString(10).toLowerCase(),\n\t\turlBaseWebhook: 'http://localhost:5678/',\n\t\turlBaseEditor: 'http://localhost:5678',\n\t\tinstanceId: '',\n\t\tbinaryDataMode: 'default',\n\t});\n\n\t// ---------------------------------------------------------------------------\n\t// #region Computed\n\t// ---------------------------------------------------------------------------\n\n\tconst baseUrl = computed(() => state.value.baseUrl);\n\n\tconst formUrl = computed(() => `${state.value.urlBaseWebhook}${state.value.endpointForm}`);\n\n\tconst formTestUrl = computed(() => `${state.value.urlBaseEditor}${state.value.endpointFormTest}`);\n\n\tconst formWaitingUrl = computed(\n\t\t() => `${state.value.urlBaseEditor}${state.value.endpointFormWaiting}`,\n\t);\n\n\tconst webhookUrl = computed(() => `${state.value.urlBaseWebhook}${state.value.endpointWebhook}`);\n\n\tconst webhookTestUrl = computed(\n\t\t() => `${state.value.urlBaseEditor}${state.value.endpointWebhookTest}`,\n\t);\n\n\tconst webhookWaitingUrl = computed(\n\t\t() => `${state.value.urlBaseEditor}${state.value.endpointWebhookWaiting}`,\n\t);\n\n\tconst mcpUrl = computed(() => `${state.value.urlBaseWebhook}${state.value.endpointMcp}`);\n\n\tconst mcpTestUrl = computed(() => `${state.value.urlBaseEditor}${state.value.endpointMcpTest}`);\n\n\tconst pushRef = computed(() => state.value.pushRef);\n\n\tconst binaryDataMode = computed(() => state.value.binaryDataMode);\n\n\tconst defaultLocale = computed(() => state.value.defaultLocale);\n\n\tconst urlBaseEditor = computed(() => state.value.urlBaseEditor);\n\n\tconst instanceId = computed(() => state.value.instanceId);\n\n\tconst versionCli = computed(() => state.value.versionCli);\n\n\tconst OAuthCallbackUrls = computed(() => state.value.oauthCallbackUrls);\n\n\tconst restUrl = computed(() => `${state.value.baseUrl}${state.value.restEndpoint}`);\n\n\tconst executionTimeout = computed(() => state.value.executionTimeout);\n\n\tconst maxExecutionTimeout = computed(() => state.value.maxExecutionTimeout);\n\n\tconst timezone = computed(() => state.value.timezone);\n\n\tconst restApiContext = computed(() => ({\n\t\tbaseUrl: restUrl.value,\n\t\tpushRef: state.value.pushRef,\n\t}));\n\n\t// #endregion\n\n\t// ---------------------------------------------------------------------------\n\t// #region Methods\n\t// ---------------------------------------------------------------------------\n\n\tconst setUrlBaseWebhook = (value: string) => {\n\t\tconst url = value.endsWith('/') ? value : `${value}/`;\n\t\tstate.value.urlBaseWebhook = url;\n\t};\n\n\tconst setUrlBaseEditor = (value: string) => {\n\t\tconst url = value.endsWith('/') ? value : `${value}/`;\n\t\tstate.value.urlBaseEditor = url;\n\t};\n\n\tconst setEndpointForm = (value: string) => {\n\t\tstate.value.endpointForm = value;\n\t};\n\n\tconst setEndpointFormTest = (value: string) => {\n\t\tstate.value.endpointFormTest = value;\n\t};\n\n\tconst setEndpointFormWaiting = (value: string) => {\n\t\tstate.value.endpointFormWaiting = value;\n\t};\n\n\tconst setEndpointWebhook = (value: string) => {\n\t\tstate.value.endpointWebhook = value;\n\t};\n\n\tconst setEndpointWebhookTest = (value: string) => {\n\t\tstate.value.endpointWebhookTest = value;\n\t};\n\n\tconst setEndpointWebhookWaiting = (value: string) => {\n\t\tstate.value.endpointWebhookWaiting = value;\n\t};\n\n\tconst setTimezone = (value: string) => {\n\t\tstate.value.timezone = value;\n\t\tsetGlobalState({ defaultTimezone: value });\n\t};\n\n\tconst setExecutionTimeout = (value: number) => {\n\t\tstate.value.executionTimeout = value;\n\t};\n\n\tconst setMaxExecutionTimeout = (value: number) => {\n\t\tstate.value.maxExecutionTimeout = value;\n\t};\n\n\tconst setVersionCli = (value: string) => {\n\t\tstate.value.versionCli = value;\n\t};\n\n\tconst setInstanceId = (value: string) => {\n\t\tstate.value.instanceId = value;\n\t};\n\n\tconst setOauthCallbackUrls = (value: RootStoreState['oauthCallbackUrls']) => {\n\t\tstate.value.oauthCallbackUrls = value;\n\t};\n\n\tconst setN8nMetadata = (value: RootStoreState['n8nMetadata']) => {\n\t\tstate.value.n8nMetadata = value;\n\t};\n\n\tconst setDefaultLocale = (value: string) => {\n\t\tstate.value.defaultLocale = value;\n\t};\n\n\tconst setBinaryDataMode = (value: RootStoreState['binaryDataMode']) => {\n\t\tstate.value.binaryDataMode = value;\n\t};\n\n\t// #endregion\n\n\treturn {\n\t\tbaseUrl,\n\t\tformUrl,\n\t\tformTestUrl,\n\t\tformWaitingUrl,\n\t\tmcpUrl,\n\t\tmcpTestUrl,\n\t\twebhookUrl,\n\t\twebhookTestUrl,\n\t\twebhookWaitingUrl,\n\t\trestUrl,\n\t\trestApiContext,\n\t\turlBaseEditor,\n\t\tversionCli,\n\t\tinstanceId,\n\t\tpushRef,\n\t\tdefaultLocale,\n\t\tbinaryDataMode,\n\t\tOAuthCallbackUrls,\n\t\texecutionTimeout,\n\t\tmaxExecutionTimeout,\n\t\ttimezone,\n\t\tsetUrlBaseWebhook,\n\t\tsetUrlBaseEditor,\n\t\tsetEndpointForm,\n\t\tsetEndpointFormTest,\n\t\tsetEndpointFormWaiting,\n\t\tsetEndpointWebhook,\n\t\tsetEndpointWebhookTest,\n\t\tsetEndpointWebhookWaiting,\n\t\tsetTimezone,\n\t\tsetExecutionTimeout,\n\t\tsetMaxExecutionTimeout,\n\t\tsetVersionCli,\n\t\tsetInstanceId,\n\t\tsetOauthCallbackUrls,\n\t\tsetN8nMetadata,\n\t\tsetDefaultLocale,\n\t\tsetBinaryDataMode,\n\t};\n});\n"],"mappings":";;;;;AAAA,SAAS,cAAc,sBAAsB;AAC7C,SAAS,mBAAmB;AAC5B,SAAS,UAAU,WAAW;AAI9B,IAAM,EAAE,qBAAqB,IAAI,YAAY;AA6BtC,IAAM,eAAe,YAAY,OAAO,MAAM,MAAM;AAC1D,QAAM,QAAQ,IAAoB;AAAA,IACjC,SAAS,wBAAwB,OAAO;AAAA,IACxC,cACC,CAAC,OAAO,iBAAiB,OAAO,kBAAkB,sBAC/C,SACA,OAAO;AAAA,IACX,eAAe;AAAA,IACf,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,wBAAwB;AAAA,IACxB,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,qBAAqB,OAAO;AAAA,IAC5B,YAAY;AAAA,IACZ,mBAAmB,CAAC;AAAA,IACpB,aAAa,CAAC;AAAA,IACd,SAAS,aAAa,EAAE,EAAE,YAAY;AAAA,IACtC,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,gBAAgB;AAAA,EACjB,CAAC;AAMD,QAAM,UAAU,SAAS,MAAM,MAAM,MAAM,OAAO;AAElD,QAAM,UAAU,SAAS,MAAM,GAAG,MAAM,MAAM,cAAc,GAAG,MAAM,MAAM,YAAY,EAAE;AAEzF,QAAM,cAAc,SAAS,MAAM,GAAG,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,gBAAgB,EAAE;AAEhG,QAAM,iBAAiB;AAAA,IACtB,MAAM,GAAG,MAAM,MAAM,aAAa,GA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B,CAAC,UAAkB;AAC3C,UAAM,MAAM,gBAAgB;AAAA,EAC7B;AAEA,QAAM,oBAAoB,CAAC,UAA4C;AACtE,UAAM,MAAM,iBAAiB;AAAA,EAC9B;AAIA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,CAAC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@n8n/stores",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"LICENSE.md",
|
|
8
|
+
"LICENSE_EE.md"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/index.cjs",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./*": {
|
|
20
|
+
"types": "./dist/*.d.ts",
|
|
21
|
+
"import": "./dist/*.js",
|
|
22
|
+
"require": "./dist/*.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"n8n-workflow": "1.92.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
30
|
+
"@testing-library/user-event": "^14.6.1",
|
|
31
|
+
"@testing-library/vue": "^8.1.0",
|
|
32
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
33
|
+
"@vue/tsconfig": "^0.7.0",
|
|
34
|
+
"@vueuse/core": "^10.11.0",
|
|
35
|
+
"pinia": "^2.2.4",
|
|
36
|
+
"vue": "^3.5.13",
|
|
37
|
+
"tsup": "^8.4.0",
|
|
38
|
+
"typescript": "^5.8.2",
|
|
39
|
+
"vite": "^6.3.5",
|
|
40
|
+
"vitest": "^3.1.3",
|
|
41
|
+
"vue-tsc": "^2.2.8",
|
|
42
|
+
"@n8n/eslint-config": "0.0.1",
|
|
43
|
+
"@n8n/typescript-config": "1.2.0",
|
|
44
|
+
"@n8n/vitest-config": "1.2.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@vueuse/core": "^10.11.0",
|
|
48
|
+
"pinia": "^2.2.4",
|
|
49
|
+
"vue": "^3.5.13"
|
|
50
|
+
},
|
|
51
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
52
|
+
"homepage": "https://n8n.io",
|
|
53
|
+
"author": {
|
|
54
|
+
"name": "Jan Oberhauser",
|
|
55
|
+
"email": "jan@n8n.io"
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/n8n-io/n8n.git"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"dev": "vite",
|
|
63
|
+
"build": "pnpm run typecheck && tsup",
|
|
64
|
+
"preview": "vite preview",
|
|
65
|
+
"typecheck": "vue-tsc --noEmit",
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:dev": "vitest --silent=false",
|
|
68
|
+
"lint": "eslint src --ext .js,.ts,.vue --quiet",
|
|
69
|
+
"lintfix": "eslint src --ext .js,.ts,.vue --fix",
|
|
70
|
+
"format": "biome format --write . && prettier --write . --ignore-path ../../../../.prettierignore",
|
|
71
|
+
"format:check": "biome ci . && prettier --check . --ignore-path ../../../../.prettierignore"
|
|
72
|
+
}
|
|
73
|
+
}
|