controlresell 0.0.3 → 0.0.5

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.
@@ -1 +1,2 @@
1
- export {};
1
+ import { z } from "zod";
2
+ export declare const legacy: <T extends z.ZodTypeAny>(schema: T) => T;
@@ -1,46 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.legacy = void 0;
3
4
  const zod_1 = require("zod");
4
- // Function to convert snake_case to camelCase
5
5
  const toCamelCase = (str) => str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
6
- // Function to convert camelCase to snake_case
7
6
  const toSnakeCase = (str) => str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
8
- // Preprocessing function to handle input
9
7
  const snakeToCamel = (schema) => zod_1.z.preprocess((data) => {
10
8
  if (typeof data !== "object" || data === null)
11
9
  return data;
12
10
  const converted = Object.fromEntries(Object.entries(data).map(([key, value]) => [toCamelCase(key), value]));
13
- return { ...data, ...converted }; // Preserve both keys
11
+ return { ...data, ...converted };
14
12
  }, schema);
15
- // Post-processing function to add snake_case keys back
16
13
  const addSnakeCaseKeys = (schema) => schema.transform((data) => {
17
14
  if (typeof data !== "object" || data === null)
18
15
  return data;
19
16
  const converted = Object.fromEntries(Object.entries(data).map(([key, value]) => [toSnakeCase(key), value]));
20
- return { ...data, ...converted }; // Preserve both keys
17
+ return { ...data, ...converted };
21
18
  });
22
- // Define your schema
23
- const schema = addSnakeCaseKeys(snakeToCamel(zod_1.z.object({
24
- firstName: zod_1.z.string(),
25
- lastName: zod_1.z.string(),
26
- age: zod_1.z.number(),
27
- })));
28
- // Example input with snake_case
29
- const input = {
30
- first_name: "John",
31
- last_name: "Doe",
32
- age: 30,
33
- };
34
- // Parsing input
35
- const parsed = schema.parse(input);
36
- console.log(parsed);
37
- /*
38
- Output:
39
- {
40
- firstName: 'John',
41
- lastName: 'Doe',
42
- age: 30,
43
- first_name: 'John',
44
- last_name: 'Doe'
45
- }
46
- */
19
+ const legacy = (schema) => addSnakeCaseKeys(snakeToCamel(schema));
20
+ exports.legacy = legacy;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,12 @@
2
2
  * @file Automatically generated by barrelsby.
3
3
  */
4
4
  export * from "./helpers/json";
5
+ export * from "./helpers/legacy";
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";
5
11
  export * from "./models/items/item";
6
12
  export * from "./models/items/itemField";
7
13
  export * from "./models/items/itemFieldValue";
package/dist/index.js CHANGED
@@ -18,6 +18,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  __exportStar(require("./helpers/json"), exports);
21
+ __exportStar(require("./helpers/legacy"), exports);
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);
21
27
  __exportStar(require("./models/items/item"), exports);
22
28
  __exportStar(require("./models/items/itemField"), exports);
