@retailcrm/embed-ui-v1-contexts 0.4.4

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.
Files changed (41) hide show
  1. package/README.md +16 -0
  2. package/dist/common/customer/card-phone.d.ts +6 -0
  3. package/dist/common/customer/card.d.ts +6 -0
  4. package/dist/common/order/card.d.ts +6 -0
  5. package/dist/common/settings.d.ts +7 -0
  6. package/dist/common/user/current.d.ts +6 -0
  7. package/dist/host.cjs +104 -0
  8. package/dist/host.d.ts +16 -0
  9. package/dist/host.js +104 -0
  10. package/dist/meta.json +442 -0
  11. package/dist/predicates.cjs.js +28 -0
  12. package/dist/predicates.d.ts +11 -0
  13. package/dist/predicates.es.js +29 -0
  14. package/dist/remote/customer/card-phone.cjs +20 -0
  15. package/dist/remote/customer/card-phone.d.ts +12 -0
  16. package/dist/remote/customer/card-phone.js +20 -0
  17. package/dist/remote/customer/card.cjs +30 -0
  18. package/dist/remote/customer/card.d.ts +12 -0
  19. package/dist/remote/customer/card.js +30 -0
  20. package/dist/remote/order/card.cjs +138 -0
  21. package/dist/remote/order/card.d.ts +12 -0
  22. package/dist/remote/order/card.js +138 -0
  23. package/dist/remote/settings.cjs +17 -0
  24. package/dist/remote/settings.d.ts +13 -0
  25. package/dist/remote/settings.js +17 -0
  26. package/dist/remote/user/current.cjs +50 -0
  27. package/dist/remote/user/current.d.ts +12 -0
  28. package/dist/remote/user/current.js +50 -0
  29. package/dist/remote.cjs +62 -0
  30. package/dist/remote.d.ts +22 -0
  31. package/dist/remote.js +62 -0
  32. package/dist/utilities.cjs.js +3 -0
  33. package/dist/utilities.d.ts +1 -0
  34. package/dist/utilities.es.js +4 -0
  35. package/package.json +106 -0
  36. package/types/customer/card-phone.d.ts +6 -0
  37. package/types/customer/card.d.ts +8 -0
  38. package/types/index.d.ts +13 -0
  39. package/types/order/card.d.ts +29 -0
  40. package/types/settings.d.ts +6 -0
  41. package/types/user/current.d.ts +12 -0
