controlresell 0.0.5 → 0.0.6

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/dist/index.d.ts CHANGED
@@ -8,7 +8,13 @@ export * from "./models/connector/account";
8
8
  export * from "./models/connector/job";
9
9
  export * from "./models/connector/rabbitmq";
10
10
  export * from "./models/connector/jobs/post";
11
+ export * from "./models/customers/customer";
12
+ export * from "./models/items/customField";
11
13
  export * from "./models/items/item";
12
14
  export * from "./models/items/itemField";
13
15
  export * from "./models/items/itemFieldValue";
16
+ export * from "./models/items/itemHistory";
17
+ export * from "./models/items/itemOnPlatform";
14
18
  export * from "./models/users/user";
19
+ export * from "./models/users/userOnPlatform";
20
+ export * from "./models/users/wallet";
package/dist/index.js CHANGED
@@ -24,7 +24,13 @@ __exportStar(require("./models/connector/account"), exports);
24
24
  __exportStar(require("./models/connector/job"), exports);
25
25
  __exportStar(require("./models/connector/rabbitmq"), exports);
26
26
  __exportStar(require("./models/connector/jobs/post"), exports);
27
+ __exportStar(require("./models/customers/customer"), exports);
28
+ __exportStar(require("./models/items/customField"), exports);
27
29
  __exportStar(require("./models/items/item"), exports);
28
30
  __exportStar(require("./models/items/itemField"), exports);
29
31
  __exportStar(require("./models/items/itemFieldValue"), exports);
32
+ __exportStar(require("./models/items/itemHistory"), exports);
33
+ __exportStar(require("./models/items/itemOnPlatform"), exports);
30
34
  __exportStar(require("./models/users/user"), exports);
