controlresell 0.0.4 → 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
@@ -4,7 +4,17 @@
4
4
  export * from "./helpers/json";
5
5
  export * from "./helpers/legacy";
6
6
  export * from "./models/primitives";
7
+ export * from "./models/connector/account";
8
+ export * from "./models/connector/job";
9
+ export * from "./models/connector/rabbitmq";
10
+ export * from "./models/connector/jobs/post";
11
+ export * from "./models/customers/customer";
12
+ export * from "./models/items/customField";
7
13
  export * from "./models/items/item";
8
14
  export * from "./models/items/itemField";
9
15
  export * from "./models/items/itemFieldValue";
16
+ export * from "./models/items/itemHistory";
17
+ export * from "./models/items/itemOnPlatform";
10
18
  export * from "./models/users/user";
19
+ export * from "./models/users/userOnPlatform";
20
+ export * from "./models/users/wallet";
package/dist/index.js CHANGED
@@ -20,7 +20,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  __exportStar(require("./helpers/json"), exports);
21
21
  __exportStar(require("./helpers/legacy"), exports);
22
22
  __exportStar(require("./models/primitives"), exports);
23
+ __exportStar(require("./models/connector/account"), exports);
24
+ __exportStar(require("./models/connector/job"), exports);
25
+ __exportStar(require("./models/connector/rabbitmq"), exports);
26
+ __exportStar(require("./models/connector/jobs/post"), exports);
27
+ __exportStar(require("./models/customers/customer"), exports);
28
+ __exportStar(require("./models/items/customField"), exports);
23
29
  __exportStar(require("./models/items/item"), exports);
24
30
  __exportStar(require("./models/items/itemField"), exports);
25
31
  __exportStar(require("./models/items/itemFieldValue"), exports);
32
+ __exportStar(require("./models/items/itemHistory"), exports);
33
+ __exportStar(require("./models/items/itemOnPlatform"), exports);
26
34
  __exportStar(require("./models/users/user"), exports);
