@deliverart/sdk-js-menu 0.0.3 → 1.1.1

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/package.json CHANGED
@@ -1,46 +1,31 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-menu",
3
3
  "description": "Deliverart JavaScript SDK for Menu Management",
4
- "version": "0.0.3",
4
+ "version": "1.1.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "tsup": {
9
+ "tsconfig": "./tsconfig.json"
10
+ },
8
11
  "exports": {
9
12
  ".": {
10
13
  "import": "./dist/index.js",
11
14
  "require": "./dist/index.cjs"
12
15
  }
13
16
  },
17
+ "files": [
18
+ "dist"
19
+ ],
14
20
  "dependencies": {
15
- "@deliverart/sdk-js-core": "0.1.4",
16
- "@deliverart/sdk-js-global-types": "0.0.16",
17
- "axios": "1.9.0",
18
- "zod": "3.25.67"
19
- },
20
- "devDependencies": {
21
- "@changesets/cli": "^2.29.4",
22
- "@eslint/js": "9.28.0",
23
- "@types/node": "22.15.30",
24
- "@typescript-eslint/eslint-plugin": "8.33.1",
25
- "@typescript-eslint/parser": "8.33.1",
26
- "eslint": "9.28.0",
27
- "eslint-config-prettier": "10.1.5",
28
- "eslint-plugin-simple-import-sort": "12.1.1",
29
- "prettier": "3.5.3",
30
- "tsup": "8.5.0",
31
- "typescript": "5.8.3"
21
+ "@deliverart/sdk-js-core": "1.1.1",
22
+ "@deliverart/sdk-js-global-types": "1.1.1"
32
23
  },
33
24
  "publishConfig": {
34
25
  "access": "public"
35
26
  },
36
27
  "scripts": {
37
28
  "build": "tsup src/index.ts --dts --format esm,cjs",
38
- "dev": "tsup src/index.ts --dts --watch",
39
- "lint": "eslint .",
40
- "lint:fix": "eslint . --fix",
41
- "prettier": "prettier --check .",
42
- "prettier:fix": "prettier --write .",
43
- "version": "@changesets/cli version",
44
- "release": "@changesets/cli publish"
29
+ "dev": "tsup src/index.ts --dts --watch"
45
30
  }
46
31
  }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,47 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: write