package/package.json ADDED
@@ -0,0 +1,106 @@
1
+ {
2
+ "name": "@retailcrm/embed-ui-v1-contexts",
3
+ "description": "Reactive contexts for RetailCRM JS API",
4
+ "type": "module",
5
+ "version": "0.4.4",
6
+ "license": "MIT",
7
+ "author": "RetailDriverLLC <integration@retailcrm.ru>",
8
+ "repository": "git@github.com:retailcrm/embed-ui.git",
9
+ "exports": {
10
+ ".": null,
11
+ "./host": {
12
+ "types": "./dist/host.d.ts",
13
+ "import": "./dist/host.js",
14
+ "require": "./dist/host.cjs",
15
+ "default": "./dist/host.js"
16
+ },
17
+ "./remote": {
18
+ "types": "./dist/remote.d.ts",
19
+ "import": "./dist/remote.js",
20
+ "require": "./dist/remote.cjs",
21
+ "default": "./dist/remote.js"
22
+ },
23
+ "./remote/customer/card": {
24
+ "types": "./dist/remote/customer/card.d.ts",
25
+ "import": "./dist/remote/customer/card.js",
26
+ "require": "./dist/remote/customer/card.cjs",
27
+ "default": "./dist/remote/customer/card.js"
28
+ },
29
+ "./remote/customer/card-phone": {
30
+ "types": "./dist/remote/customer/card-phone.d.ts",
31
+ "import": "./dist/remote/customer/card-phone.js",
32
+ "require": "./dist/remote/customer/card-phone.cjs",
33
+ "default": "./dist/remote/customer/card-phone.js"
34
+ },
35
+ "./remote/order/card": {
36
+ "types": "./dist/remote/order/card.d.ts",
37
+ "import": "./dist/remote/order/card.js",
38
+ "require": "./dist/remote/order/card.cjs",
39
+ "default": "./dist/remote/order/card.js"
40
+ },
41
+ "./remote/user/current": {
42
+ "types": "./dist/remote/user/current.d.ts",
43
+ "import": "./dist/remote/user/current.js",
44
+ "require": "./dist/remote/user/current.cjs",
45
+ "default": "./dist/uremote/ser/current.js"
46
+ },
47
+ "./remote/settings": {
48
+ "types": "./dist/remote/settings.d.ts",
49
+ "import": "./dist/remote/settings.js",
50
+ "require": "./dist/remote/settings.cjs",
51
+ "default": "./dist/remote/settings.js"
52
+ },
53
+ "./*": "./*"
54
+ },
55
+ "typesVersions": {
56
+ "*": {
57
+ "host": [
58
+ "./dist/host.d.ts"
59
+ ],
60
+ "remote": [
61
+ "./dist/remote.d.ts"
62
+ ],
63
+ "remote/customer/card": [
64
+ "./dist/remote/customer/card.d.ts"
65
+ ],
66
+ "remote/customer/card-phone": [
67
+ "./dist/remote/customer/card-phone.d.ts"
68
+ ],
69
+ "remote/order/card": [
70
+ "./dist/remote/order/card.d.ts"
71
+ ],
72
+ "remote/user/current": [
73
+ "./dist/remote/user/current.d.ts"
74
+ ],
75
+ "remote/settings": [
76
+ "./dist/remote/settings.d.ts"
77
+ ]
78
+ }
79
+ },
80
+ "files": [
81
+ "dist",
82
+ "types",
83
+ "README.md"
84
+ ],
85
+ "scripts": {
86
+ "build": "yarn build:code && yarn build:meta",
87
+ "build:code": "vite build",
88
+ "build:meta": "npx tsx scripts/build.meta.ts",
89
+ "test": "vitest --run"
90
+ },
91
+ "peerDependencies": {
92
+ "@remote-ui/rpc": "^1.4.5",
93
+ "pinia": "^2.2"
94
+ },
95
+ "dependencies": {
96
+ "@retailcrm/embed-ui-v1-testing": "^0.4.4",
97
+ "@retailcrm/embed-ui-v1-types": "^0.4.4"
98
+ },
99
+ "devDependencies": {
100
+ "tsx": "^4.19.2",
101
+ "typescript": "^5.6.3",
102
+ "vite": "^5.4.11",
103
+ "vite-plugin-dts": "^4.3.0",
104
+ "vitest": "^2.1.8"
105
+ }
106
+ }
@@ -0,0 +1,6 @@
1
+ import type { ReadonlyField } from '@retailcrm/embed-ui-v1-types/context'
2
+
3
+ export type Schema = {
4
+ 'value': ReadonlyField<string>;
5
+ 'index': ReadonlyField<number>;
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReadonlyField } from '@retailcrm/embed-ui-v1-types/context'
2
+
3
+ export type Schema = {
4
+ 'id': ReadonlyField<number | null>;
5
+ 'externalId': ReadonlyField<string | null>;
6
+ 'email': ReadonlyField<string>;
7
+ 'phones': ReadonlyField<string[]>;
8
+ }
@@ -0,0 +1,13 @@
1
+ import type { Schema as CustomerCardSchema } from './customer/card'
2
+ import type { Schema as CustomerCardPhoneSchema } from './customer/card-phone'
3
+ import type { Schema as OrderCardSchema } from './order/card'
4
+ import type { Schema as CurrentUserSchema } from './user/current'
5
+ import type { Schema as SettingsSchema } from './settings'
6
+
7
+ export type SchemaList = {
8
+ 'customer/card': CustomerCardSchema;
9
+ 'customer/card:phone': CustomerCardPhoneSchema;
10
+ 'order/card': OrderCardSchema;
11
+ 'user/current': CurrentUserSchema;
12
+ 'settings': SettingsSchema;
13
+ }
@@ -0,0 +1,29 @@
1
+ import type { Field, ReadonlyField } from '@retailcrm/embed-ui-v1-types/context'
2
+
3
+ export type Schema = {
4
+ 'id': ReadonlyField<number | null>;
5
+ 'externalId': ReadonlyField<string | null>;
6
+ 'type': ReadonlyField<string | null>;
7
+ 'site': ReadonlyField<string | null>;
8
+ 'number': ReadonlyField<string | null>;
9
+ 'customer.type': ReadonlyField<'customer' | 'customer_corporate'>;
10
+ 'customer.lastName': Field<string | null>;
11
+ 'customer.firstName': Field<string | null>;
12
+ 'customer.patronymic': Field<string | null>;
13
+ 'customer.email': Field<string | null>;
14
+ 'customer.phone': Field<string | null>;
15
+ 'country': ReadonlyField<string | null>;
16
+ 'currency': ReadonlyField<string>;
17
+ 'status': ReadonlyField<string>;
18
+ 'company.name': Field<string | null>;
19
+ 'company.legalName': Field<string | null>;
20
+ 'company.legalAddress': Field<string | null>;
21
+ 'company.INN': Field<string | null>;
22
+ 'company.OKPO': Field<string | null>;
23
+ 'company.BIK': Field<string | null>;
24
+ 'company.bank': Field<string | null>;
25
+ 'company.bankAddress': Field<string | null>;
26
+ 'company.corrAccount': Field<string | null>;
27
+ 'company.bankAccount': Field<string | null>;
28
+ 'delivery.address': Field<string | null>;
29
+ }
@@ -0,0 +1,6 @@
1
+ import type { ReadonlyField } from '@retailcrm/embed-ui-v1-types/context'
2
+
3
+ export type Locale = 'en-GB' | 'es-ES' | 'ru-RU'
4
+ export type Schema = {
5
+ 'system.locale': ReadonlyField<Locale>;
6
+ }
@@ -0,0 +1,12 @@
1
+ import type { ReadonlyField } from '@retailcrm/embed-ui-v1-types/context'
2
+
3
+ export type Schema = {
4
+ 'id': ReadonlyField<number | null>;
5
+ 'email': ReadonlyField<string>;
6
+ 'firstName': ReadonlyField<string | null>;
7
+ 'lastName': ReadonlyField<string | null>;
8
+ 'patronymic': ReadonlyField<string | null>;
9
+ 'photo': ReadonlyField<string | null>;
10
+ 'groups': ReadonlyField<string[]>;
11
+ 'permissions': ReadonlyField<string[]>;
12
+ }