@unchainedshop/api 3.0.0-rc8 → 3.0.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/lib/api-index.d.ts +3 -2
- package/lib/api-index.d.ts.map +1 -1
- package/lib/api-index.js +3 -2
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +16 -21
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +2 -2
- package/lib/context.js.map +1 -1
- package/lib/errors.d.ts +1 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -0
- package/lib/errors.js.map +1 -1
- package/lib/express/createBulkImportMiddleware.d.ts.map +1 -1
- package/lib/express/createBulkImportMiddleware.js +3 -3
- package/lib/express/createBulkImportMiddleware.js.map +1 -1
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +9 -8
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/index.d.ts +2 -0
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +11 -2
- package/lib/express/index.js.map +1 -1
- package/lib/fastify/ercMetadataHandler.d.ts.map +1 -1
- package/lib/fastify/ercMetadataHandler.js +2 -1
- package/lib/fastify/ercMetadataHandler.js.map +1 -1
- package/lib/fastify/index.d.ts +4 -1
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +47 -15
- package/lib/fastify/index.js.map +1 -1
- package/lib/loaders/index.d.ts +103 -59
- package/lib/loaders/index.d.ts.map +1 -1
- package/lib/loaders/index.js +173 -111
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +1 -6
- package/lib/locale-context.d.ts.map +1 -1
- package/lib/locale-context.js +2 -4
- package/lib/locale-context.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts +4 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts +4 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.d.ts +9 -0
- package/lib/resolvers/mutations/accounts/impersonate.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/impersonate.js +17 -0
- package/lib/resolvers/mutations/accounts/impersonate.js.map +1 -0
- package/lib/resolvers/mutations/accounts/loginAsGuest.js +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.js +12 -43
- package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.d.ts +6 -0
- package/lib/resolvers/mutations/accounts/stopImpersonation.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/stopImpersonation.js +14 -0
- package/lib/resolvers/mutations/accounts/stopImpersonation.js.map +1 -0
- package/lib/resolvers/mutations/accounts/verifyEmail.js +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.js +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.js.map +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.d.ts +1 -3
- package/lib/resolvers/mutations/countries/updateCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.js +1 -5
- package/lib/resolvers/mutations/countries/updateCountry.js.map +1 -1
- package/lib/resolvers/mutations/index.d.ts +2 -0
- package/lib/resolvers/mutations/index.d.ts.map +1 -1
- package/lib/resolvers/mutations/index.js +5 -1
- package/lib/resolvers/mutations/index.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/addPushSubscription.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/addPushSubscription.js +2 -1
- package/lib/resolvers/mutations/users/addPushSubscription.js.map +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/heartbeat.js +2 -2
- package/lib/resolvers/mutations/users/heartbeat.js.map +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.js +2 -1
- package/lib/resolvers/mutations/users/removePushSubscription.js.map +1 -1
- package/lib/resolvers/queries/index.d.ts +3 -0
- package/lib/resolvers/queries/index.d.ts.map +1 -1
- package/lib/resolvers/queries/index.js +4 -0
- package/lib/resolvers/queries/index.js.map +1 -1
- package/lib/resolvers/queries/users/impersonator.d.ts +3 -0
- package/lib/resolvers/queries/users/impersonator.d.ts.map +1 -0
- package/lib/resolvers/queries/users/impersonator.js +8 -0
- package/lib/resolvers/queries/users/impersonator.js.map +1 -0
- package/lib/resolvers/queries/users/validateResetPasswordToken.js +2 -2
- package/lib/resolvers/queries/users/validateResetPasswordToken.js.map +1 -1
- package/lib/resolvers/queries/warehousing/tokens.d.ts +2 -1
- package/lib/resolvers/queries/warehousing/tokens.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/tokens.js +2 -2
- package/lib/resolvers/queries/warehousing/tokens.js.map +1 -1
- package/lib/resolvers/queries/warehousing/tokensCount.d.ts +5 -0
- package/lib/resolvers/queries/warehousing/tokensCount.d.ts.map +1 -0
- package/lib/resolvers/queries/warehousing/tokensCount.js +6 -0
- package/lib/resolvers/queries/warehousing/tokensCount.js.map +1 -0
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +7 -9
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.js +9 -7
- package/lib/resolvers/type/assortment/assortment-path-link-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.js +9 -2
- package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
- package/lib/resolvers/type/index.d.ts +14 -8
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.js +9 -2
- package/lib/resolvers/type/product/product-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.js +4 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.js +5 -2
- package/lib/resolvers/type/product/product-variation-types.js.map +1 -1
- package/lib/roles/all.d.ts.map +1 -1
- package/lib/roles/all.js +2 -0
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +2 -0
- package/lib/roles/index.js.map +1 -1
- package/lib/schema/mutation.d.ts.map +1 -1
- package/lib/schema/mutation.js +10 -0
- package/lib/schema/mutation.js.map +1 -1
- package/lib/schema/query.d.ts.map +1 -1
- package/lib/schema/query.js +11 -1
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/types/user.js +1 -1
- package/package.json +20 -20
- package/src/api-index.ts +5 -4
- package/src/context.ts +31 -17
- package/src/errors.ts +5 -0
- package/src/express/createBulkImportMiddleware.ts +3 -3
- package/src/express/createERCMetadataMiddleware.ts +10 -8
- package/src/express/index.ts +29 -13
- package/src/fastify/ercMetadataHandler.ts +3 -1
- package/src/fastify/index.ts +67 -23
- package/src/loaders/index.ts +273 -228
- package/src/locale-context.ts +1 -10
- package/src/resolvers/mutations/accounts/createUser.ts +1 -1
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.ts +1 -1
- package/src/resolvers/mutations/accounts/impersonate.ts +23 -0
- package/src/resolvers/mutations/accounts/loginAsGuest.ts +1 -1
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +1 -1
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +1 -1
- package/src/resolvers/mutations/accounts/resetPassword.ts +13 -46
- package/src/resolvers/mutations/accounts/stopImpersonation.ts +19 -0
- package/src/resolvers/mutations/accounts/verifyEmail.ts +1 -1
- package/src/resolvers/mutations/assortments/removeAssortmentProduct.ts +1 -1
- package/src/resolvers/mutations/countries/updateCountry.ts +2 -7
- package/src/resolvers/mutations/index.ts +6 -1
- package/src/resolvers/mutations/users/addPushSubscription.ts +2 -1
- package/src/resolvers/mutations/users/heartbeat.ts +2 -2
- package/src/resolvers/mutations/users/removePushSubscription.ts +3 -1
- package/src/resolvers/queries/index.ts +4 -0
- package/src/resolvers/queries/users/impersonator.ts +13 -0
- package/src/resolvers/queries/users/validateResetPasswordToken.ts +2 -2
- package/src/resolvers/queries/warehousing/tokens.ts +3 -1
- package/src/resolvers/queries/warehousing/tokensCount.ts +12 -0
- package/src/resolvers/type/assortment/assortment-path-link-types.ts +14 -19
- package/src/resolvers/type/assortment/assortment-types.ts +17 -5
- package/src/resolvers/type/product/product-types.ts +17 -5
- package/src/resolvers/type/product/product-variation-assignment-vector.ts +4 -1
- package/src/resolvers/type/product/product-variation-types.ts +5 -2
- package/src/roles/all.ts +2 -0
- package/src/roles/index.ts +2 -0
- package/src/schema/mutation.ts +10 -0
- package/src/schema/query.ts +11 -1
- package/src/schema/types/user.ts +1 -1
- package/lib/resolvers/type/dispatch-types.d.ts +0 -15
- package/lib/resolvers/type/dispatch-types.d.ts.map +0 -1
- package/lib/resolvers/type/dispatch-types.js +0 -13
- package/lib/resolvers/type/dispatch-types.js.map +0 -1
- package/lib/resolvers/type/stock-types.d.ts +0 -14
- package/lib/resolvers/type/stock-types.d.ts.map +0 -1
- package/lib/resolvers/type/stock-types.js +0 -12
- package/lib/resolvers/type/stock-types.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { log } from '@unchainedshop/logger';
|
|
2
|
+
import { ImpersonatingAdminUserError, UserNotFoundError } from '../../../errors.js';
|
|
3
|
+
import { Context } from '../../../context.js';
|
|
4
|
+
|
|
5
|
+
const impersonate = async (root, { userId }, context: Context) => {
|
|
6
|
+
log(`mutation impersonate ${userId}`, { userId: context.userId });
|
|
7
|
+
|
|
8
|
+
const userToImpersonate = await context.modules.users.findUserById(userId);
|
|
9
|
+
|
|
10
|
+
if (!userToImpersonate) {
|
|
11
|
+
throw new UserNotFoundError({ userId });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if ((userToImpersonate.roles || []).includes('admin')) {
|
|
15
|
+
throw new ImpersonatingAdminUserError({ impersonatedUserId: userId, userId: context.userId });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return context.login(userToImpersonate, {
|
|
19
|
+
impersonator: context.user,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default impersonate;
|
|
@@ -22,7 +22,7 @@ export default async function loginAsGuest(root: never, _: any, context: Context
|
|
|
22
22
|
user = await context.modules.users.updateHeartbeat(user._id, {
|
|
23
23
|
remoteAddress: context.remoteAddress,
|
|
24
24
|
remotePort: context.remotePort,
|
|
25
|
-
userAgent: context.
|
|
25
|
+
userAgent: context.getHeader('user-agent'),
|
|
26
26
|
locale: context.localeContext.baseName,
|
|
27
27
|
countryCode: context.countryContext,
|
|
28
28
|
});
|
|
@@ -35,7 +35,7 @@ export default async function loginWithPassword(
|
|
|
35
35
|
user = await context.modules.users.updateHeartbeat(user._id, {
|
|
36
36
|
remoteAddress: context.remoteAddress,
|
|
37
37
|
remotePort: context.remotePort,
|
|
38
|
-
userAgent: context.
|
|
38
|
+
userAgent: context.getHeader('user-agent'),
|
|
39
39
|
locale: context.localeContext.baseName,
|
|
40
40
|
countryCode: context.countryContext,
|
|
41
41
|
});
|
|
@@ -28,7 +28,7 @@ export default async function loginWithWebAuthn(
|
|
|
28
28
|
user = await context.modules.users.updateHeartbeat(user._id, {
|
|
29
29
|
remoteAddress: context.remoteAddress,
|
|
30
30
|
remotePort: context.remotePort,
|
|
31
|
-
userAgent: context.
|
|
31
|
+
userAgent: context.getHeader('user-agent'),
|
|
32
32
|
locale: context.localeContext.baseName,
|
|
33
33
|
countryCode: context.countryContext,
|
|
34
34
|
});
|
|
@@ -14,55 +14,22 @@ export default async function resetPassword(
|
|
|
14
14
|
if (!params.newPassword) {
|
|
15
15
|
throw new Error('Password is required');
|
|
16
16
|
}
|
|
17
|
-
let user = await modules.users.findUserByResetToken(params.token);
|
|
18
|
-
|
|
19
|
-
if (!user) throw new InvalidResetTokenError({});
|
|
20
17
|
|
|
21
18
|
try {
|
|
22
|
-
await modules.users.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// verified: false,
|
|
35
|
-
// },
|
|
36
|
-
// },
|
|
37
|
-
// },
|
|
38
|
-
// {
|
|
39
|
-
// $set: {
|
|
40
|
-
// 'emails.$[email].verified': true,
|
|
41
|
-
// },
|
|
42
|
-
// },
|
|
43
|
-
// {
|
|
44
|
-
// arrayFilters: [{ 'email.address': resetTicket.address }],
|
|
45
|
-
// },
|
|
46
|
-
// );
|
|
47
|
-
// if (updatedUser) {
|
|
48
|
-
// await modules.accounts.emit('VerifyEmailSuccess', updatedUser);
|
|
49
|
-
// }
|
|
50
|
-
// } catch (e) {
|
|
51
|
-
// /* */
|
|
52
|
-
// }
|
|
53
|
-
// }
|
|
19
|
+
let user = await modules.users.resetPassword(params.token, params.newPassword);
|
|
20
|
+
if (!user) throw new InvalidResetTokenError({});
|
|
21
|
+
|
|
22
|
+
user = await context.modules.users.updateHeartbeat(user._id, {
|
|
23
|
+
remoteAddress: context.remoteAddress,
|
|
24
|
+
remotePort: context.remotePort,
|
|
25
|
+
userAgent: context.getHeader('user-agent'),
|
|
26
|
+
locale: context.localeContext.baseName,
|
|
27
|
+
countryCode: context.countryContext,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return context.login(user);
|
|
54
31
|
} catch (e) {
|
|
55
|
-
if (e.cause === 'PASSWORD_INVALID') throw new PasswordInvalidError({
|
|
32
|
+
if (e.cause === 'PASSWORD_INVALID') throw new PasswordInvalidError({});
|
|
56
33
|
else throw e;
|
|
57
34
|
}
|
|
58
|
-
|
|
59
|
-
user = await context.modules.users.updateHeartbeat(user._id, {
|
|
60
|
-
remoteAddress: context.remoteAddress,
|
|
61
|
-
remotePort: context.remotePort,
|
|
62
|
-
userAgent: context.userAgent,
|
|
63
|
-
locale: context.localeContext.baseName,
|
|
64
|
-
countryCode: context.countryContext,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
return context.login(user);
|
|
68
35
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { log } from '@unchainedshop/logger';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { UserNotFoundError } from '../../../errors.js';
|
|
4
|
+
|
|
5
|
+
export default async function stopImpersonation(root: never, _, context: Context) {
|
|
6
|
+
const { userId, modules, impersonatorId } = context;
|
|
7
|
+
|
|
8
|
+
log(`mutation stopImpersonation for ${userId}`);
|
|
9
|
+
|
|
10
|
+
if (!impersonatorId) return null;
|
|
11
|
+
|
|
12
|
+
const impersonator = await modules.users.findUserById(impersonatorId);
|
|
13
|
+
|
|
14
|
+
if (!impersonator) throw new UserNotFoundError({ userId: impersonatorId });
|
|
15
|
+
|
|
16
|
+
await context.logout();
|
|
17
|
+
|
|
18
|
+
return context.login(impersonator);
|
|
19
|
+
}
|
|
@@ -18,7 +18,7 @@ export default async function verifyEmail(root: never, { token }: { token: any }
|
|
|
18
18
|
const user = await context.modules.users.updateHeartbeat(unverifiedToken.userId, {
|
|
19
19
|
remoteAddress: context.remoteAddress,
|
|
20
20
|
remotePort: context.remotePort,
|
|
21
|
-
userAgent: context.
|
|
21
|
+
userAgent: context.getHeader('user-agent'),
|
|
22
22
|
locale: context.localeContext.baseName,
|
|
23
23
|
countryCode: context.countryContext,
|
|
24
24
|
});
|
|
@@ -13,7 +13,7 @@ export default async function removeAssortmentProduct(
|
|
|
13
13
|
|
|
14
14
|
if (!assortmentProductId) throw new InvalidIdError({ assortmentProductId });
|
|
15
15
|
|
|
16
|
-
const assortmentProduct = await modules.assortments.products.
|
|
16
|
+
const assortmentProduct = await modules.assortments.products.findAssortmentProduct({
|
|
17
17
|
assortmentProductId,
|
|
18
18
|
});
|
|
19
19
|
if (!assortmentProduct) throw new AssortmentProductNotFoundError({ assortmentProductId });
|
|
@@ -5,7 +5,7 @@ import { Context } from '../../../context.js';
|
|
|
5
5
|
|
|
6
6
|
export default async function updateCountry(
|
|
7
7
|
root: never,
|
|
8
|
-
{ country, countryId }: { country: Country
|
|
8
|
+
{ country, countryId }: { country: Country; countryId: string },
|
|
9
9
|
{ userId, modules }: Context,
|
|
10
10
|
) {
|
|
11
11
|
log(`mutation updateCountry ${countryId}`, { userId });
|
|
@@ -15,12 +15,7 @@ export default async function updateCountry(
|
|
|
15
15
|
if (!(await modules.countries.countryExists({ countryId })))
|
|
16
16
|
throw new CountryNotFoundError({ countryId });
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
currencyId: country.defaultCurrencyId,
|
|
20
|
-
});
|
|
21
|
-
const defaultCurrencyCode = country?.defaultCurrencyCode || currencyObject?.isoCode;
|
|
22
|
-
|
|
23
|
-
await modules.countries.update(countryId, { ...country, defaultCurrencyCode });
|
|
18
|
+
await modules.countries.update(countryId, country);
|
|
24
19
|
|
|
25
20
|
return modules.countries.findCountry({ countryId });
|
|
26
21
|
}
|
|
@@ -4,6 +4,8 @@ import loginWithPassword from './accounts/loginWithPassword.js';
|
|
|
4
4
|
import loginWithWebAuthn from './accounts/loginWithWebAuthn.js';
|
|
5
5
|
import loginAsGuest from './accounts/loginAsGuest.js';
|
|
6
6
|
import logout from './accounts/logout.js';
|
|
7
|
+
import impersonate from './accounts/impersonate.js';
|
|
8
|
+
import stopImpersonation from './accounts/stopImpersonation.js';
|
|
7
9
|
import changePassword from './accounts/changePassword.js';
|
|
8
10
|
import createUser from './accounts/createUser.js';
|
|
9
11
|
import verifyEmail from './accounts/verifyEmail.js';
|
|
@@ -155,6 +157,9 @@ import removeUserProductReviews from './users/removeUserProductReviews.js';
|
|
|
155
157
|
export default {
|
|
156
158
|
logout: acl(actions.logout)(logout),
|
|
157
159
|
loginAsGuest: acl(actions.loginAsGuest)(loginAsGuest),
|
|
160
|
+
impersonate: acl(actions.impersonate)(impersonate),
|
|
161
|
+
stopImpersonation: acl(actions.stopImpersonation)(stopImpersonation),
|
|
162
|
+
|
|
158
163
|
createWebAuthnCredentialCreationOptions: acl(actions.useWebAuthn)(
|
|
159
164
|
createWebAuthnCredentialCreationOptions,
|
|
160
165
|
),
|
|
@@ -313,5 +318,5 @@ export default {
|
|
|
313
318
|
signPaymentProviderForCheckout: acl(actions.registerPaymentCredentials)(
|
|
314
319
|
signPaymentProviderForCheckout,
|
|
315
320
|
),
|
|
316
|
-
removeUserProductReviews,
|
|
321
|
+
removeUserProductReviews, // TODO!
|
|
317
322
|
};
|
|
@@ -6,7 +6,8 @@ const addPushSubscription = async (
|
|
|
6
6
|
{ subscription, unsubscribeFromOtherUsers = false },
|
|
7
7
|
context: Context,
|
|
8
8
|
) => {
|
|
9
|
-
const { modules, userId
|
|
9
|
+
const { modules, userId } = context;
|
|
10
|
+
const userAgent = context.getHeader('user-agent');
|
|
10
11
|
log(`mutation addPushSubscription ${userAgent}`, { userId });
|
|
11
12
|
|
|
12
13
|
await modules.users.addPushSubscription(userId, subscription, {
|
|
@@ -5,7 +5,7 @@ import { UserNotFoundError } from '../../../errors.js';
|
|
|
5
5
|
export default async function heartbeat(
|
|
6
6
|
root: never,
|
|
7
7
|
_: any,
|
|
8
|
-
{ countryContext, localeContext, modules, remoteAddress, remotePort,
|
|
8
|
+
{ countryContext, localeContext, modules, remoteAddress, remotePort, userId, getHeader }: Context,
|
|
9
9
|
) {
|
|
10
10
|
log(`mutation heartbeat ${remoteAddress}`, { userId });
|
|
11
11
|
|
|
@@ -20,7 +20,7 @@ export default async function heartbeat(
|
|
|
20
20
|
locale: localeContext.baseName,
|
|
21
21
|
remoteAddress,
|
|
22
22
|
remotePort,
|
|
23
|
-
userAgent,
|
|
23
|
+
userAgent: getHeader('user-agent'),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
return user;
|
|
@@ -2,7 +2,9 @@ import { Context } from '../../../context.js';
|
|
|
2
2
|
import { log } from '@unchainedshop/logger';
|
|
3
3
|
|
|
4
4
|
const removePushSubscription = async (_, { p256dh }, context: Context) => {
|
|
5
|
-
const { modules, userId
|
|
5
|
+
const { modules, userId } = context;
|
|
6
|
+
const userAgent = context.getHeader('user-agent');
|
|
7
|
+
|
|
6
8
|
log(`mutation removePushSubscription ${userId} ${userAgent}`, { userId });
|
|
7
9
|
|
|
8
10
|
await modules.users.removePushSubscription(userId, p256dh);
|
|
@@ -63,6 +63,7 @@ import warehousingProviders from './warehousing/warehousingProviders.js';
|
|
|
63
63
|
import warehousingProvidersCount from './warehousing/warehousingProvidersCount.js';
|
|
64
64
|
import token from './warehousing/token.js';
|
|
65
65
|
import tokens from './warehousing/tokens.js';
|
|
66
|
+
import tokensCount from './warehousing/tokensCount.js';
|
|
66
67
|
import work from './worker/work.js';
|
|
67
68
|
import workQueue from './worker/workQueue.js';
|
|
68
69
|
import workStatistics from './worker/workStatistics.js';
|
|
@@ -71,9 +72,11 @@ import validateResetPasswordToken from './users/validateResetPasswordToken.js';
|
|
|
71
72
|
import validateVerifyEmailToken from './users/validateVerifyEmailToken.js';
|
|
72
73
|
import eventStatistics from './events/eventStatistics.js';
|
|
73
74
|
import orderStatistics from './orders/orderStatistics.js';
|
|
75
|
+
import impersonator from './users/impersonator.js';
|
|
74
76
|
|
|
75
77
|
export default {
|
|
76
78
|
me,
|
|
79
|
+
impersonator,
|
|
77
80
|
user: acl(actions.viewUser)(user),
|
|
78
81
|
users: acl(actions.viewUsers)(users),
|
|
79
82
|
usersCount: acl(actions.viewUsers)(usersCount),
|
|
@@ -104,6 +107,7 @@ export default {
|
|
|
104
107
|
warehousingInterfaces: acl(actions.viewWarehousingInterfaces)(warehousingInterfaces),
|
|
105
108
|
token: acl(actions.viewToken)(token),
|
|
106
109
|
tokens: acl(actions.viewTokens)(tokens),
|
|
110
|
+
tokensCount: acl(actions.viewTokens)(tokensCount),
|
|
107
111
|
translatedProductTexts: acl(actions.viewTranslations)(translatedProductTexts),
|
|
108
112
|
translatedProductMediaTexts: acl(actions.viewTranslations)(translatedProductMediaTexts),
|
|
109
113
|
translatedProductVariationTexts: acl(actions.viewTranslations)(translatedProductVariationTexts),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { log } from '@unchainedshop/logger';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
|
|
4
|
+
export default async function impersonator(
|
|
5
|
+
root: never,
|
|
6
|
+
params: any,
|
|
7
|
+
{ userId, remoteAddress, modules, impersonatorId }: Context,
|
|
8
|
+
) {
|
|
9
|
+
log(`query impersonator ${remoteAddress}`, { userId });
|
|
10
|
+
|
|
11
|
+
if (!impersonatorId) return null;
|
|
12
|
+
return modules.users.findUserById(impersonatorId);
|
|
13
|
+
}
|
|
@@ -10,7 +10,7 @@ export default async function validateResetPasswordToken(
|
|
|
10
10
|
|
|
11
11
|
log('query validateResetPasswordToken', { userId, token: params.token });
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const resetToken = await modules.users.findResetToken(params.token);
|
|
14
14
|
|
|
15
|
-
return !!
|
|
15
|
+
return !!resetToken;
|
|
16
16
|
}
|
|
@@ -4,15 +4,17 @@ import { Context } from '../../../context.js';
|
|
|
4
4
|
export default async function tokens(
|
|
5
5
|
root: never,
|
|
6
6
|
{
|
|
7
|
+
queryString = null,
|
|
7
8
|
limit = 10,
|
|
8
9
|
offset = 0,
|
|
9
10
|
}: {
|
|
10
11
|
limit: number;
|
|
11
12
|
offset: number;
|
|
13
|
+
queryString?: string;
|
|
12
14
|
},
|
|
13
15
|
{ modules, userId }: Context,
|
|
14
16
|
) {
|
|
15
17
|
log(`query tokens`, { userId });
|
|
16
18
|
|
|
17
|
-
return modules.warehousing.findTokens({}, { limit, skip: offset });
|
|
19
|
+
return modules.warehousing.findTokens({ queryString }, { limit, skip: offset });
|
|
18
20
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { log } from '@unchainedshop/logger';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
|
|
4
|
+
export default async function tokensCount(
|
|
5
|
+
root: never,
|
|
6
|
+
{ queryString = null },
|
|
7
|
+
{ modules, userId }: Context,
|
|
8
|
+
) {
|
|
9
|
+
log(`query tokensCount`, { userId });
|
|
10
|
+
|
|
11
|
+
return modules.warehousing.tokensCount({ queryString });
|
|
12
|
+
}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
+
import { AssortmentLink } from '@unchainedshop/core-assortments';
|
|
1
2
|
import { Context } from '../../../context.js';
|
|
2
|
-
import {
|
|
3
|
-
AssortmentPathLink as AssortmentPathLinkType,
|
|
4
|
-
AssortmentLink as AssortmentLinkType,
|
|
5
|
-
AssortmentText,
|
|
6
|
-
} from '@unchainedshop/core-assortments';
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
4
|
+
export const AssortmentPathLink = {
|
|
5
|
+
link(linkObj) {
|
|
6
|
+
if (linkObj._id) return linkObj;
|
|
7
|
+
return null;
|
|
8
|
+
},
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return loaders.assortmentLinkLoader.load({
|
|
18
|
-
parentAssortmentId: assortmentId,
|
|
19
|
-
childAssortmentId,
|
|
20
|
-
});
|
|
10
|
+
assortmentId(linkObj) {
|
|
11
|
+
return linkObj.childAssortmentId;
|
|
21
12
|
},
|
|
22
13
|
|
|
23
|
-
assortmentTexts: async (
|
|
14
|
+
assortmentTexts: async (
|
|
15
|
+
{ childAssortmentId }: AssortmentLink,
|
|
16
|
+
params: { forceLocale?: string },
|
|
17
|
+
{ loaders, localeContext }: Context,
|
|
18
|
+
) => {
|
|
24
19
|
const text = await loaders.assortmentTextLoader.load({
|
|
25
|
-
assortmentId,
|
|
20
|
+
assortmentId: childAssortmentId,
|
|
26
21
|
locale: params.forceLocale || localeContext.baseName,
|
|
27
22
|
});
|
|
28
23
|
return text;
|
|
@@ -3,10 +3,22 @@ import { Assortment } from '@unchainedshop/core-assortments';
|
|
|
3
3
|
import { SearchFilterQuery } from '@unchainedshop/core-filters';
|
|
4
4
|
|
|
5
5
|
export const AssortmentTypes = {
|
|
6
|
-
assortmentPaths
|
|
7
|
-
return modules.assortments.breadcrumbs(
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
assortmentPaths(obj: Assortment, _, { modules, loaders }: Context) {
|
|
7
|
+
return modules.assortments.breadcrumbs(
|
|
8
|
+
{
|
|
9
|
+
assortmentId: obj._id,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
resolveAssortmentProducts: async (productId) =>
|
|
13
|
+
loaders.assortmentProductsLoader.load({
|
|
14
|
+
productId,
|
|
15
|
+
}),
|
|
16
|
+
resolveAssortmentLinks: async (childAssortmentId) =>
|
|
17
|
+
loaders.assortmentLinksLoader.load({
|
|
18
|
+
childAssortmentId,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
);
|
|
10
22
|
},
|
|
11
23
|
|
|
12
24
|
children: async (
|
|
@@ -79,7 +91,7 @@ export const AssortmentTypes = {
|
|
|
79
91
|
|
|
80
92
|
async productAssignments(obj: Assortment, _, { modules }: Context) {
|
|
81
93
|
// TODO: Loader & move default sort to core module
|
|
82
|
-
return modules.assortments.products.
|
|
94
|
+
return modules.assortments.products.findAssortmentProducts(
|
|
83
95
|
{
|
|
84
96
|
assortmentId: obj._id,
|
|
85
97
|
},
|
|
@@ -18,15 +18,27 @@ export const Product = {
|
|
|
18
18
|
params: {
|
|
19
19
|
forceLocale?: string;
|
|
20
20
|
},
|
|
21
|
-
{ modules }: Context,
|
|
21
|
+
{ modules, loaders }: Context,
|
|
22
22
|
): Promise<
|
|
23
23
|
Array<{
|
|
24
24
|
links: Array<AssortmentPathLink>;
|
|
25
25
|
}>
|
|
26
26
|
> {
|
|
27
|
-
return modules.assortments.breadcrumbs(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return modules.assortments.breadcrumbs(
|
|
28
|
+
{
|
|
29
|
+
productId: product._id,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
resolveAssortmentProducts: async (productId) =>
|
|
33
|
+
loaders.assortmentProductsLoader.load({
|
|
34
|
+
productId,
|
|
35
|
+
}),
|
|
36
|
+
resolveAssortmentLinks: async (childAssortmentId) =>
|
|
37
|
+
loaders.assortmentLinksLoader.load({
|
|
38
|
+
childAssortmentId,
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
);
|
|
30
42
|
},
|
|
31
43
|
|
|
32
44
|
// TODO: Use a loader!
|
|
@@ -103,7 +115,7 @@ export const Product = {
|
|
|
103
115
|
|
|
104
116
|
if (!assortmentIds.length) return [];
|
|
105
117
|
|
|
106
|
-
const productIds = await modules.assortments.products.
|
|
118
|
+
const productIds = await modules.assortments.products.findSiblings({
|
|
107
119
|
productId,
|
|
108
120
|
assortmentIds,
|
|
109
121
|
});
|
|
@@ -22,7 +22,10 @@ export const ProductVariationAssignmentVector: ProductVariationAssignmentVectorH
|
|
|
22
22
|
key: obj.key,
|
|
23
23
|
productId: obj.product._id,
|
|
24
24
|
});
|
|
25
|
-
return
|
|
25
|
+
return {
|
|
26
|
+
_id: productVariation._id,
|
|
27
|
+
productVariationOption: obj.value,
|
|
28
|
+
};
|
|
26
29
|
},
|
|
27
30
|
|
|
28
31
|
variation: (obj, _, { modules }) => {
|
|
@@ -21,8 +21,11 @@ export interface ProductVariationHelperTypes {
|
|
|
21
21
|
texts: HelperType<{ forceLocale?: string }, Promise<ProductVariationText>>;
|
|
22
22
|
}
|
|
23
23
|
export const ProductVariation: ProductVariationHelperTypes = {
|
|
24
|
-
options: (obj
|
|
25
|
-
return (obj.options || []).map((option) =>
|
|
24
|
+
options: (obj) => {
|
|
25
|
+
return (obj.options || []).map((option) => ({
|
|
26
|
+
_id: obj._id,
|
|
27
|
+
productVariationOption: option,
|
|
28
|
+
}));
|
|
26
29
|
},
|
|
27
30
|
|
|
28
31
|
texts: async (obj, { forceLocale }, { modules, localeContext }) => {
|
package/src/roles/all.ts
CHANGED
|
@@ -100,6 +100,7 @@ export const all = (role, actions) => {
|
|
|
100
100
|
role.allow(actions.viewTokens, () => false);
|
|
101
101
|
role.allow(actions.viewStatistics, () => false);
|
|
102
102
|
role.allow(actions.uploadUserAvatar, () => false);
|
|
103
|
+
role.allow(actions.impersonate, () => false);
|
|
103
104
|
|
|
104
105
|
// special case: when doing a login mutation, the user is not logged in technically yet,
|
|
105
106
|
// but should be able to see user data of the user that is about to be logged in
|
|
@@ -139,6 +140,7 @@ export const all = (role, actions) => {
|
|
|
139
140
|
role.allow(actions.viewFilter, () => true);
|
|
140
141
|
role.allow(actions.viewTranslations, () => true);
|
|
141
142
|
role.allow(actions.logout, () => true);
|
|
143
|
+
role.allow(actions.stopImpersonation, () => true);
|
|
142
144
|
role.allow(actions.loginAsGuest, () => true);
|
|
143
145
|
role.allow(actions.loginWithPassword, () => true);
|
|
144
146
|
role.allow(actions.loginWithWebAuthn, () => true);
|
package/src/roles/index.ts
CHANGED
package/src/schema/mutation.ts
CHANGED
|
@@ -57,6 +57,16 @@ export default [
|
|
|
57
57
|
"""
|
|
58
58
|
logout: SuccessResponse
|
|
59
59
|
|
|
60
|
+
"""
|
|
61
|
+
Impersonate a user
|
|
62
|
+
"""
|
|
63
|
+
impersonate(userId: ID!): LoginMethodResponse!
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
End customer impersonated user session and resume the impersonator session
|
|
67
|
+
"""
|
|
68
|
+
stopImpersonation: LoginMethodResponse
|
|
69
|
+
|
|
60
70
|
"""
|
|
61
71
|
Marks the user's email address as verified. Logs the user in afterwards.
|
|
62
72
|
"""
|
package/src/schema/query.ts
CHANGED
|
@@ -6,6 +6,11 @@ export default [
|
|
|
6
6
|
"""
|
|
7
7
|
me: User
|
|
8
8
|
|
|
9
|
+
"""
|
|
10
|
+
User impersonating currently logged in user
|
|
11
|
+
"""
|
|
12
|
+
impersonator: User
|
|
13
|
+
|
|
9
14
|
"""
|
|
10
15
|
Get list of users, by default sorted by creation date (ascending) unless a queryString is set
|
|
11
16
|
"""
|
|
@@ -211,7 +216,12 @@ export default [
|
|
|
211
216
|
"""
|
|
212
217
|
Get all tokens
|
|
213
218
|
"""
|
|
214
|
-
tokens(limit: Int = 10, offset: Int = 0): [Token!]!
|
|
219
|
+
tokens(queryString: String, limit: Int = 10, offset: Int = 0): [Token!]!
|
|
220
|
+
|
|
221
|
+
"""
|
|
222
|
+
Returns total tokens
|
|
223
|
+
"""
|
|
224
|
+
tokensCount(queryString: String): Int!
|
|
215
225
|
|
|
216
226
|
"""
|
|
217
227
|
Returns total number of payment providers, optionally filtered by type
|
package/src/schema/types/user.ts
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
2
|
-
import { Product } from '@unchainedshop/core-products';
|
|
3
|
-
import { WarehousingProvider } from '@unchainedshop/core-warehousing';
|
|
4
|
-
export declare const Dispatch: {
|
|
5
|
-
_id: (params: {
|
|
6
|
-
product: Product;
|
|
7
|
-
deliveryProvider: DeliveryProvider;
|
|
8
|
-
warehousingProvider: WarehousingProvider;
|
|
9
|
-
referenceDate: Date;
|
|
10
|
-
quantity: number;
|
|
11
|
-
country: string;
|
|
12
|
-
userId?: string;
|
|
13
|
-
}) => Promise<string>;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=dispatch-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-types.d.ts","sourceRoot":"","sources":["../../../src/resolvers/type/dispatch-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtE,eAAO,MAAM,QAAQ;kBACC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,aAAa,EAAE,IAAI,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CAYF,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { sha256 } from '@unchainedshop/utils';
|
|
2
|
-
export const Dispatch = {
|
|
3
|
-
_id: async (params) => await sha256([
|
|
4
|
-
params.product._id,
|
|
5
|
-
params.deliveryProvider._id,
|
|
6
|
-
params.warehousingProvider._id,
|
|
7
|
-
params.referenceDate,
|
|
8
|
-
params.quantity,
|
|
9
|
-
params.country,
|
|
10
|
-
params.userId || 'ANONYMOUS',
|
|
11
|
-
].join('')),
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=dispatch-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-types.js","sourceRoot":"","sources":["../../../src/resolvers/type/dispatch-types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,KAAK,EAAE,MAQX,EAAE,EAAE,CACH,MAAM,MAAM,CACV;QACE,MAAM,CAAC,OAAO,CAAC,GAAG;QAClB,MAAM,CAAC,gBAAgB,CAAC,GAAG;QAC3B,MAAM,CAAC,mBAAmB,CAAC,GAAG;QAC9B,MAAM,CAAC,aAAa;QACpB,MAAM,CAAC,QAAQ;QACf,MAAM,CAAC,OAAO;QACd,MAAM,CAAC,MAAM,IAAI,WAAW;KAC7B,CAAC,IAAI,CAAC,EAAE,CAAC,CACX;CACJ,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
2
|
-
import { Product } from '@unchainedshop/core-products';
|
|
3
|
-
import { WarehousingProvider } from '@unchainedshop/core-warehousing';
|
|
4
|
-
export declare const Stock: {
|
|
5
|
-
_id: (params: {
|
|
6
|
-
product: Product;
|
|
7
|
-
deliveryProvider: DeliveryProvider;
|
|
8
|
-
warehousingProvider: WarehousingProvider;
|
|
9
|
-
referenceDate: Date;
|
|
10
|
-
country: string;
|
|
11
|
-
userId?: string;
|
|
12
|
-
}) => Promise<string>;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=stock-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stock-types.d.ts","sourceRoot":"","sources":["../../../src/resolvers/type/stock-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtE,eAAO,MAAM,KAAK;kBACI;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,aAAa,EAAE,IAAI,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CAWF,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { sha256 } from '@unchainedshop/utils';
|
|
2
|
-
export const Stock = {
|
|
3
|
-
_id: async (params) => await sha256([
|
|
4
|
-
params.product._id,
|
|
5
|
-
params.deliveryProvider._id,
|
|
6
|
-
params.warehousingProvider._id,
|
|
7
|
-
params.referenceDate,
|
|
8
|
-
params.country,
|
|
9
|
-
params.userId || 'ANONYMOUS',
|
|
10
|
-
].join('')),
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=stock-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stock-types.js","sourceRoot":"","sources":["../../../src/resolvers/type/stock-types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,GAAG,EAAE,KAAK,EAAE,MAOX,EAAE,EAAE,CACH,MAAM,MAAM,CACV;QACE,MAAM,CAAC,OAAO,CAAC,GAAG;QAClB,MAAM,CAAC,gBAAgB,CAAC,GAAG;QAC3B,MAAM,CAAC,mBAAmB,CAAC,GAAG;QAC9B,MAAM,CAAC,aAAa;QACpB,MAAM,CAAC,OAAO;QACd,MAAM,CAAC,MAAM,IAAI,WAAW;KAC7B,CAAC,IAAI,CAAC,EAAE,CAAC,CACX;CACJ,CAAC"}
|