10
-
11
- jobs:
12
- release:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - uses: pnpm/action-setup@v2
18
- with:
19
- version: 8
20
-
21
- - uses: actions/setup-node@v4
22
- with:
23
- node-version: '20'
24
- registry-url: 'https://registry.npmjs.org'
25
- always-auth: true
26
- env:
27
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28
-
29
- - name: Install deps
30
- run: pnpm install
31
-
32
- - name: Build
33
- run: pnpm build
34
-
35
- - name: Create version and changelog
36
- run: pnpx @changesets/cli version
37
-
38
- - name: Publish to NPM
39
- run: pnpx @changesets/cli publish
40
- env:
41
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42
-
43
- - name: Push updated versions and changelogs
44
- uses: EndBug/add-and-commit@v9
45
- with:
46
- message: 'chore(release): version bump'
47
- add: '.'
package/.prettierrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "printWidth": 100,
5
- "trailingComma": "all",
6
- "arrowParens": "avoid"
7
- }
package/CHANGELOG.md DELETED
@@ -1,49 +0,0 @@
1
- # @deliverart/sdk-js-company
2
-
3
- ## 0.0.3
4
-
5
- ### Patch Changes
6
-
7
- - 078ccbd: fix uuid version
8
-
9
- ## 0.0.2
10
-
11
- ### Patch Changes
12
-
13
- - 6533050: Increase version pkg
14
-
15
- ## 0.0.7
16
-
17
- ### Patch Changes
18
-
19
- - b8d802e: update dependencise
20
-
21
- ## 0.0.6
22
-
23
- ### Patch Changes
24
-
25
- - 65b64b5: Expose types
26
-
27
- ## 0.0.5
28
-
29
- ### Patch Changes
30
-
31
- - 83e0325: Expose company path types
32
-
33
- ## 0.0.4
34
-
35
- ### Patch Changes
36
-
37
- - 36a941d: Upgrade types version
38
-
39
- ## 0.0.3
40
-
41
- ### Patch Changes
42
-
43
- - b4fc2d4: Upgrade types version
44
-
45
- ## 0.0.2
46
-
47
- ### Patch Changes
48
-
49
- - a9d7757: Upgrade types version
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # sdk-js-menu
2
-
3
- SDK for the menu section
package/eslint.config.js DELETED
@@ -1,41 +0,0 @@
1
- /* eslint-disable */
2
- // eslint.config.js per @typescript-eslint v8
3
- import js from '@eslint/js'
4
- import prettier from 'eslint-config-prettier'
5
- import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
6
- import tsPlugin from '@typescript-eslint/eslint-plugin'
7
- import tsParser from '@typescript-eslint/parser'
8
-
9
- export default [
10
- js.configs.recommended,
11
- {
12
- files: ['**/*.ts'],
13
- languageOptions: {
14
- parser: tsParser,
15
- globals: {
16
- process: 'readonly',
17
- fetch: 'readonly',
18
- Request: 'readonly',
19
- Response: 'readonly',
20
- Headers: 'readonly',
21
- },
22
- parserOptions: {
23
- project: ['./tsconfig.json'],
24
- tsconfigRootDir: process.cwd(),
25
- sourceType: 'module',
26
- },
27
- },
28
- plugins: {
29
- '@typescript-eslint': tsPlugin,
30
- 'simple-import-sort': simpleImportSortPlugin,
31
- },
32
- rules: {
33
- 'simple-import-sort/imports': 'error',
34
- 'simple-import-sort/exports': 'error',
35
- '@typescript-eslint/no-unused-vars': 'warn',
36
- },
37
- },
38
- prettier,
39
- ]
40
-
41
- export const ignores = ['dist', 'node_modules']
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './types'
package/src/types.ts DELETED
@@ -1,172 +0,0 @@
1
- import { z } from 'zod'
2
-
3
- export const menuChannels = ['application', 'ecommerce', 'deliveroo', 'justeat', 'glovo'] as const
4
- export const menuChannelSchema = z.enum(menuChannels)
5
- export type MenuChannel = z.infer<typeof menuChannelSchema>
6
-
7
- export const menuItemAllergens = [
8
- 'peanuts-and-derivatives',
9
- 'crustaceans',
10
- 'nuts',
11
- 'gluten',
12
- 'milk-and-derivatives',
13
- 'lupins',
14
- 'molluscs',
15
- 'mustard',
16
- 'fish',
17
- 'celery',
18
- 'sesame',
19
- 'sulfur-dioxide',
20
- 'soy',
21
- 'eggs-and-derivatives',
22
- 'mushrooms',
23
- ] as const
24
- export const menuItemAllergenSchema = z.enum(menuItemAllergens)
25
- export type MenuItemAllergen = z.infer<typeof menuItemAllergenSchema>
26
-
27
- export const menuItemDiets = ['pending', 'confirmed', 'rejected'] as const
28
- export const menuItemDietSchema = z.enum(menuItemDiets)
29
- export type MenuItemDiet = z.infer<typeof menuItemDietSchema>
30
-
31
- export const menuItemPriceOverrideTypes = ['ITEM', 'MODIFIER'] as const
32
- export const menuItemPriceOverrideTypeSchema = z.enum(menuItemPriceOverrideTypes)
33
- export type MenuItemPriceOverrideType = z.infer<typeof menuItemPriceOverrideTypeSchema>
34
-
35
- export const menuItemTypes = ['ITEM', 'CHOICE', 'BUNDLE'] as const
36
- export const menuItemTypeSchema = z.enum(menuItemTypes)
37
- export type MenuItemType = z.infer<typeof menuItemTypeSchema>
38
-
39
- export const menuItemPathSchema = z
40
- .string()
41
- .refine(val => /^\/menu_items\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val), {
42
- message: 'Invalid menu item path format',
43
- })
44
- export type MenuItemPath = z.infer<typeof menuItemPathSchema>
45
-
46
- export const menuItemNullablePathSchema = z
47
- .string()
48
- .nullable()
49
- .refine(
50
- val => {
51
- if (!val) return true
52
- return /^\/menu_items\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val)
53
- },
54
- {
55
- message: 'Invalid menu item path format',
56
- },
57
- )
58
- export type MenuItemNullablePath = z.infer<typeof menuItemNullablePathSchema>
59
-
60
- export const menuItemSalesPricePathSchema = z
61
- .string()
62
- .refine(val => /^\/menu_items\/sales_prices\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val), {
63
- message: 'Invalid menu item sales price path format',
64
- })
65
- export type MenuItemSalesPricePath = z.infer<typeof menuItemSalesPricePathSchema>
66
-
67
- export const menuItemSalesPriceNullablePathSchema = z
68
- .string()
69
- .nullable()
70
- .refine(
71
- val => {
72
- if (!val) return true
73
- return /^\/menu_items\/sales_prices\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val)
74
- },
75
- {
76
- message: 'Invalid menu item sales price path format',
77
- },
78
- )
79
- export type MenuItemSalesPriceNullablePath = z.infer<typeof menuItemSalesPriceNullablePathSchema>
80
-
81
- export const menuItemCategoryPathSchema = z
82
- .string()
83
- .refine(val => /^\/menu_item_categories\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val), {
84
- message: 'Invalid menu item category path format',
85
- })
86
- export type MenuItemCategoryPath = z.infer<typeof menuItemCategoryPathSchema>
87
-
88
- export const menuItemCategoryNullablePathSchema = z
89
- .string()
90
- .nullable()
91
- .refine(
92
- val => {
93
- if (!val) return true
94
- return /^\/menu_item_categories\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val)
95
- },
96
- {
97
- message: 'Invalid menu item category path format',
98
- },
99
- )
100
- export type MenuItemCategoryNullablePath = z.infer<typeof menuItemCategoryNullablePathSchema>
101
-
102
- export const menuItemModifierPathSchema = z
103
- .string()
104
- .refine(val => /^\/menu_item_modifiers\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val), {
105
- message: 'Invalid menu item modifier format',
106
- })
107
- export type MenuItemModifierPath = z.infer<typeof menuItemModifierPathSchema>
108
-
109
- export const menuItemModifierNullablePathSchema = z
110
- .string()
111
- .nullable()
112
- .refine(
113
- val => {
114
- if (!val) return true
115
- return /^\/menu_item_modifiers\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val)
116
- },
117
- {
118
- message: 'Invalid menu item modifier format',
119
- },
120
- )
121
- export type MenuItemModifierNullablePath = z.infer<typeof menuItemModifierNullablePathSchema>
122
-
123
- export const menuItemPriceOverridePathSchema = z
124
- .string()
125
- .refine(val => /^\/menu_item_price_overrides\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val), {
126
- message: 'Invalid menu item price override path format',
127
- })
128
- export type MenuItemPriceOverridePath = z.infer<typeof menuItemPriceOverridePathSchema>
129
-
130
- export const menuItemPriceOverrideNullablePathSchema = z
131
- .string()
132
- .nullable()
133
- .refine(
134
- val => {
135
- if (!val) return true
136
- return /^\/menu_item_price_overrides\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val)
137
- },
138
- {
139
- message: 'Invalid menu item price override path format',
140
- },
141
- )
142
- export type MenuItemPriceOverrideNullablePath = z.infer<
143
- typeof menuItemPriceOverrideNullablePathSchema
144
- >
145
-
146
- export const menuItemPriceOverrideSalesPricePathSchema = z
147
- .string()
148
- .refine(
149
- val => /^\/menu_item_price_overrides\/sales_prices\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val),
150
- {
151
- message: 'Invalid menu item price override sales price path format',
152
- },
153
- )
154
- export type MenuItemPriceOverrideSalesPricePath = z.infer<
155
- typeof menuItemPriceOverrideSalesPricePathSchema
156
- >
157
-
158
- export const menuItemPriceOverrideSalesPriceNullablePathSchema = z
159
- .string()
160
- .nullable()
161
- .refine(
162
- val => {
163
- if (!val) return true
164
- return /^\/menu_item_price_overrides\/sales_prices\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(val)
165
- },
166
- {
167
- message: 'Invalid menu item price override sales price path format',
168
- },
169
- )
170
- export type MenuItemPriceOverrideSalesPriceNullablePath = z.infer<
171
- typeof menuItemPriceOverrideSalesPriceNullablePathSchema
172
- >
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "Node",
6
- "esModuleInterop": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "strict": true,
9
- "skipLibCheck": true,
10
- "outDir": "dist",
11
- "declaration": true,
12
- "declarationMap": true
13
- },
14
- "include": ["src"]
15
- }