@reactionary/core 0.0.40 → 0.0.41
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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function Reactionary(options) {
|
|
2
|
+
return function(target, propertyKey, descriptor) {
|
|
3
|
+
const original = descriptor.value;
|
|
4
|
+
descriptor.value = function(...args) {
|
|
5
|
+
console.log("calling through reactionary decoration!");
|
|
6
|
+
return original.apply(this, args);
|
|
7
|
+
};
|
|
8
|
+
return descriptor;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
Reactionary
|
|
13
|
+
};
|
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./cache/redis-cache";
|
|
|
4
4
|
export * from "./cache/noop-cache";
|
|
5
5
|
export * from "./client/client";
|
|
6
6
|
export * from "./client/client-builder";
|
|
7
|
+
export * from "./decorators/reactionary.decorator";
|
|
7
8
|
export * from "./providers/analytics.provider";
|
|
8
9
|
export * from "./providers/base.provider";
|
|
9
10
|
export * from "./providers/cart.provider";
|
package/package.json
CHANGED
|
@@ -2,17 +2,17 @@ import { z } from "zod";
|
|
|
2
2
|
import { BaseMutationSchema } from "./base.mutation";
|
|
3
3
|
import { CartIdentifierSchema, CartItemIdentifierSchema, ProductIdentifierSchema } from "../models/identifiers.model";
|
|
4
4
|
const CartMutationItemAddSchema = BaseMutationSchema.extend({
|
|
5
|
-
cart: CartIdentifierSchema.
|
|
6
|
-
product: ProductIdentifierSchema.
|
|
5
|
+
cart: CartIdentifierSchema.nonoptional(),
|
|
6
|
+
product: ProductIdentifierSchema.nonoptional(),
|
|
7
7
|
quantity: z.number()
|
|
8
8
|
});
|
|
9
9
|
const CartMutationItemRemoveSchema = BaseMutationSchema.extend({
|
|
10
|
-
cart: CartIdentifierSchema.
|
|
11
|
-
item: CartItemIdentifierSchema.
|
|
10
|
+
cart: CartIdentifierSchema.nonoptional(),
|
|
11
|
+
item: CartItemIdentifierSchema.nonoptional()
|
|
12
12
|
});
|
|
13
13
|
const CartMutationItemQuantityChangeSchema = BaseMutationSchema.extend({
|
|
14
|
-
cart: CartIdentifierSchema.
|
|
15
|
-
item: CartItemIdentifierSchema.
|
|
14
|
+
cart: CartIdentifierSchema.nonoptional(),
|
|
15
|
+
item: CartItemIdentifierSchema.nonoptional(),
|
|
16
16
|
quantity: z.number()
|
|
17
17
|
});
|
|
18
18
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Reactionary(options: unknown): MethodDecorator;
|
package/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './cache/redis-cache';
|
|
|
4
4
|
export * from './cache/noop-cache';
|
|
5
5
|
export * from './client/client';
|
|
6
6
|
export * from './client/client-builder';
|
|
7
|
+
export * from './decorators/reactionary.decorator';
|
|
7
8
|
export * from './providers/analytics.provider';
|
|
8
9
|
export * from './providers/base.provider';
|
|
9
10
|
export * from './providers/cart.provider';
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const CartMutationItemAddSchema: z.ZodObject<{
|
|
3
|
-
cart: z.ZodObject<{
|
|
4
|
-
key: z.
|
|
5
|
-
}, z.core.$loose
|
|
6
|
-
product: z.ZodObject<{
|
|
7
|
-
key: z.
|
|
8
|
-
}, z.core.$loose
|
|
3
|
+
cart: z.ZodNonOptional<z.ZodObject<{
|
|
4
|
+
key: z.ZodDefault<z.ZodString>;
|
|
5
|
+
}, z.core.$loose>>;
|
|
6
|
+
product: z.ZodNonOptional<z.ZodObject<{
|
|
7
|
+
key: z.ZodDefault<z.ZodString>;
|
|
8
|
+
}, z.core.$loose>>;
|
|
9
9
|
quantity: z.ZodNumber;
|
|
10
10
|
}, z.core.$loose>;
|
|
11
11
|
export declare const CartMutationItemRemoveSchema: z.ZodObject<{
|
|
12
|
-
cart: z.ZodObject<{
|
|
13
|
-
key: z.
|
|
14
|
-
}, z.core.$loose
|
|
15
|
-
item: z.ZodObject<{
|
|
16
|
-
key: z.
|
|
17
|
-
}, z.core.$loose
|
|
12
|
+
cart: z.ZodNonOptional<z.ZodObject<{
|
|
13
|
+
key: z.ZodDefault<z.ZodString>;
|
|
14
|
+
}, z.core.$loose>>;
|
|
15
|
+
item: z.ZodNonOptional<z.ZodObject<{
|
|
16
|
+
key: z.ZodDefault<z.ZodString>;
|
|
17
|
+
}, z.core.$loose>>;
|
|
18
18
|
}, z.core.$loose>;
|
|
19
19
|
export declare const CartMutationItemQuantityChangeSchema: z.ZodObject<{
|
|
20
|
-
cart: z.ZodObject<{
|
|
21
|
-
key: z.
|
|
22
|
-
}, z.core.$loose
|
|
23
|
-
item: z.ZodObject<{
|
|
24
|
-
key: z.
|
|
25
|
-
}, z.core.$loose
|
|
20
|
+
cart: z.ZodNonOptional<z.ZodObject<{
|
|
21
|
+
key: z.ZodDefault<z.ZodString>;
|
|
22
|
+
}, z.core.$loose>>;
|
|
23
|
+
item: z.ZodNonOptional<z.ZodObject<{
|
|
24
|
+
key: z.ZodDefault<z.ZodString>;
|
|
25
|
+
}, z.core.$loose>>;
|
|
26
26
|
quantity: z.ZodNumber;
|
|
27
27
|
}, z.core.$loose>;
|
|
28
28
|
export type CartMutationItemAdd = z.infer<typeof CartMutationItemAddSchema>;
|