35
+ __exportStar(require("./models/users/userOnPlatform"), exports);
36
+ __exportStar(require("./models/users/wallet"), exports);
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ export declare const ConnectorAccountPlatformSchema: z.ZodEnum<["VINTED", "SHOPIFY"]>;
3
+ export type ConnectorAccountPlatform = z.infer<typeof ConnectorAccountPlatformSchema>;
4
+ export declare const ConnectorAccountSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
7
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
8
+ credentials: z.ZodOptional<z.ZodString>;
9
+ data: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ id: string;
12
+ platform: "VINTED" | "SHOPIFY";
13
+ ownerId: string | number;
14
+ credentials?: string | undefined;
15
+ data?: string | undefined;
16
+ }, {
17
+ id: string;
18
+ platform: "VINTED" | "SHOPIFY";
19
+ ownerId: string | number;
20
+ credentials?: string | undefined;
21
+ data?: string | undefined;
22
+ }>;
23
+ export type ConnectorAccount = z.infer<typeof ConnectorAccountSchema>;
24
+ export declare const CreateConnectorAccountPayloadSchema: z.ZodObject<{
25
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
26
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
27
+ credentials: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ platform: "VINTED" | "SHOPIFY";
30
+ ownerId: string | number;
31
+ credentials: string;
32
+ }, {
33
+ platform: "VINTED" | "SHOPIFY";
34
+ ownerId: string | number;
35
+ credentials: string;
36
+ }>;
37
+ export type CreateConnectorAccountPayload = z.infer<typeof CreateConnectorAccountPayloadSchema>;
38
+ export declare const UpdateConnectorAccountPayloadSchema: z.ZodObject<{
39
+ credentials: z.ZodOptional<z.ZodString>;
40
+ data: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ credentials?: string | undefined;
43
+ data?: string | undefined;
44
+ }, {
45
+ credentials?: string | undefined;
46
+ data?: string | undefined;
47
+ }>;
48
+ export type UpdateConnectorAccountPayload = z.infer<typeof UpdateConnectorAccountPayloadSchema>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateConnectorAccountPayloadSchema = exports.CreateConnectorAccountPayloadSchema = exports.ConnectorAccountSchema = exports.ConnectorAccountPlatformSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../primitives");
6
+ exports.ConnectorAccountPlatformSchema = zod_1.z.enum(["VINTED", "SHOPIFY"]);
7
+ exports.ConnectorAccountSchema = zod_1.z.object({
8
+ id: zod_1.z.string().uuid(),
9
+ platform: exports.ConnectorAccountPlatformSchema,
10
+ ownerId: primitives_1.IdSchema,
11
+ credentials: zod_1.z.string().optional(),
12
+ data: zod_1.z.string().optional(),
13
+ });
14
+ exports.CreateConnectorAccountPayloadSchema = zod_1.z.object({
15
+ platform: exports.ConnectorAccountPlatformSchema,
16
+ ownerId: primitives_1.IdSchema,
17
+ credentials: zod_1.z.string(),
18
+ });
19
+ exports.UpdateConnectorAccountPayloadSchema = zod_1.z.object({
20
+ credentials: zod_1.z.string().optional(),
21
+ data: zod_1.z.string().optional(),
22
+ });
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ export declare const ConnectorAccountPlatformSchema: z.ZodEnum<["VINTED", "SHOPIFY"]>;
3
+ export type ConnectorAccountPlatform = z.infer<typeof ConnectorAccountPlatformSchema>;
4
+ export declare const ConnectorAccountSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
7
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
8
+ credentials: z.ZodOptional<z.ZodString>;
9
+ data: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ id: string;
12
+ platform: "VINTED" | "SHOPIFY";
13
+ ownerId: string | number;
14
+ credentials?: string | undefined;
15
+ data?: string | undefined;
16
+ }, {
17
+ id: string;
18
+ platform: "VINTED" | "SHOPIFY";
19
+ ownerId: string | number;
20
+ credentials?: string | undefined;
21
+ data?: string | undefined;
22
+ }>;
23
+ export type ConnectorAccount = z.infer<typeof ConnectorAccountSchema>;
24
+ export declare const CreateConnectorAccountPayloadSchema: z.ZodObject<{
25
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
26
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
27
+ credentials: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ platform: "VINTED" | "SHOPIFY";
30
+ ownerId: string | number;
31
+ credentials: string;
32
+ }, {
33
+ platform: "VINTED" | "SHOPIFY";
34
+ ownerId: string | number;
35
+ credentials: string;
36
+ }>;
37
+ export type CreateConnectorAccountPayload = z.infer<typeof CreateConnectorAccountPayloadSchema>;
38
+ export declare const UpdateConnectorAccountPayloadSchema: z.ZodObject<{
39
+ credentials: z.ZodOptional<z.ZodString>;
40
+ data: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ credentials?: string | undefined;
43
+ data?: string | undefined;
44
+ }, {
45
+ credentials?: string | undefined;
46
+ data?: string | undefined;
47
+ }>;
48
+ export type UpdateConnectorAccountPayload = z.infer<typeof UpdateConnectorAccountPayloadSchema>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateConnectorAccountPayloadSchema = exports.CreateConnectorAccountPayloadSchema = exports.ConnectorAccountSchema = exports.ConnectorAccountPlatformSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../primitives");
6
+ exports.ConnectorAccountPlatformSchema = zod_1.z.enum(["VINTED", "SHOPIFY"]);
7
+ exports.ConnectorAccountSchema = zod_1.z.object({
8
+ id: zod_1.z.string().uuid(),
9
+ platform: exports.ConnectorAccountPlatformSchema,
10
+ ownerId: primitives_1.IdSchema,
11
+ credentials: zod_1.z.string().optional(),
12
+ data: zod_1.z.string().optional(),
13
+ });
14
+ exports.CreateConnectorAccountPayloadSchema = zod_1.z.object({
15
+ platform: exports.ConnectorAccountPlatformSchema,
16
+ ownerId: primitives_1.IdSchema,
17
+ credentials: zod_1.z.string(),
18
+ });
19
+ exports.UpdateConnectorAccountPayloadSchema = zod_1.z.object({
20
+ credentials: zod_1.z.string().optional(),
21
+ data: zod_1.z.string().optional(),
22
+ });
@@ -0,0 +1,125 @@
1
+ import { z } from "zod";
2
+ export declare const JobRequestSchema: <Payload extends z.ZodTypeAny>(payload: Payload) => z.ZodObject<{
3
+ account: z.ZodObject<{
4
+ id: z.ZodString;
5
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
6
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
7
+ credentials: z.ZodOptional<z.ZodString>;
8
+ data: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ id: string;
11
+ platform: "VINTED" | "SHOPIFY";
12
+ ownerId: string | number;
13
+ credentials?: string | undefined;
14
+ data?: string | undefined;
15
+ }, {
16
+ id: string;
17
+ platform: "VINTED" | "SHOPIFY";
18
+ ownerId: string | number;
19
+ credentials?: string | undefined;
20
+ data?: string | undefined;
21
+ }>;
22
+ payload: Payload;
23
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
24
+ account: z.ZodObject<{
25
+ id: z.ZodString;
26
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
27
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
28
+ credentials: z.ZodOptional<z.ZodString>;
29
+ data: z.ZodOptional<z.ZodString>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ id: string;
32
+ platform: "VINTED" | "SHOPIFY";
33
+ ownerId: string | number;
34
+ credentials?: string | undefined;
35
+ data?: string | undefined;
36
+ }, {
37
+ id: string;
38
+ platform: "VINTED" | "SHOPIFY";
39
+ ownerId: string | number;
40
+ credentials?: string | undefined;
41
+ data?: string | undefined;
42
+ }>;
43
+ payload: Payload;
44
+ }>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
45
+ account: z.ZodObject<{
46
+ id: z.ZodString;
47
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
48
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
49
+ credentials: z.ZodOptional<z.ZodString>;
50
+ data: z.ZodOptional<z.ZodString>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ id: string;
53
+ platform: "VINTED" | "SHOPIFY";
54
+ ownerId: string | number;
55
+ credentials?: string | undefined;
56
+ data?: string | undefined;
57
+ }, {
58
+ id: string;
59
+ platform: "VINTED" | "SHOPIFY";
60
+ ownerId: string | number;
61
+ credentials?: string | undefined;
62
+ data?: string | undefined;
63
+ }>;
64
+ payload: Payload;
65
+ }>, any>[k]; } : never, z.baseObjectInputType<{
66
+ account: z.ZodObject<{
67
+ id: z.ZodString;
68
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
69
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
70
+ credentials: z.ZodOptional<z.ZodString>;
71
+ data: z.ZodOptional<z.ZodString>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ id: string;
74
+ platform: "VINTED" | "SHOPIFY";
75
+ ownerId: string | number;
76
+ credentials?: string | undefined;
77
+ data?: string | undefined;
78
+ }, {
79
+ id: string;
80
+ platform: "VINTED" | "SHOPIFY";
81
+ ownerId: string | number;
82
+ credentials?: string | undefined;
83
+ data?: string | undefined;
84
+ }>;
85
+ payload: Payload;
86
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<{
87
+ account: z.ZodObject<{
88
+ id: z.ZodString;
89
+ platform: z.ZodEnum<["VINTED", "SHOPIFY"]>;
90
+ ownerId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
91
+ credentials: z.ZodOptional<z.ZodString>;
92
+ data: z.ZodOptional<z.ZodString>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ id: string;
95
+ platform: "VINTED" | "SHOPIFY";
96
+ ownerId: string | number;
97
+ credentials?: string | undefined;
98
+ data?: string | undefined;
99
+ }, {
100
+ id: string;
101
+ platform: "VINTED" | "SHOPIFY";
102
+ ownerId: string | number;
103
+ credentials?: string | undefined;
104
+ data?: string | undefined;
105
+ }>;
106
+ payload: Payload;
107
+ }>[k_1]; } : never>;
108
+ export type JobRequest<Payload extends z.ZodTypeAny> = z.infer<ReturnType<typeof JobRequestSchema<Payload>>>;
109
+ export declare const JobResponseWebhookSchema: <Response extends z.ZodTypeAny>(response: Response) => z.ZodObject<{
110
+ accountId: z.ZodString;
111
+ response: Response;
112
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
113
+ accountId: z.ZodString;
114
+ response: Response;
115
+ }>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
116
+ accountId: z.ZodString;
117
+ response: Response;
118
+ }>, any>[k]; } : never, z.baseObjectInputType<{
119
+ accountId: z.ZodString;
120
+ response: Response;
121
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<{
122
+ accountId: z.ZodString;
123
+ response: Response;
124
+ }>[k_1]; } : never>;
125
+ export type JobResponseWebhook<Response extends z.ZodTypeAny> = z.infer<ReturnType<typeof JobResponseWebhookSchema<Response>>>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JobResponseWebhookSchema = exports.JobRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const account_1 = require("./account");
6
+ const JobRequestSchema = (payload) => zod_1.z.object({
7
+ account: account_1.ConnectorAccountSchema,
8
+ payload: payload,
9
+ });
10
+ exports.JobRequestSchema = JobRequestSchema;
11
+ const JobResponseWebhookSchema = (response) => zod_1.z.object({
12
+ accountId: zod_1.z.string().uuid(),
13
+ response: response,
14
+ });
15
+ exports.JobResponseWebhookSchema = JobResponseWebhookSchema;