23
29
  __exportStar(require("./models/items/itemFieldValue"), 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;
@@ -0,0 +1,631 @@
1
+ import { z } from "zod";
2
+ export declare const JobPostSchema: z.ZodObject<{
3
+ brand: z.ZodString;
4
+ catalogId: z.ZodNumber;
5
+ colorIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
6
+ description: z.ZodString;
7
+ measurementLength: z.ZodOptional<z.ZodNumber>;
8
+ measurementWidth: z.ZodOptional<z.ZodNumber>;
9
+ packageSizeId: z.ZodNumber;
10
+ photoUrls: z.ZodArray<z.ZodString, "many">;
11
+ price: z.ZodNumber;
12
+ sizeId: z.ZodOptional<z.ZodNumber>;
13
+ statusId: z.ZodNumber;
14
+ title: z.ZodString;
15
+ isDraft: z.ZodBoolean;
16
+ material: z.ZodArray<z.ZodNumber, "many">;
17
+ manufacturerLabelling: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ brand: string;
20
+ catalogId: number;
21
+ description: string;
22
+ packageSizeId: number;
23
+ photoUrls: string[];
24
+ price: number;
25
+ statusId: number;
26
+ title: string;
27
+ isDraft: boolean;
28
+ material: number[];
29
+ manufacturerLabelling: string;
30
+ colorIds?: number[] | undefined;
31
+ measurementLength?: number | undefined;
32
+ measurementWidth?: number | undefined;
33
+ sizeId?: number | undefined;
34
+ }, {
35
+ brand: string;
36
+ catalogId: number;
37
+ description: string;
38
+ packageSizeId: number;
39
+ photoUrls: string[];
40
+ price: number;
41
+ statusId: number;
42
+ title: string;
43
+ isDraft: boolean;
44
+ material: number[];
45
+ manufacturerLabelling: string;
46
+ colorIds?: number[] | undefined;
47
+ measurementLength?: number | undefined;
48
+ measurementWidth?: number | undefined;
49
+ sizeId?: number | undefined;
50
+ }>;
51
+ export type JobPost = z.infer<typeof JobPostSchema>;
52
+ export declare const JobPostsCreatePayloadSchema: z.ZodObject<{
53
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
54
+ post: z.ZodObject<{
55
+ brand: z.ZodString;
56
+ catalogId: z.ZodNumber;
57
+ colorIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
58
+ description: z.ZodString;
59
+ measurementLength: z.ZodOptional<z.ZodNumber>;
60
+ measurementWidth: z.ZodOptional<z.ZodNumber>;
61
+ packageSizeId: z.ZodNumber;
62
+ photoUrls: z.ZodArray<z.ZodString, "many">;
63
+ price: z.ZodNumber;
64
+ sizeId: z.ZodOptional<z.ZodNumber>;
65
+ statusId: z.ZodNumber;
66
+ title: z.ZodString;
67
+ isDraft: z.ZodBoolean;
68
+ material: z.ZodArray<z.ZodNumber, "many">;
69
+ manufacturerLabelling: z.ZodString;
70
+ }, "strip", z.ZodTypeAny, {
71
+ brand: string;
72
+ catalogId: number;
73
+ description: string;
74
+ packageSizeId: number;
75
+ photoUrls: string[];
76
+ price: number;
77
+ statusId: number;
78
+ title: string;
79
+ isDraft: boolean;
80
+ material: number[];
81
+ manufacturerLabelling: string;
82
+ colorIds?: number[] | undefined;
83
+ measurementLength?: number | undefined;
84
+ measurementWidth?: number | undefined;
85
+ sizeId?: number | undefined;
86
+ }, {
87
+ brand: string;
88
+ catalogId: number;
89
+ description: string;
90
+ packageSizeId: number;
91
+ photoUrls: string[];
92
+ price: number;
93
+ statusId: number;
94
+ title: string;
95
+ isDraft: boolean;
96
+ material: number[];
97
+ manufacturerLabelling: string;
98
+ colorIds?: number[] | undefined;
99
+ measurementLength?: number | undefined;
100
+ measurementWidth?: number | undefined;
101
+ sizeId?: number | undefined;
102
+ }>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ itemId: string | number;
105
+ post: {
106
+ brand: string;
107
+ catalogId: number;
108
+ description: string;
109
+ packageSizeId: number;
110
+ photoUrls: string[];
111
+ price: number;
112
+ statusId: number;
113
+ title: string;
114
+ isDraft: boolean;
115
+ material: number[];
116
+ manufacturerLabelling: string;
117
+ colorIds?: number[] | undefined;
118
+ measurementLength?: number | undefined;
119
+ measurementWidth?: number | undefined;
120
+ sizeId?: number | undefined;
121
+ };
122
+ }, {
123
+ itemId: string | number;
124
+ post: {
125
+ brand: string;
126
+ catalogId: number;
127
+ description: string;
128
+ packageSizeId: number;
129
+ photoUrls: string[];
130
+ price: number;
131
+ statusId: number;
132
+ title: string;
133
+ isDraft: boolean;
134
+ material: number[];
135
+ manufacturerLabelling: string;
136
+ colorIds?: number[] | undefined;
137
+ measurementLength?: number | undefined;
138
+ measurementWidth?: number | undefined;
139
+ sizeId?: number | undefined;
140
+ };
141
+ }>;
142
+ export type JobPostsCreatePayload = z.infer<typeof JobPostsCreatePayloadSchema>;
143
+ export declare const JobPostsCreatePayloadWithAccounts: z.ZodObject<{
144
+ accountsId: z.ZodArray<z.ZodString, "many">;
145
+ payload: z.ZodObject<{
146
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
147
+ post: z.ZodObject<{
148
+ brand: z.ZodString;
149
+ catalogId: z.ZodNumber;
150
+ colorIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
151
+ description: z.ZodString;
152
+ measurementLength: z.ZodOptional<z.ZodNumber>;
153
+ measurementWidth: z.ZodOptional<z.ZodNumber>;
154
+ packageSizeId: z.ZodNumber;
155
+ photoUrls: z.ZodArray<z.ZodString, "many">;
156
+ price: z.ZodNumber;
157
+ sizeId: z.ZodOptional<z.ZodNumber>;
158
+ statusId: z.ZodNumber;
159
+ title: z.ZodString;
160
+ isDraft: z.ZodBoolean;
161
+ material: z.ZodArray<z.ZodNumber, "many">;
162
+ manufacturerLabelling: z.ZodString;
163
+ }, "strip", z.ZodTypeAny, {
164
+ brand: string;
165
+ catalogId: number;
166
+ description: string;
167
+ packageSizeId: number;
168
+ photoUrls: string[];
169
+ price: number;
170
+ statusId: number;
171
+ title: string;
172
+ isDraft: boolean;
173
+ material: number[];
174
+ manufacturerLabelling: string;
175
+ colorIds?: number[] | undefined;
176
+ measurementLength?: number | undefined;
177
+ measurementWidth?: number | undefined;
178
+ sizeId?: number | undefined;
179
+ }, {
180
+ brand: string;
181
+ catalogId: number;
182
+ description: string;
183
+ packageSizeId: number;
184
+ photoUrls: string[];
185
+ price: number;
186
+ statusId: number;
187
+ title: string;
188
+ isDraft: boolean;
189
+ material: number[];
190
+ manufacturerLabelling: string;
191
+ colorIds?: number[] | undefined;
192
+ measurementLength?: number | undefined;
193
+ measurementWidth?: number | undefined;
194
+ sizeId?: number | undefined;
195
+ }>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ itemId: string | number;
198
+ post: {
199
+ brand: string;
200
+ catalogId: number;
201
+ description: string;
202
+ packageSizeId: number;
203
+ photoUrls: string[];
204
+ price: number;
205
+ statusId: number;
206
+ title: string;
207
+ isDraft: boolean;
208
+ material: number[];
209
+ manufacturerLabelling: string;
210
+ colorIds?: number[] | undefined;
211
+ measurementLength?: number | undefined;
212
+ measurementWidth?: number | undefined;
213
+ sizeId?: number | undefined;
214
+ };
215
+ }, {
216
+ itemId: string | number;
217
+ post: {
218
+ brand: string;
219
+ catalogId: number;
220
+ description: string;
221
+ packageSizeId: number;
222
+ photoUrls: string[];
223
+ price: number;
224
+ statusId: number;
225
+ title: string;
226
+ isDraft: boolean;
227
+ material: number[];
228
+ manufacturerLabelling: string;
229
+ colorIds?: number[] | undefined;
230
+ measurementLength?: number | undefined;
231
+ measurementWidth?: number | undefined;
232
+ sizeId?: number | undefined;
233
+ };
234
+ }>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ payload: {
237
+ itemId: string | number;
238
+ post: {
239
+ brand: string;
240
+ catalogId: number;
241
+ description: string;
242
+ packageSizeId: number;
243
+ photoUrls: string[];
244
+ price: number;
245
+ statusId: number;
246
+ title: string;
247
+ isDraft: boolean;
248
+ material: number[];
249
+ manufacturerLabelling: string;
250
+ colorIds?: number[] | undefined;
251
+ measurementLength?: number | undefined;
252
+ measurementWidth?: number | undefined;
253
+ sizeId?: number | undefined;
254
+ };
255
+ };
256
+ accountsId: string[];
257
+ }, {
258
+ payload: {
259
+ itemId: string | number;
260
+ post: {
261
+ brand: string;
262
+ catalogId: number;
263
+ description: string;
264
+ packageSizeId: number;
265
+ photoUrls: string[];
266
+ price: number;
267
+ statusId: number;
268
+ title: string;
269
+ isDraft: boolean;
270
+ material: number[];
271
+ manufacturerLabelling: string;
272
+ colorIds?: number[] | undefined;
273
+ measurementLength?: number | undefined;
274
+ measurementWidth?: number | undefined;
275
+ sizeId?: number | undefined;
276
+ };
277
+ };
278
+ accountsId: string[];
279
+ }>;
280
+ export type JobPostsCreatePayloadWithAccounts = z.infer<typeof JobPostsCreatePayloadWithAccounts>;
281
+ export declare const JobPostsCreateResponseSchema: z.ZodObject<{
282
+ platformId: z.ZodString;
283
+ platformUrl: z.ZodString;
284
+ itemId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
285
+ }, "strip", z.ZodTypeAny, {
286
+ itemId: string | number;
287
+ platformId: string;
288
+ platformUrl: string;
289
+ }, {
290
+ itemId: string | number;
291
+ platformId: string;
292
+ platformUrl: string;
293
+ }>;
294
+ export type JobPostsCreateResponse = z.infer<typeof JobPostsCreateResponseSchema>;
295
+ export declare const JobPostsDeletePayloadSchema: z.ZodObject<{
296
+ accountId: z.ZodString;
297
+ platformId: z.ZodString;
298
+ }, "strip", z.ZodTypeAny, {
299
+ accountId: string;
300
+ platformId: string;
301
+ }, {
302
+ accountId: string;
303
+ platformId: string;
304
+ }>;
305
+ export type JobPostsDeletePayload = z.infer<typeof JobPostsDeletePayloadSchema>;
306
+ export declare const JobPostsDeletePayloadListSchema: z.ZodObject<{
307
+ payloads: z.ZodArray<z.ZodObject<{
308
+ accountId: z.ZodString;
309
+ platformId: z.ZodString;
310
+ }, "strip", z.ZodTypeAny, {
311
+ accountId: string;
312
+ platformId: string;
313
+ }, {
314
+ accountId: string;
315
+ platformId: string;
316
+ }>, "many">;
317
+ }, "strip", z.ZodTypeAny, {
318
+ payloads: {
319
+ accountId: string;
320
+ platformId: string;
321
+ }[];
322
+ }, {
323
+ payloads: {
324
+ accountId: string;
325
+ platformId: string;
326
+ }[];
327
+ }>;
328
+ export type JobPostsDeletePayloadList = z.infer<typeof JobPostsDeletePayloadListSchema>;
329
+ export declare const JobPostsDeleteResponseSchema: z.ZodObject<{
330
+ accountId: z.ZodString;
331
+ platformId: z.ZodString;
332
+ }, "strip", z.ZodTypeAny, {
333
+ accountId: string;
334
+ platformId: string;
335
+ }, {
336
+ accountId: string;
337
+ platformId: string;
338
+ }>;
339
+ export type JobPostsDeleteResponse = z.infer<typeof JobPostsDeleteResponseSchema>;
340
+ export declare const JobPostsListPayloadSchema: z.ZodObject<{
341
+ lastRetrieve: z.ZodOptional<z.ZodString>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ lastRetrieve?: string | undefined;
344
+ }, {
345
+ lastRetrieve?: string | undefined;
346
+ }>;
347
+ export type JobPostsListPayload = z.infer<typeof JobPostsListPayloadSchema>;
348
+ export declare const JobPostsListPayloadWithAccountSchema: z.ZodObject<{
349
+ accountId: z.ZodString;
350
+ }, "strip", z.ZodTypeAny, {
351
+ accountId: string;
352
+ }, {
353
+ accountId: string;
354
+ }>;
355
+ export type JobPostsListPayloadWithAccount = z.infer<typeof JobPostsListPayloadWithAccountSchema>;
356
+ export declare const JobPostsListResponseSchema: z.ZodObject<{
357
+ items: z.ZodArray<z.ZodObject<{
358
+ brand: z.ZodString;
359
+ catalogId: z.ZodNumber;
360
+ colorIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
361
+ description: z.ZodString;
362
+ measurementLength: z.ZodOptional<z.ZodNumber>;
363
+ measurementWidth: z.ZodOptional<z.ZodNumber>;
364
+ packageSizeId: z.ZodNumber;
365
+ photoUrls: z.ZodArray<z.ZodString, "many">;
366
+ price: z.ZodNumber;
367
+ sizeId: z.ZodOptional<z.ZodNumber>;
368
+ statusId: z.ZodNumber;
369
+ title: z.ZodString;
370
+ isDraft: z.ZodBoolean;
371
+ material: z.ZodArray<z.ZodNumber, "many">;
372
+ manufacturerLabelling: z.ZodString;
373
+ }, "strip", z.ZodTypeAny, {
374
+ brand: string;
375
+ catalogId: number;
376
+ description: string;
377
+ packageSizeId: number;
378
+ photoUrls: string[];
379
+ price: number;
380
+ statusId: number;
381
+ title: string;
382
+ isDraft: boolean;
383
+ material: number[];
384
+ manufacturerLabelling: string;
385
+ colorIds?: number[] | undefined;
386
+ measurementLength?: number | undefined;
387
+ measurementWidth?: number | undefined;
388
+ sizeId?: number | undefined;
389
+ }, {
390
+ brand: string;
391
+ catalogId: number;
392
+ description: string;
393
+ packageSizeId: number;
394
+ photoUrls: string[];
395
+ price: number;
396
+ statusId: number;
397
+ title: string;
398
+ isDraft: boolean;
399
+ material: number[];
400
+ manufacturerLabelling: string;
401
+ colorIds?: number[] | undefined;
402
+ measurementLength?: number | undefined;
403
+ measurementWidth?: number | undefined;
404
+ sizeId?: number | undefined;
405
+ }>, "many">;
406
+ }, "strip", z.ZodTypeAny, {
407
+ items: {
408
+ brand: string;
409
+ catalogId: number;
410
+ description: string;
411
+ packageSizeId: number;
412
+ photoUrls: string[];
413
+ price: number;
414
+ statusId: number;
415
+ title: string;
416
+ isDraft: boolean;
417
+ material: number[];
418
+ manufacturerLabelling: string;
419
+ colorIds?: number[] | undefined;
420
+ measurementLength?: number | undefined;
421
+ measurementWidth?: number | undefined;
422
+ sizeId?: number | undefined;
423
+ }[];
424
+ }, {
425
+ items: {
426
+ brand: string;
427
+ catalogId: number;
428
+ description: string;
429
+ packageSizeId: number;
430
+ photoUrls: string[];
431
+ price: number;
432
+ statusId: number;
433
+ title: string;
434
+ isDraft: boolean;
435
+ material: number[];
436
+ manufacturerLabelling: string;
437
+ colorIds?: number[] | undefined;
438
+ measurementLength?: number | undefined;
439
+ measurementWidth?: number | undefined;
440
+ sizeId?: number | undefined;
441
+ }[];
442
+ }>;
443
+ export type JobPostsListResponse = z.infer<typeof JobPostsListResponseSchema>;
444
+ export declare const JobPostsUpdatePayloadSchema: z.ZodObject<{
445
+ accountId: z.ZodString;
446
+ platformId: z.ZodString;
447
+ post: z.ZodObject<{
448
+ brand: z.ZodString;
449
+ catalogId: z.ZodNumber;
450
+ colorIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
451
+ description: z.ZodString;
452
+ measurementLength: z.ZodOptional<z.ZodNumber>;
453
+ measurementWidth: z.ZodOptional<z.ZodNumber>;
454
+ packageSizeId: z.ZodNumber;
455
+ photoUrls: z.ZodArray<z.ZodString, "many">;
456
+ price: z.ZodNumber;
457
+ sizeId: z.ZodOptional<z.ZodNumber>;
458
+ statusId: z.ZodNumber;
459
+ title: z.ZodString;
460
+ isDraft: z.ZodBoolean;
461
+ material: z.ZodArray<z.ZodNumber, "many">;
462
+ manufacturerLabelling: z.ZodString;
463
+ }, "strip", z.ZodTypeAny, {
464
+ brand: string;
465
+ catalogId: number;
466
+ description: string;
467
+ packageSizeId: number;
468
+ photoUrls: string[];
469
+ price: number;
470
+ statusId: number;
471
+ title: string;
472
+ isDraft: boolean;
473
+ material: number[];
474
+ manufacturerLabelling: string;
475
+ colorIds?: number[] | undefined;
476
+ measurementLength?: number | undefined;
477
+ measurementWidth?: number | undefined;
478
+ sizeId?: number | undefined;
479
+ }, {
480
+ brand: string;
481
+ catalogId: number;
482
+ description: string;
483
+ packageSizeId: number;
484
+ photoUrls: string[];
485
+ price: number;
486
+ statusId: number;
487
+ title: string;
488
+ isDraft: boolean;
489
+ material: number[];
490
+ manufacturerLabelling: string;
491
+ colorIds?: number[] | undefined;
492
+ measurementLength?: number | undefined;
493
+ measurementWidth?: number | undefined;
494
+ sizeId?: number | undefined;
495
+ }>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ accountId: string;
498
+ post: {
499
+ brand: string;
500
+ catalogId: number;
501
+ description: string;
502
+ packageSizeId: number;
503
+ photoUrls: string[];
504
+ price: number;
505
+ statusId: number;
506
+ title: string;
507
+ isDraft: boolean;
508
+ material: number[];
509
+ manufacturerLabelling: string;
510
+ colorIds?: number[] | undefined;
511
+ measurementLength?: number | undefined;
512
+ measurementWidth?: number | undefined;
513
+ sizeId?: number | undefined;
514
+ };
515
+ platformId: string;
516
+ }, {
517
+ accountId: string;
518
+ post: {
519
+ brand: string;
520
+ catalogId: number;
521
+ description: string;
522
+ packageSizeId: number;
523
+ photoUrls: string[];
524
+ price: number;
525
+ statusId: number;
526
+ title: string;
527
+ isDraft: boolean;
528
+ material: number[];
529
+ manufacturerLabelling: string;
530
+ colorIds?: number[] | undefined;
531
+ measurementLength?: number | undefined;
532
+ measurementWidth?: number | undefined;
533
+ sizeId?: number | undefined;
534
+ };
535
+ platformId: string;
536
+ }>;
537
+ export type JobPostsUpdatePayload = z.infer<typeof JobPostsUpdatePayloadSchema>;
538
+ export declare const JobPostsUpdateResponseSchema: z.ZodObject<{
539
+ accountId: z.ZodString;
540
+ platformId: z.ZodString;
541
+ post: z.ZodObject<{
542
+ brand: z.ZodString;
543
+ catalogId: z.ZodNumber;
544
+ colorIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
545
+ description: z.ZodString;
546
+ measurementLength: z.ZodOptional<z.ZodNumber>;
547
+ measurementWidth: z.ZodOptional<z.ZodNumber>;
548
+ packageSizeId: z.ZodNumber;
549
+ photoUrls: z.ZodArray<z.ZodString, "many">;
550
+ price: z.ZodNumber;
551
+ sizeId: z.ZodOptional<z.ZodNumber>;
552
+ statusId: z.ZodNumber;
553
+ title: z.ZodString;
554
+ isDraft: z.ZodBoolean;
555
+ material: z.ZodArray<z.ZodNumber, "many">;
556
+ manufacturerLabelling: z.ZodString;
557
+ }, "strip", z.ZodTypeAny, {
558
+ brand: string;
559
+ catalogId: number;
560
+ description: string;
561
+ packageSizeId: number;
562
+ photoUrls: string[];
563
+ price: number;
564
+ statusId: number;
565
+ title: string;
566
+ isDraft: boolean;
567
+ material: number[];
568
+ manufacturerLabelling: string;
569
+ colorIds?: number[] | undefined;
570
+ measurementLength?: number | undefined;
571
+ measurementWidth?: number | undefined;
572
+ sizeId?: number | undefined;
573
+ }, {
574
+ brand: string;
575
+ catalogId: number;
576
+ description: string;
577
+ packageSizeId: number;
578
+ photoUrls: string[];
579
+ price: number;
580
+ statusId: number;
581
+ title: string;
582
+ isDraft: boolean;
583
+ material: number[];
584
+ manufacturerLabelling: string;
585
+ colorIds?: number[] | undefined;
586
+ measurementLength?: number | undefined;
587
+ measurementWidth?: number | undefined;
588
+ sizeId?: number | undefined;
589
+ }>;
590
+ }, "strip", z.ZodTypeAny, {
591
+ accountId: string;
592
+ post: {
593
+ brand: string;
594
+ catalogId: number;
595
+ description: string;
596
+ packageSizeId: number;
597
+ photoUrls: string[];
598
+ price: number;
599
+ statusId: number;
600
+ title: string;
601
+ isDraft: boolean;
602
+ material: number[];
603
+ manufacturerLabelling: string;
604
+ colorIds?: number[] | undefined;
605
+ measurementLength?: number | undefined;
606
+ measurementWidth?: number | undefined;
607
+ sizeId?: number | undefined;
608
+ };
609
+ platformId: string;
610
+ }, {
611
+ accountId: string;
612
+ post: {
613
+ brand: string;
614
+ catalogId: number;
615
+ description: string;
616
+ packageSizeId: number;
617
+ photoUrls: string[];
618
+ price: number;
619
+ statusId: number;
620
+ title: string;
621
+ isDraft: boolean;
622
+ material: number[];
623
+ manufacturerLabelling: string;
624
+ colorIds?: number[] | undefined;
625
+ measurementLength?: number | undefined;
626
+ measurementWidth?: number | undefined;
627
+ sizeId?: number | undefined;
628
+ };
629
+ platformId: string;
630
+ }>;
631
+ export type JobPostsUpdateResponse = z.infer<typeof JobPostsUpdateResponseSchema>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JobPostsUpdateResponseSchema = exports.JobPostsUpdatePayloadSchema = exports.JobPostsListResponseSchema = exports.JobPostsListPayloadWithAccountSchema = exports.JobPostsListPayloadSchema = exports.JobPostsDeleteResponseSchema = exports.JobPostsDeletePayloadListSchema = exports.JobPostsDeletePayloadSchema = exports.JobPostsCreateResponseSchema = exports.JobPostsCreatePayloadWithAccounts = exports.JobPostsCreatePayloadSchema = exports.JobPostSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../../primitives");
6
+ exports.JobPostSchema = zod_1.z.object({
7
+ brand: zod_1.z.string(),
8
+ catalogId: zod_1.z.number(),
9
+ colorIds: zod_1.z.array(zod_1.z.number()).optional(),
10
+ description: zod_1.z.string(),
11
+ measurementLength: zod_1.z.number().optional(),
12
+ measurementWidth: zod_1.z.number().optional(),
13
+ packageSizeId: zod_1.z.number(),
14
+ photoUrls: zod_1.z.array(zod_1.z.string()),
15
+ price: zod_1.z.number(),
16
+ sizeId: zod_1.z.number().optional(),
17
+ statusId: zod_1.z.number(),
18
+ title: zod_1.z.string(),
19
+ isDraft: zod_1.z.boolean(),
20
+ material: zod_1.z.array(zod_1.z.number()),
21
+ manufacturerLabelling: zod_1.z.string(),
22
+ });
23
+ exports.JobPostsCreatePayloadSchema = zod_1.z.object({
24
+ itemId: primitives_1.IdSchema,
25
+ post: exports.JobPostSchema,
26
+ });
27
+ exports.JobPostsCreatePayloadWithAccounts = zod_1.z.object({
28
+ accountsId: zod_1.z.array(zod_1.z.string().uuid()),
29
+ payload: exports.JobPostsCreatePayloadSchema,
30
+ });
31
+ exports.JobPostsCreateResponseSchema = zod_1.z.object({
32
+ platformId: zod_1.z.string(),
33
+ platformUrl: zod_1.z.string(),
34
+ itemId: primitives_1.IdSchema,
35
+ });
36
+ exports.JobPostsDeletePayloadSchema = zod_1.z.object({
37
+ accountId: zod_1.z.string().uuid(),
38
+ platformId: zod_1.z.string(),
39
+ });
40
+ exports.JobPostsDeletePayloadListSchema = zod_1.z.object({
41
+ payloads: zod_1.z.array(exports.JobPostsDeletePayloadSchema),
42
+ });
43
+ exports.JobPostsDeleteResponseSchema = zod_1.z.object({
44
+ accountId: zod_1.z.string().uuid(),
45
+ platformId: zod_1.z.string(),
46
+ });
47
+ exports.JobPostsListPayloadSchema = zod_1.z.object({
48
+ lastRetrieve: zod_1.z.string().optional(),
49
+ });
50
+ exports.JobPostsListPayloadWithAccountSchema = zod_1.z.object({
51
+ accountId: zod_1.z.string().uuid(),
52
+ });
53
+ exports.JobPostsListResponseSchema = zod_1.z.object({
54
+ items: zod_1.z.array(exports.JobPostSchema),
55
+ });
56
+ exports.JobPostsUpdatePayloadSchema = zod_1.z.object({
57
+ accountId: zod_1.z.string().uuid(),
58
+ platformId: zod_1.z.string(),
59
+ post: exports.JobPostSchema,
60
+ });
61
+ exports.JobPostsUpdateResponseSchema = zod_1.z.object({
62
+ accountId: zod_1.z.string().uuid(),
63
+ platformId: zod_1.z.string(),
64
+ post: exports.JobPostSchema,
65
+ });
@@ -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 accounts_1 = require("./accounts");
6
+ const JobRequestSchema = (payload) => zod_1.z.object({
7
+ account: accounts_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;
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const RabbitMQRoutingKeySchema: z.ZodEnum<["posts.create", "posts.list", "posts.delete", "posts.update"]>;
3
+ export type RabbitMQRoutingKey = z.infer<typeof RabbitMQRoutingKeySchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RabbitMQRoutingKeySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.RabbitMQRoutingKeySchema = zod_1.z.enum([
6
+ "posts.create", "posts.list", "posts.delete", "posts.update",
7
+ ]);
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
2
  export declare const ItemFieldValuePayloadSchema: z.ZodObject<{
3
- field_id: z.ZodNumber;
3
+ fieldId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
4
4
  value: z.ZodString;
5
5
  }, "strip", z.ZodTypeAny, {
6
6
  value: string;
7
- field_id: number;
7
+ fieldId: string | number;
8
8
  }, {
9
9
  value: string;
10
- field_id: number;
10
+ fieldId: string | number;
11
11
  }>;
12
12
  export type ItemFieldValuePayload = z.infer<typeof ItemFieldValuePayloadSchema>;
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ItemFieldValuePayloadSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.ItemFieldValuePayloadSchema = zod_1.z.object({
6
- field_id: zod_1.z.number(),
5
+ const legacy_1 = require("../../helpers/legacy");
6
+ const primitives_1 = require("../primitives");
7
+ exports.ItemFieldValuePayloadSchema = (0, legacy_1.legacy)(zod_1.z.object({
8
+ fieldId: primitives_1.IdSchema,
7
9
  value: zod_1.z.string(),
8
- });
10
+ }));
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const IdSchema: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
3
+ export type Id = z.infer<typeof IdSchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.IdSchema = zod_1.z.union([
6
+ zod_1.z.number(), zod_1.z.string().uuid(),
7
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "controlresell",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.js",