@lilaquadrat/design-core 0.2.1 → 0.3.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/README.md +76 -3
- package/html/index.server.html +1 -8
- package/package.json +54 -54
- package/src/client-entry.ts +8 -8
- package/src/components/partials/error.partial.vue +19 -19
- package/src/components/partials/main-components.partial.vue +75 -70
- package/src/components/partials/qrcode.partial.vue +8 -8
- package/src/functions/AuthProviderFactory.ts +30 -0
- package/src/functions/PaymenyProviderFactory.ts +11 -11
- package/src/functions/auth0.provider.ts +75 -0
- package/src/functions/keycloak.provider.ts +228 -0
- package/src/functions/lila-dom.ts +50 -50
- package/src/functions/shopify.provider.ts +176 -154
- package/src/functions/stripe.provider.ts +120 -108
- package/src/globals.d.ts +1 -2
- package/src/index.ts +9 -7
- package/src/interfaces/AuthCallbackResult.interface.ts +5 -0
- package/src/interfaces/AuthConfig.interface.ts +13 -0
- package/src/interfaces/AuthProvider.interface.ts +15 -0
- package/src/interfaces/FrontendConfig.interface.ts +11 -40
- package/src/interfaces/GenericEvents.interface.ts +1 -1
- package/src/interfaces/IdTokenExtended.interface.ts +13 -4
- package/src/interfaces/PaymentProvider.interface.ts +2 -2
- package/src/interfaces/RenderOptions.interface.ts +12 -0
- package/src/libs/ActionNotice.ts +125 -125
- package/src/libs/Models.class.ts +219 -221
- package/src/main.ts +41 -36
- package/src/mixins/createCookieString.ts +50 -36
- package/src/mixins/createModelDeclaration.ts +22 -19
- package/src/mixins/createRouter.ts +12 -12
- package/src/mixins/date.ts +4 -2
- package/src/mixins/formatSize.ts +5 -5
- package/src/mixins/getAnchor.ts +1 -1
- package/src/mixins/getRoutes.ts +13 -25
- package/src/mixins/hasSlotContent.ts +22 -16
- package/src/mixins/hooks.ts +101 -60
- package/src/mixins/loadComponents.ts +60 -58
- package/src/mixins/logger.ts +17 -13
- package/src/mixins/replaceVariables.ts +10 -8
- package/src/mixins/scroll.ts +61 -45
- package/src/models/Address.model.ts +7 -7
- package/src/models/Contact.model.ts +14 -14
- package/src/plugins/analytics.ts +198 -0
- package/src/plugins/auth.ts +74 -60
- package/src/plugins/currency.ts +10 -10
- package/src/plugins/events.ts +101 -97
- package/src/plugins/filters.ts +21 -18
- package/src/plugins/replacer.ts +7 -6
- package/src/plugins/signupFlow.ts +45 -43
- package/src/plugins/traceable.ts +28 -26
- package/src/plugins/translations.ts +9 -9
- package/src/plugins/youtube.ts +39 -34
- package/src/routes.ts +108 -108
- package/src/server-entry.ts +75 -77
- package/src/stores/calls.store.ts +14 -14
- package/src/stores/cart.store.ts +116 -107
- package/src/stores/content.store.ts +87 -45
- package/src/stores/editor.store.ts +16 -16
- package/src/stores/files.store.ts +72 -72
- package/src/stores/main.store.ts +155 -109
- package/src/stores/user.store.ts +72 -68
- package/src/translations/de.ts +127 -127
- package/src/views/content.view.vue +81 -143
- package/src/views/download.view.vue +25 -23
- package/src/views/editor.view.vue +150 -125
- package/src/views/login.view.vue +35 -36
- package/src/views/signup-account.view.vue +14 -14
- package/tooling/cypress/config.ts +68 -54
- package/tooling/cypress/manifest-utils.mjs +34 -22
- package/tooling/cypress/run-parallel.mjs +41 -35
- package/tooling/cypress/support/commands.ts +458 -300
- package/tooling/eslint.config.js +1 -223
- package/tooling/preview.plugin.js +132 -0
- package/tooling/ssr-test/index.mjs +205 -203
- package/tooling/vite.d.ts +36 -0
- package/tooling/vite.js +234 -0
- package/src/interfaces/EditorConfiguration.interface.ts +0 -15
- package/tooling/preview.plugin.ts +0 -134
- package/tooling/stylelint.config.mjs +0 -24
- package/tooling/vite.ts +0 -260
|
@@ -5,177 +5,189 @@ import StudioSDK from '@lilaquadrat/sdk';
|
|
|
5
5
|
|
|
6
6
|
export default class StripePaymentProvider implements PaymentProvider {
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
async getCart(attributes: Record<string, string>): Promise<{ id: string; attributes: Record<string, string> }> {
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const { apiConfig } = useMainStore();
|
|
11
|
+
const sdk = new StudioSDK(apiConfig)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
console.log('StripePaymentProvider.getCart', attributes);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const cart = await sdk.public.carts.create({attributes});
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
return { id: cart.data._id, attributes: attributes || {} };
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
async updateCartAttributes(cartId: string, attributes?: Record<string, string>, customer?: { prename?: string, name?: string }): Promise<any> {
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const { apiConfig } = useMainStore();
|
|
24
|
+
const sdk = new StudioSDK(apiConfig)
|
|
25
|
+
const { products } = useCartStore();
|
|
26
|
+
const updateCart: {items?: {_id: string, quantity: number}[], attributes: Record<string, string>, prename?: string, name?: string} = {
|
|
27
|
+
items: [],
|
|
28
|
+
attributes: {}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
products.forEach((item: any) => {
|
|
32
|
+
|
|
33
|
+
updateCart.items?.push({_id: item._id, quantity: item.quantity});
|
|
34
|
+
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if(attributes) {
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
Object.keys(attributes).forEach((attribute) => {
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
updateCart.attributes[attribute] = attributes[attribute];
|
|
42
|
+
|
|
43
|
+
})
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
}
|
|
36
46
|
|
|
37
|
-
|
|
47
|
+
if(customer?.prename) updateCart.prename = customer.prename;
|
|
48
|
+
if(customer?.name) updateCart.name = customer.name;
|
|
38
49
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const updatedCart = await sdk.public.carts.update(cartId, updateCart);
|
|
51
|
+
|
|
52
|
+
console.log('StripePaymentProvider.updateCartAttributes', updateCart);
|
|
53
|
+
return Promise.resolve(updatedCart);
|
|
42
54
|
|
|
43
55
|
}
|
|
44
56
|
|
|
45
|
-
|
|
57
|
+
async getCartWithProducts(cartId: string) {
|
|
46
58
|
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
const { apiConfig } = useMainStore();
|
|
60
|
+
const sdk = new StudioSDK(apiConfig)
|
|
49
61
|
|
|
50
|
-
|
|
62
|
+
console.log('StripePaymentProvider.getCartWithProducts');
|
|
51
63
|
|
|
52
|
-
|
|
64
|
+
const cart = await sdk.public.carts.getById(cartId);
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
const sdk = new StudioSDK(apiConfig)
|
|
66
|
+
if(!cart.data) throw new Error('NO_CART_FOUND');
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
return cart.data;
|
|
69
|
+
|
|
70
|
+
}
|
|
58
71
|
|
|
59
|
-
|
|
72
|
+
async getProduct(productId: string): Promise<any> {
|
|
60
73
|
|
|
61
|
-
|
|
74
|
+
console.log('StripePaymentProvider.getProduct', productId);
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
const { apiConfig } = useMainStore();
|
|
77
|
+
const sdk = new StudioSDK(apiConfig)
|
|
78
|
+
const product = await sdk.public.carts.getProduct(productId);
|
|
65
79
|
|
|
66
|
-
|
|
80
|
+
return product.data;
|
|
81
|
+
|
|
82
|
+
}
|
|
67
83
|
|
|
68
|
-
|
|
84
|
+
async addToCart(cartId: string, product: any, amount: number): Promise<any> {
|
|
69
85
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
const { apiConfig } = useMainStore();
|
|
87
|
+
const sdk = new StudioSDK(apiConfig)
|
|
88
|
+
const { products } = useCartStore();
|
|
89
|
+
const updateCart: {items?: {_id: string, quantity: number}[]} = {
|
|
90
|
+
items: [],
|
|
91
|
+
};
|
|
73
92
|
|
|
74
|
-
|
|
75
|
-
}
|
|
93
|
+
console.log('StripePaymentProvider.addToCart', cartId, product, amount);
|
|
76
94
|
|
|
77
|
-
|
|
95
|
+
const itemInCart = products.find((item: any) => item._id === product._id);
|
|
78
96
|
|
|
79
|
-
|
|
80
|
-
const sdk = new StudioSDK(apiConfig)
|
|
81
|
-
const { products } = useCartStore();
|
|
82
|
-
const updateCart: {items?: {_id: string, quantity: number}[]} = {
|
|
83
|
-
items: [],
|
|
84
|
-
};
|
|
97
|
+
if(itemInCart) {
|
|
85
98
|
|
|
86
|
-
|
|
99
|
+
itemInCart.quantity = itemInCart.quantity + amount;
|
|
87
100
|
|
|
88
|
-
|
|
101
|
+
} else {
|
|
89
102
|
|
|
90
|
-
|
|
103
|
+
updateCart.items?.push({
|
|
104
|
+
_id: product._id,
|
|
105
|
+
quantity: amount
|
|
106
|
+
});
|
|
91
107
|
|
|
92
|
-
|
|
108
|
+
}
|
|
93
109
|
|
|
94
|
-
|
|
110
|
+
products.forEach((item: any) => {
|
|
95
111
|
|
|
96
|
-
|
|
97
|
-
_id : product._id,
|
|
98
|
-
quantity: amount
|
|
99
|
-
});
|
|
112
|
+
updateCart.items?.push({_id: item._id, quantity: item.quantity});
|
|
100
113
|
|
|
101
|
-
|
|
114
|
+
});
|
|
102
115
|
|
|
103
|
-
|
|
116
|
+
const updatedCart = await sdk.public.carts.update(cartId, updateCart);
|
|
117
|
+
const addedItem = updatedCart.data.items.find((item: any) => item.id === product.id);
|
|
104
118
|
|
|
105
|
-
|
|
119
|
+
return addedItem
|
|
106
120
|
|
|
107
|
-
}
|
|
121
|
+
}
|
|
108
122
|
|
|
109
|
-
|
|
110
|
-
const addedItem = updatedCart.data.items.find((item: any) => item.id === product.id);
|
|
123
|
+
async removeFromCart(cartId: string, product: any): Promise<any> {
|
|
111
124
|
|
|
112
|
-
|
|
125
|
+
const { apiConfig } = useMainStore();
|
|
126
|
+
const sdk = new StudioSDK(apiConfig)
|
|
127
|
+
const { products } = useCartStore();
|
|
128
|
+
const updateCart: {items?: {_id: string, quantity: number}[]} = {
|
|
129
|
+
items: []
|
|
130
|
+
};
|
|
113
131
|
|
|
114
|
-
|
|
132
|
+
products.forEach((item) => {
|
|
115
133
|
|
|
116
|
-
|
|
134
|
+
if(item._id === product._id) return;
|
|
135
|
+
updateCart.items?.push({_id: item._id, quantity: item.quantity});
|
|
117
136
|
|
|
118
|
-
|
|
119
|
-
const sdk = new StudioSDK(apiConfig)
|
|
120
|
-
const { products } = useCartStore();
|
|
121
|
-
const updateCart: {items?: {_id: string, quantity: number}[]} = {
|
|
122
|
-
items: []
|
|
123
|
-
};
|
|
137
|
+
});
|
|
124
138
|
|
|
125
|
-
|
|
139
|
+
if(updateCart.items?.length === 0) {
|
|
126
140
|
|
|
127
|
-
|
|
128
|
-
|
|
141
|
+
delete updateCart.items;
|
|
142
|
+
|
|
143
|
+
}
|
|
129
144
|
|
|
130
|
-
|
|
145
|
+
await sdk.public.carts.update(cartId, updateCart);
|
|
131
146
|
|
|
132
|
-
if(updateCart.items?.length === 0) {
|
|
133
|
-
delete updateCart.items;
|
|
134
147
|
}
|
|
135
148
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
149
|
+
async updateQuantity(cartId: string, cartProduct: any, amount: number): Promise<any> {
|
|
139
150
|
|
|
140
|
-
|
|
151
|
+
const { apiConfig } = useMainStore();
|
|
152
|
+
const sdk = new StudioSDK(apiConfig)
|
|
153
|
+
const { products } = useCartStore();
|
|
154
|
+
const updateCart: {items?: {_id: string, quantity: number}[]} = {
|
|
155
|
+
items: []
|
|
156
|
+
};
|
|
157
|
+
const itemInCart = products.find((item) => item._id === cartProduct._id);
|
|
141
158
|
|
|
142
|
-
|
|
143
|
-
const sdk = new StudioSDK(apiConfig)
|
|
144
|
-
const { products } = useCartStore();
|
|
145
|
-
const updateCart: {items?: {_id: string, quantity: number}[]} = {
|
|
146
|
-
items: []
|
|
147
|
-
};
|
|
148
|
-
const itemInCart = products.find((item) => item._id === cartProduct._id);
|
|
159
|
+
itemInCart.quantity = amount;
|
|
149
160
|
|
|
150
|
-
|
|
161
|
+
products.forEach((item) => {
|
|
151
162
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
163
|
+
updateCart.items?.push({_id: item._id, quantity: item.quantity});
|
|
164
|
+
|
|
165
|
+
});
|
|
155
166
|
|
|
156
|
-
|
|
167
|
+
await sdk.public.carts.update(cartId, updateCart);
|
|
157
168
|
|
|
158
|
-
|
|
169
|
+
}
|
|
159
170
|
|
|
160
|
-
|
|
171
|
+
async finalize(cartId: string): Promise<{checkoutUrl: string}> {
|
|
161
172
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
const { apiConfig } = useMainStore();
|
|
174
|
+
const sdk = new StudioSDK(apiConfig)
|
|
175
|
+
const repsonse = await sdk.public.carts.finalize(cartId);
|
|
165
176
|
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
return repsonse.data;
|
|
178
|
+
|
|
179
|
+
}
|
|
168
180
|
|
|
169
|
-
|
|
181
|
+
async getFinishedCart(cartId: string): Promise<any> {
|
|
170
182
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
183
|
+
const { apiConfig } = useMainStore();
|
|
184
|
+
const sdk = new StudioSDK(apiConfig)
|
|
185
|
+
const cart = await sdk.public.carts.getFinishedById(cartId);
|
|
174
186
|
|
|
175
|
-
|
|
187
|
+
if(!cart.data) throw new Error('NO_CART_FOUND');
|
|
176
188
|
|
|
177
|
-
|
|
189
|
+
return cart.data;
|
|
178
190
|
|
|
179
|
-
|
|
191
|
+
}
|
|
180
192
|
|
|
181
193
|
}
|
package/src/globals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StateTree } from 'pinia';
|
|
2
|
-
import type
|
|
2
|
+
import type CoreFrontendConfig from './interfaces/FrontendConfig.interface';
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
|
|
@@ -8,7 +8,6 @@ declare global {
|
|
|
8
8
|
__INITIAL_STATE__?: Record<string, StateTree>
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const __FRONTEND_CONFIG__: FrontendConfigInterface;
|
|
12
11
|
const __TARGET__: string;
|
|
13
12
|
/**
|
|
14
13
|
* true only in the shareable static gallery build (yarn build:preview)
|
package/src/index.ts
CHANGED
|
@@ -27,21 +27,23 @@ export { smartScrollBehavior } from './mixins/scroll';
|
|
|
27
27
|
|
|
28
28
|
// component registries
|
|
29
29
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
loadViaGlob,
|
|
31
|
+
loadViaDeclaration,
|
|
32
|
+
loadViaDeclarationSync,
|
|
33
|
+
getAvailableModules,
|
|
34
|
+
createModulesArray,
|
|
35
35
|
} from './mixins/loadComponents';
|
|
36
36
|
|
|
37
37
|
// i18n
|
|
38
38
|
export { default as i18n, t, addMessages } from './plugins/translations';
|
|
39
39
|
|
|
40
40
|
// framework contracts
|
|
41
|
-
export type { default as FrontendConfig } from './interfaces/FrontendConfig.interface';
|
|
41
|
+
export type { default as CoreFrontendConfig, default as FrontendConfig } from './interfaces/FrontendConfig.interface';
|
|
42
42
|
export type { default as ModuleBaseProps } from './interfaces/ModuleBaseProps.interface';
|
|
43
43
|
export type { default as IconsPartial } from './interfaces/IconsPartial';
|
|
44
|
-
export type { default as EditorConfiguration } from './interfaces/EditorConfiguration.interface';
|
|
45
44
|
export type { default as PaymentProvider } from './interfaces/PaymentProvider.interface';
|
|
45
|
+
export type { default as AuthConfig } from './interfaces/AuthConfig.interface';
|
|
46
|
+
export type { default as AuthProvider } from './interfaces/AuthProvider.interface';
|
|
47
|
+
export type { default as AuthCallbackResult } from './interfaces/AuthCallbackResult.interface';
|
|
46
48
|
|
|
47
49
|
export { default as logger } from './mixins/logger';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Auth0ClientOptions } from '@auth0/auth0-spa-js';
|
|
2
|
+
import type { EnvironmentAuthKeycloak } from '@lilaquadrat/interfaces';
|
|
3
|
+
|
|
4
|
+
export type AuthConfig = {
|
|
5
|
+
type: 'auth0'
|
|
6
|
+
options: Auth0ClientOptions
|
|
7
|
+
} | (EnvironmentAuthKeycloak & {
|
|
8
|
+
redirectUri?: string
|
|
9
|
+
silentCheckSsoRedirectUri?: string
|
|
10
|
+
scope?: string
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type { AuthConfig as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type AppState from './AppState.interface';
|
|
2
|
+
import type AuthCallbackResult from './AuthCallbackResult.interface';
|
|
3
|
+
import type IdTokenExtended from './IdTokenExtended.interface';
|
|
4
|
+
|
|
5
|
+
export default interface AuthProvider {
|
|
6
|
+
init(): Promise<void>
|
|
7
|
+
isAuthenticated(): Promise<boolean>
|
|
8
|
+
getToken(): Promise<string | undefined>
|
|
9
|
+
refreshToken(): Promise<string | undefined>
|
|
10
|
+
getTokenContent(): Promise<IdTokenExtended | undefined>
|
|
11
|
+
triggerLogin(appState: AppState): Promise<void>
|
|
12
|
+
triggerSignup(appState: AppState): Promise<void>
|
|
13
|
+
triggerLogout(): Promise<void>
|
|
14
|
+
handleCallback(): Promise<AuthCallbackResult>
|
|
15
|
+
}
|
|
@@ -1,42 +1,13 @@
|
|
|
1
|
+
import type { Environment, Project } from '@lilaquadrat/interfaces';
|
|
1
2
|
import type { Auth0ClientOptions } from '@auth0/auth0-spa-js';
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type AuthConfig from './AuthConfig.interface';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* the frontend runtime configuration: the project record merged with the
|
|
7
|
+
* environment it is rendered in.
|
|
8
|
+
*/
|
|
9
|
+
export default interface CoreFrontendConfig extends Project, Omit<Environment, 'id' | 'auth'> {
|
|
10
|
+
auth?: AuthConfig
|
|
11
|
+
/** Existing rendered applications may still supply Auth0 client options. */
|
|
6
12
|
auth0Options?: Auth0ClientOptions
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* for identification at the backend
|
|
10
|
-
*/
|
|
11
|
-
name: string
|
|
12
|
-
|
|
13
|
-
company: string
|
|
14
|
-
project: string
|
|
15
|
-
|
|
16
|
-
api: {
|
|
17
|
-
mode: StudioSDK['mode']
|
|
18
|
-
customEndpoints?: StudioSDK['customEndpoints']
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
cdn: {
|
|
22
|
-
public: string
|
|
23
|
-
secure: string
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
payment?: {
|
|
27
|
-
type?: 'internal' | 'shopify' | 'stripe',
|
|
28
|
-
options?: Record<string, string>
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* base path for loading files
|
|
33
|
-
*/
|
|
34
|
-
base?: string
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* indicates that this project is dynamic. e.g. an app or an website with at least one dynamic part.
|
|
38
|
-
* only an explicit `true` enables dynamic mode - `false` and `undefined` fall back to static
|
|
39
|
-
*/
|
|
40
|
-
dynamic?: boolean
|
|
41
|
-
|
|
42
|
-
}
|
|
13
|
+
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default interface IdTokenExtended {
|
|
2
|
+
[claim: string]: unknown
|
|
3
|
+
sub?: string
|
|
4
|
+
email?: string
|
|
5
|
+
email_verified?: boolean
|
|
6
|
+
name?: string
|
|
7
|
+
given_name?: string
|
|
8
|
+
family_name?: string
|
|
9
|
+
picture?: string
|
|
10
|
+
iss?: string
|
|
11
|
+
aud?: string | string[]
|
|
12
|
+
exp?: number
|
|
13
|
+
iat?: number
|
|
4
14
|
lilaquadrat_configuration?: boolean
|
|
5
15
|
lilaquadrat_firstLogin?: boolean
|
|
6
16
|
}
|
|
7
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default interface PaymentProvider {
|
|
2
2
|
|
|
3
3
|
getCart(attributes?: Record<string, string>): Promise<{id: string, checkourUrl?: string}>;
|
|
4
|
-
updateCartAttributes(cartId: string, attributes?: Record<string, string
|
|
5
|
-
getCartWithProducts(cartId: string): Promise<any
|
|
4
|
+
updateCartAttributes(cartId: string, attributes?: Record<string, string>, customer?: { prename?: string, name?: string }): Promise<{id: string, checkourUrl?: string}>;
|
|
5
|
+
getCartWithProducts(cartId: string): Promise<any>;
|
|
6
6
|
getProduct(productId: string): Promise<any>;
|
|
7
7
|
addToCart(cartId: string, product: any, amount: number): Promise<any>;
|
|
8
8
|
removeFromCart(cartId: string, product: any): Promise<any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RenderContext } from '@lilaquadrat/interfaces';
|
|
2
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
3
|
+
import type { AppComponents } from '../main';
|
|
4
|
+
|
|
5
|
+
export default interface RenderOptions {
|
|
6
|
+
url: string
|
|
7
|
+
context: RenderContext
|
|
8
|
+
manifest: Record<string, string[]>
|
|
9
|
+
cdnUrl: string
|
|
10
|
+
components: AppComponents
|
|
11
|
+
routes?: readonly RouteRecordRaw[]
|
|
12
|
+
}
|