35
+ __exportStar(require("./models/users/userOnPlatform"), exports);
36
+ __exportStar(require("./models/users/wallet"), exports);
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ export declare const CustomerSchema: z.ZodObject<{
3
+ id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
4
+ userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
5
+ firstName: z.ZodString;
6
+ lastName: z.ZodString;
7
+ birthDate: z.ZodDate;
8
+ idNumber: z.ZodString;
9
+ email: z.ZodString;
10
+ phone: z.ZodString;
11
+ iban: z.ZodString;
12
+ bic: z.ZodString;
13
+ phoneVerified: z.ZodBoolean;
14
+ createdAt: z.ZodOptional<z.ZodDate>;
15
+ items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ id: string | number;
18
+ userId: string | number;
19
+ firstName: string;
20
+ lastName: string;
21
+ birthDate: Date;
22
+ idNumber: string;
23
+ email: string;
24
+ phone: string;
25
+ iban: string;
26
+ bic: string;
27
+ phoneVerified: boolean;
28
+ items?: any[] | undefined;
29
+ createdAt?: Date | undefined;
30
+ }, {
31
+ id: string | number;
32
+ userId: string | number;
33
+ firstName: string;
34
+ lastName: string;
35
+ birthDate: Date;
36
+ idNumber: string;
37
+ email: string;
38
+ phone: string;
39
+ iban: string;
40
+ bic: string;
41
+ phoneVerified: boolean;
42
+ items?: any[] | undefined;
43
+ createdAt?: Date | undefined;
44
+ }>;
45
+ export type Customer = z.infer<typeof CustomerSchema>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const legacy_1 = require("../../helpers/legacy");
6
+ const primitives_1 = require("../primitives");
7
+ exports.CustomerSchema = (0, legacy_1.legacy)(zod_1.z.object({
8
+ id: primitives_1.IdSchema,
9
+ userId: primitives_1.IdSchema,
10
+ firstName: zod_1.z.string(),
11
+ lastName: zod_1.z.string(),
12
+ birthDate: zod_1.z.coerce.date(),
13
+ idNumber: zod_1.z.string(),
14
+ email: zod_1.z.string().email(),
15
+ phone: zod_1.z.string(),
16
+ iban: zod_1.z.string(),
17
+ bic: zod_1.z.string(),
18
+ phoneVerified: zod_1.z.boolean(),
19
+ createdAt: zod_1.z.coerce.date().optional(),
20
+ items: zod_1.z.array(zod_1.z.any()).optional(),
21
+ }));
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const CustomFieldIdSchema: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodObject<{
3
+ name: z.ZodString;
4
+ defaultValue: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ name: string;
7
+ defaultValue: string | number;
8
+ }, {
9
+ name: string;
10
+ defaultValue: string | number;
11
+ }>]>;
12
+ export type CustomFieldId = z.infer<typeof CustomFieldIdSchema>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomFieldIdSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.CustomFieldIdSchema = zod_1.z.union([
6
+ zod_1.z.number(), zod_1.z.string(), zod_1.z.object({
7
+ name: zod_1.z.string(),
8
+ defaultValue: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
9
+ }),
10
+ ]);
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ export declare const ItemHistoryTypeSchema: z.ZodEnum<["create", "update", "delete"]>;
3
+ export type ItemHistoryType = z.infer<typeof ItemHistoryTypeSchema>;
4
+ export declare const ItemHistorySchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
7
+ type: z.ZodEnum<["create", "update", "delete"]>;
8
+ data: z.ZodString;
9
+ createdAt: z.ZodDate;
10
+ }, "strip", z.ZodTypeAny, {
11
+ type: "create" | "update" | "delete";
12
+ id: string;
13
+ data: string;
14
+ itemId: string | number;
15
+ createdAt: Date;
16
+ }, {
17
+ type: "create" | "update" | "delete";
18
+ id: string;
19
+ data: string;
20
+ itemId: string | number;
21
+ createdAt: Date;
22
+ }>;
23
+ export type ItemHistory = z.infer<typeof ItemHistorySchema>;
24
+ export declare const CreateItemHistoryPayloadSchema: z.ZodObject<{
25
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
26
+ type: z.ZodEnum<["create", "update", "delete"]>;
27
+ data: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ type: "create" | "update" | "delete";
30
+ data: string;
31
+ itemId: string | number;
32
+ }, {
33
+ type: "create" | "update" | "delete";
34
+ data: string;
35
+ itemId: string | number;
36
+ }>;
37
+ export type CreateItemHistoryPayload = z.infer<typeof CreateItemHistoryPayloadSchema>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateItemHistoryPayloadSchema = exports.ItemHistorySchema = exports.ItemHistoryTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../primitives");
6
+ exports.ItemHistoryTypeSchema = zod_1.z.enum(["create", "update", "delete"]);
7
+ exports.ItemHistorySchema = zod_1.z.object({
8
+ id: zod_1.z.string().uuid(),
9
+ itemId: primitives_1.IdSchema,
10
+ type: exports.ItemHistoryTypeSchema,
11
+ data: zod_1.z.string(),
12
+ createdAt: zod_1.z.coerce.date(),
13
+ });
14
+ exports.CreateItemHistoryPayloadSchema = zod_1.z.object({
15
+ itemId: primitives_1.IdSchema,
16
+ type: exports.ItemHistoryTypeSchema,
17
+ data: zod_1.z.string(),
18
+ });
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ export declare const ItemOnPlatformStatusSchema: z.ZodEnum<["online", "draft", "deleted", "sold", "hidden", "pending", "error", "dispute"]>;
3
+ export type ItemOnPlatformStatus = z.infer<typeof ItemOnPlatformStatusSchema>;
4
+ export declare const ItemOnPlatformSchema: z.ZodObject<{
5
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
6
+ accountId: z.ZodString;
7
+ platformId: z.ZodString;
8
+ platformUrl: z.ZodString;
9
+ status: z.ZodEnum<["online", "draft", "deleted", "sold", "hidden", "pending", "error", "dispute"]>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ status: "online" | "draft" | "deleted" | "sold" | "hidden" | "pending" | "error" | "dispute";
12
+ accountId: string;
13
+ itemId: string | number;
14
+ platformId: string;
15
+ platformUrl: string;
16
+ }, {
17
+ status: "online" | "draft" | "deleted" | "sold" | "hidden" | "pending" | "error" | "dispute";
18
+ accountId: string;
19
+ itemId: string | number;
20
+ platformId: string;
21
+ platformUrl: string;
22
+ }>;
23
+ export type ItemOnPlatform = z.infer<typeof ItemOnPlatformSchema>;
24
+ export declare const CreateItemOnPlatformPayloadSchema: z.ZodObject<{
25
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
26
+ accountId: z.ZodString;
27
+ platformId: z.ZodString;
28
+ platformUrl: z.ZodString;
29
+ status: z.ZodEnum<["online", "draft", "deleted", "sold", "hidden", "pending", "error", "dispute"]>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ status: "online" | "draft" | "deleted" | "sold" | "hidden" | "pending" | "error" | "dispute";
32
+ accountId: string;
33
+ itemId: string | number;
34
+ platformId: string;
35
+ platformUrl: string;
36
+ }, {
37
+ status: "online" | "draft" | "deleted" | "sold" | "hidden" | "pending" | "error" | "dispute";
38
+ accountId: string;
39
+ itemId: string | number;
40
+ platformId: string;
41
+ platformUrl: string;
42
+ }>;
43
+ export type CreateItemOnPlatformPayload = z.infer<typeof CreateItemOnPlatformPayloadSchema>;
44
+ export declare const UpdateItemOnPlatformPayloadSchema: z.ZodObject<{
45
+ status: z.ZodOptional<z.ZodEnum<["online", "draft", "deleted", "sold", "hidden", "pending", "error", "dispute"]>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ status?: "online" | "draft" | "deleted" | "sold" | "hidden" | "pending" | "error" | "dispute" | undefined;
48
+ }, {
49
+ status?: "online" | "draft" | "deleted" | "sold" | "hidden" | "pending" | "error" | "dispute" | undefined;
50
+ }>;
51
+ export type UpdateItemOnPlatformPayload = z.infer<typeof UpdateItemOnPlatformPayloadSchema>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateItemOnPlatformPayloadSchema = exports.CreateItemOnPlatformPayloadSchema = exports.ItemOnPlatformSchema = exports.ItemOnPlatformStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../primitives");
6
+ exports.ItemOnPlatformStatusSchema = zod_1.z.enum([
7
+ "online", "draft", "deleted", "sold", "hidden", "pending", "error", "dispute",
8
+ ]);
9
+ exports.ItemOnPlatformSchema = zod_1.z.object({
10
+ itemId: primitives_1.IdSchema,
11
+ accountId: zod_1.z.string().uuid(),
12
+ platformId: zod_1.z.string(),
13
+ platformUrl: zod_1.z.string().url(),
14
+ status: exports.ItemOnPlatformStatusSchema,
15
+ });
16
+ exports.CreateItemOnPlatformPayloadSchema = zod_1.z.object({
17
+ itemId: primitives_1.IdSchema,
18
+ accountId: zod_1.z.string().uuid(),
19
+ platformId: zod_1.z.string(),
20
+ platformUrl: zod_1.z.string().url(),
21
+ status: exports.ItemOnPlatformStatusSchema,
22
+ });
23
+ exports.UpdateItemOnPlatformPayloadSchema = zod_1.z.object({
24
+ status: exports.ItemOnPlatformStatusSchema.optional(),
25
+ });
@@ -1 +1,153 @@
1
- export {};
1
+ import { z } from "zod";
2
+ export declare const UserSchema: z.ZodObject<{
3
+ id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
4
+ email: z.ZodString;
5
+ username: z.ZodString;
6
+ firstName: z.ZodString;
7
+ password: z.ZodOptional<z.ZodString>;
8
+ anonymous: z.ZodBoolean;
9
+ membership: z.ZodString;
10
+ affiliate: z.ZodString;
11
+ notificationToken: z.ZodString;
12
+ wallet: z.ZodObject<{
13
+ profit: z.ZodNumber;
14
+ revenue: z.ZodNumber;
15
+ currentMonthProfit: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ profit: number;
18
+ revenue: number;
19
+ currentMonthProfit: number;
20
+ }, {
21
+ profit: number;
22
+ revenue: number;
23
+ currentMonthProfit: number;
24
+ }>;
25
+ isPro: z.ZodBoolean;
26
+ isShop: z.ZodBoolean;
27
+ customers: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
29
+ userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
30
+ firstName: z.ZodString;
31
+ lastName: z.ZodString;
32
+ birthDate: z.ZodDate;
33
+ idNumber: z.ZodString;
34
+ email: z.ZodString;
35
+ phone: z.ZodString;
36
+ iban: z.ZodString;
37
+ bic: z.ZodString;
38
+ phoneVerified: z.ZodBoolean;
39
+ createdAt: z.ZodOptional<z.ZodDate>;
40
+ items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ id: string | number;
43
+ userId: string | number;
44
+ firstName: string;
45
+ lastName: string;
46
+ birthDate: Date;
47
+ idNumber: string;
48
+ email: string;
49
+ phone: string;
50
+ iban: string;
51
+ bic: string;
52
+ phoneVerified: boolean;
53
+ items?: any[] | undefined;
54
+ createdAt?: Date | undefined;
55
+ }, {
56
+ id: string | number;
57
+ userId: string | number;
58
+ firstName: string;
59
+ lastName: string;
60
+ birthDate: Date;
61
+ idNumber: string;
62
+ email: string;
63
+ phone: string;
64
+ iban: string;
65
+ bic: string;
66
+ phoneVerified: boolean;
67
+ items?: any[] | undefined;
68
+ createdAt?: Date | undefined;
69
+ }>, "many">>;
70
+ fields: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodObject<{
71
+ name: z.ZodString;
72
+ defaultValue: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ name: string;
75
+ defaultValue: string | number;
76
+ }, {
77
+ name: string;
78
+ defaultValue: string | number;
79
+ }>]>, "many">>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ id: string | number;
82
+ firstName: string;
83
+ email: string;
84
+ username: string;
85
+ anonymous: boolean;
86
+ membership: string;
87
+ affiliate: string;
88
+ notificationToken: string;
89
+ wallet: {
90
+ profit: number;
91
+ revenue: number;
92
+ currentMonthProfit: number;
93
+ };
94
+ isPro: boolean;
95
+ isShop: boolean;
96
+ password?: string | undefined;
97
+ customers?: {
98
+ id: string | number;
99
+ userId: string | number;
100
+ firstName: string;
101
+ lastName: string;
102
+ birthDate: Date;
103
+ idNumber: string;
104
+ email: string;
105
+ phone: string;
106
+ iban: string;
107
+ bic: string;
108
+ phoneVerified: boolean;
109
+ items?: any[] | undefined;
110
+ createdAt?: Date | undefined;
111
+ }[] | undefined;
112
+ fields?: (string | number | {
113
+ name: string;
114
+ defaultValue: string | number;
115
+ })[] | undefined;
116
+ }, {
117
+ id: string | number;
118
+ firstName: string;
119
+ email: string;
120
+ username: string;
121
+ anonymous: boolean;
122
+ membership: string;
123
+ affiliate: string;
124
+ notificationToken: string;
125
+ wallet: {
126
+ profit: number;
127
+ revenue: number;
128
+ currentMonthProfit: number;
129
+ };
130
+ isPro: boolean;
131
+ isShop: boolean;
132
+ password?: string | undefined;
133
+ customers?: {
134
+ id: string | number;
135
+ userId: string | number;
136
+ firstName: string;
137
+ lastName: string;
138
+ birthDate: Date;
139
+ idNumber: string;
140
+ email: string;
141
+ phone: string;
142
+ iban: string;
143
+ bic: string;
144
+ phoneVerified: boolean;
145
+ items?: any[] | undefined;
146
+ createdAt?: Date | undefined;
147
+ }[] | undefined;
148
+ fields?: (string | number | {
149
+ name: string;
150
+ defaultValue: string | number;
151
+ })[] | undefined;
152
+ }>;
153
+ export type User = z.infer<typeof UserSchema>;
@@ -1,2 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const legacy_1 = require("../../helpers/legacy");
6
+ const wallet_1 = require("./wallet");
7
+ const customer_1 = require("../customers/customer");
8
+ const primitives_1 = require("../primitives");
9
+ const customField_1 = require("../items/customField");
10
+ exports.UserSchema = (0, legacy_1.legacy)(zod_1.z.object({
11
+ id: primitives_1.IdSchema,
12
+ email: zod_1.z.string(),
13
+ username: zod_1.z.string(),
14
+ firstName: zod_1.z.string(),
15
+ password: zod_1.z.string().optional(),
16
+ anonymous: zod_1.z.boolean(),
17
+ membership: zod_1.z.string(),
18
+ affiliate: zod_1.z.string(),
19
+ notificationToken: zod_1.z.string(),
20
+ wallet: wallet_1.WalletSchema,
21
+ isPro: zod_1.z.boolean(),
22
+ isShop: zod_1.z.boolean(),
23
+ customers: zod_1.z.array(customer_1.CustomerSchema).optional(),
24
+ fields: zod_1.z.array(customField_1.CustomFieldIdSchema).optional(),
25
+ }));
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ export declare const UserOnPlatformSchema: z.ZodObject<{
3
+ userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
4
+ accountId: z.ZodString;
5
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ platform: "VINTED" | "SHOPIFY";
8
+ accountId: string;
9
+ userId: string | number;
10
+ }, {
11
+ platform: "VINTED" | "SHOPIFY";
12
+ accountId: string;
13
+ userId: string | number;
14
+ }>;
15
+ export type UserOnPlatform = z.infer<typeof UserOnPlatformSchema>;
16
+ export declare const CreateUserOnPlatformPayloadSchema: z.ZodObject<{
17
+ userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
18
+ accountId: z.ZodString;
19
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ platform: "VINTED" | "SHOPIFY";
22
+ accountId: string;
23
+ userId: string | number;
24
+ }, {
25
+ platform: "VINTED" | "SHOPIFY";
26
+ accountId: string;
27
+ userId: string | number;
28
+ }>;
29
+ export type CreateUserOnPlatformPayload = z.infer<typeof CreateUserOnPlatformPayloadSchema>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateUserOnPlatformPayloadSchema = exports.UserOnPlatformSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../primitives");
6
+ const account_1 = require("../connector/account");
7
+ exports.UserOnPlatformSchema = zod_1.z.object({
8
+ userId: primitives_1.IdSchema,
9
+ accountId: zod_1.z.string().uuid(),
10
+ platform: account_1.ConnectorAccountPlatformSchema,
11
+ });
12
+ exports.CreateUserOnPlatformPayloadSchema = zod_1.z.object({
13
+ userId: primitives_1.IdSchema,
14
+ accountId: zod_1.z.string().uuid(),
15
+ platform: account_1.ConnectorAccountPlatformSchema,
16
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const WalletSchema: z.ZodObject<{
3
+ profit: z.ZodNumber;
4
+ revenue: z.ZodNumber;
5
+ currentMonthProfit: z.ZodNumber;
6
+ }, "strip", z.ZodTypeAny, {
7
+ profit: number;
8
+ revenue: number;
9
+ currentMonthProfit: number;
10
+ }, {
11
+ profit: number;
12
+ revenue: number;
13
+ currentMonthProfit: number;
14
+ }>;
15
+ export type Wallet = z.infer<typeof WalletSchema>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.WalletSchema = zod_1.z.object({
6
+ profit: zod_1.z.number(),
7
+ revenue: zod_1.z.number(),
8
+ currentMonthProfit: zod_1.z.number(),
9
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "controlresell",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.js",