@floristcloud/api-lib 1.2.7 → 1.2.8

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.
@@ -18,7 +18,7 @@ __exportStar(require("./register-user.command"), exports);
18
18
  __exportStar(require("./reset-password-by-user.command"), exports);
19
19
  __exportStar(require("./reset-password-by-admin.command"), exports);
20
20
  __exportStar(require("./login-user.command"), exports);
21
- __exportStar(require("./list-mobile-buyer-tenants-by-phone.command"), exports);
21
+ __exportStar(require("./list-mobile-buyer-tenants.command"), exports);
22
22
  __exportStar(require("./reset-password-by-token.command"), exports);
23
23
  __exportStar(require("./restore-password-by-security-code.command"), exports);
24
24
  __exportStar(require("./reset-password-by-security-code.command"), exports);
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListMobileBuyerTenantsContractCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const ListMobileBuyerTenantsRequestSchema = zod_1.z
6
+ .object({
7
+ phone: zod_1.z.string().min(1).optional(),
8
+ email: zod_1.z.email().optional(),
9
+ })
10
+ .refine((data) => data.phone || data.email, {
11
+ message: 'Either phone or email must be provided',
12
+ });
13
+ const MobileBuyerTenantItemSchema = zod_1.z.object({
14
+ companyUUID: zod_1.z.uuid(),
15
+ displayName: zod_1.z.string(),
16
+ domain: zod_1.z.string().nullable(),
17
+ });
18
+ const ListMobileBuyerTenantsResponseSchema = zod_1.z.object({
19
+ items: zod_1.z.array(MobileBuyerTenantItemSchema),
20
+ });
21
+ var ListMobileBuyerTenantsContractCommand;
22
+ (function (ListMobileBuyerTenantsContractCommand) {
23
+ ListMobileBuyerTenantsContractCommand.RequestSchema = ListMobileBuyerTenantsRequestSchema;
24
+ ListMobileBuyerTenantsContractCommand.ResponseSchema = ListMobileBuyerTenantsResponseSchema;
25
+ })(ListMobileBuyerTenantsContractCommand || (exports.ListMobileBuyerTenantsContractCommand = ListMobileBuyerTenantsContractCommand = {}));
@@ -488,6 +488,8 @@ exports.ERRORS = {
488
488
  CATEGORY_NOT_UPDATED: { code: 'CA014', message: 'Failed to update category', httpCode: 500 },
489
489
  CATEGORY_CREATE_MANY_FAILED: { code: 'CA015', message: 'Failed to create many categories', httpCode: 500 },
490
490
  CATEGORY_USE_IN_PRODUCT: { code: 'CA016', message: 'Category use in product', httpCode: 500 },
491
+ CATEGORY_USE_IN_PRE_ORDER_COLLECTION_ITEM: { code: 'CA017', message: 'Category use in pre order collection item', httpCode: 500 },
492
+ CATEGORY_USE_IN_PRODUCT_IMAGE: { code: 'CA018', message: 'Category use in product image', httpCode: 500 },
491
493
  // CATEGORY ALIAS
492
494
  ALIAS_NOT_CREATED: { code: 'AL009', message: 'Failed to create category-category-category-alias', httpCode: 500 },
493
495
  ALIAS_NOT_FOUND: { code: 'AL010', message: 'Alias with this relation not found', httpCode: 404 },
@@ -2,7 +2,7 @@ export * from './register-user.command';
2
2
  export * from './reset-password-by-user.command';
3
3
  export * from './reset-password-by-admin.command';
4
4
  export * from './login-user.command';
5
- export * from './list-mobile-buyer-tenants-by-phone.command';
5
+ export * from './list-mobile-buyer-tenants.command';
6
6
  export * from './reset-password-by-token.command';
7
7
  export * from './restore-password-by-security-code.command';
8
8
  export * from './reset-password-by-security-code.command';
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+
3
+ const ListMobileBuyerTenantsRequestSchema = z
4
+ .object({
5
+ phone: z.string().min(1).optional(),
6
+ email: z.email().optional(),
7
+ })
8
+ .refine((data) => data.phone || data.email, {
9
+ message: 'Either phone or email must be provided',
10
+ });
11
+
12
+ const MobileBuyerTenantItemSchema = z.object({
13
+ companyUUID: z.uuid(),
14
+ displayName: z.string(),
15
+ domain: z.string().nullable(),
16
+ });
17
+
18
+ const ListMobileBuyerTenantsResponseSchema = z.object({
19
+ items: z.array(MobileBuyerTenantItemSchema),
20
+ });
21
+
22
+ export namespace ListMobileBuyerTenantsContractCommand {
23
+ export const RequestSchema = ListMobileBuyerTenantsRequestSchema;
24
+ export type Request = z.infer<typeof RequestSchema>;
25
+
26
+ export const ResponseSchema = ListMobileBuyerTenantsResponseSchema;
27
+ export type Response = z.infer<typeof ResponseSchema>;
28
+ }
package/constant/error.ts CHANGED
@@ -510,6 +510,8 @@ export const ERRORS = {
510
510
  CATEGORY_NOT_UPDATED: { code: 'CA014', message: 'Failed to update category', httpCode: 500 },
511
511
  CATEGORY_CREATE_MANY_FAILED: { code: 'CA015', message: 'Failed to create many categories', httpCode: 500 },
512
512
  CATEGORY_USE_IN_PRODUCT: { code: 'CA016', message: 'Category use in product', httpCode: 500 },
513
+ CATEGORY_USE_IN_PRE_ORDER_COLLECTION_ITEM: { code: 'CA017', message: 'Category use in pre order collection item', httpCode: 500 },
514
+ CATEGORY_USE_IN_PRODUCT_IMAGE: { code: 'CA018', message: 'Category use in product image', httpCode: 500 },
513
515
 
514
516
  // CATEGORY ALIAS
515
517
  ALIAS_NOT_CREATED: { code: 'AL009', message: 'Failed to create category-category-category-alias', httpCode: 500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListMobileBuyerTenantsByPhoneContractCommand = void 0;
4
- const zod_1 = require("zod");
5
- const ListMobileBuyerTenantsByPhoneRequestSchema = zod_1.z.object({
6
- phone: zod_1.z.string().min(1),
7
- });
8
- const MobileBuyerTenantItemSchema = zod_1.z.object({
9
- companyUUID: zod_1.z.uuid(),
10
- displayName: zod_1.z.string(),
11
- domain: zod_1.z.string().nullable(),
12
- });
13
- const ListMobileBuyerTenantsByPhoneResponseSchema = zod_1.z.object({
14
- items: zod_1.z.array(MobileBuyerTenantItemSchema),
15
- });
16
- var ListMobileBuyerTenantsByPhoneContractCommand;
17
- (function (ListMobileBuyerTenantsByPhoneContractCommand) {
18
- ListMobileBuyerTenantsByPhoneContractCommand.RequestSchema = ListMobileBuyerTenantsByPhoneRequestSchema;
19
- ListMobileBuyerTenantsByPhoneContractCommand.ResponseSchema = ListMobileBuyerTenantsByPhoneResponseSchema;
20
- })(ListMobileBuyerTenantsByPhoneContractCommand || (exports.ListMobileBuyerTenantsByPhoneContractCommand = ListMobileBuyerTenantsByPhoneContractCommand = {}));
@@ -1,23 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- const ListMobileBuyerTenantsByPhoneRequestSchema = z.object({
4
- phone: z.string().min(1),
5
- });
6
-
7
- const MobileBuyerTenantItemSchema = z.object({
8
- companyUUID: z.uuid(),
9
- displayName: z.string(),
10
- domain: z.string().nullable(),
11
- });
12
-
13
- const ListMobileBuyerTenantsByPhoneResponseSchema = z.object({
14
- items: z.array(MobileBuyerTenantItemSchema),
15
- });
16
-
17
- export namespace ListMobileBuyerTenantsByPhoneContractCommand {
18
- export const RequestSchema = ListMobileBuyerTenantsByPhoneRequestSchema;
19
- export type Request = z.infer<typeof RequestSchema>;
20
-
21
- export const ResponseSchema = ListMobileBuyerTenantsByPhoneResponseSchema;
22
- export type Response = z.infer<typeof ResponseSchema>;
23
- }