@deliverart/sdk-js-company 0.0.4 → 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.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/types.ts +22 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/types.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const companyPathSchema = z
|
|
4
|
+
.string()
|
|
5
|
+
.refine(val => /^\/companies\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val), {
|
|
6
|
+
message: 'Invalid integration path format',
|
|
7
|
+
})
|
|
8
|
+
export type PointOfSalePath = z.infer<typeof companyPathSchema>
|
|
9
|
+
|
|
10
|
+
export const companyNullablePathSchema = z
|
|
11
|
+
.string()
|
|
12
|
+
.nullable()
|
|
13
|
+
.refine(
|
|
14
|
+
val => {
|
|
15
|
+
if (!val) return true
|
|
16
|
+
return /^\/companies\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val)
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Invalid integration path format',
|
|
20
|
+
},
|
|
21
|
+
)
|
|
22
|
+
export type PointOfSaleNullablePath = z.infer<typeof companyNullablePathSchema>
|