@retailcrm/embed-ui 0.4.1-alpha.8 → 0.4.1-alpha.9
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/dist/index.cjs +12 -12
- package/dist/index.mjs +12 -12
- package/dist/meta.json +26 -26
- package/index.d.ts +33 -38
- package/package.json +1 -1
- package/types/context/user/current.d.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [0.4.1-alpha.9](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.8...v0.4.1-alpha.9) (2024-11-26)
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Types declaration in index.d.ts ([2751630](https://github.com/retailcrm/embed-ui/commit/2751630db649592bc4e8f2b8e16aaf86a7971e0f))
|
|
9
|
+
* **v1-components:** Missing slot of remote UiModalWindow definition ([2bf97a3](https://github.com/retailcrm/embed-ui/commit/2bf97a33e2eee41090195038733bc89baf72bc3d))
|
|
4
10
|
## [0.4.1-alpha.8](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.7...v0.4.1-alpha.8) (2024-11-25)
|
|
5
11
|
|
|
6
12
|
### Bug Fixes
|
package/dist/index.cjs
CHANGED
|
@@ -72,28 +72,28 @@ const oneOf = (...predicates) => withMeta(
|
|
|
72
72
|
predicates.map((p) => p.type).join(" | ")
|
|
73
73
|
);
|
|
74
74
|
const schema$4 = {
|
|
75
|
-
"
|
|
76
|
-
accepts: oneOf(
|
|
75
|
+
"id": {
|
|
76
|
+
accepts: oneOf(isNumber, isNull),
|
|
77
77
|
defaults: () => null,
|
|
78
|
-
readonly:
|
|
78
|
+
readonly: true
|
|
79
|
+
},
|
|
80
|
+
"email": {
|
|
81
|
+
accepts: isString,
|
|
82
|
+
defaults: () => "",
|
|
83
|
+
readonly: true
|
|
79
84
|
},
|
|
80
85
|
"firstName": {
|
|
81
86
|
accepts: oneOf(isString, isNull),
|
|
82
87
|
defaults: () => null,
|
|
83
|
-
readonly:
|
|
88
|
+
readonly: true
|
|
84
89
|
},
|
|
85
|
-
"
|
|
90
|
+
"lastName": {
|
|
86
91
|
accepts: oneOf(isString, isNull),
|
|
87
92
|
defaults: () => null,
|
|
88
|
-
readonly: false
|
|
89
|
-
},
|
|
90
|
-
"email": {
|
|
91
|
-
accepts: isString,
|
|
92
|
-
defaults: () => "",
|
|
93
93
|
readonly: true
|
|
94
94
|
},
|
|
95
|
-
"
|
|
96
|
-
accepts: oneOf(
|
|
95
|
+
"patronymic": {
|
|
96
|
+
accepts: oneOf(isString, isNull),
|
|
97
97
|
defaults: () => null,
|
|
98
98
|
readonly: true
|
|
99
99
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -70,28 +70,28 @@ const oneOf = (...predicates) => withMeta(
|
|
|
70
70
|
predicates.map((p) => p.type).join(" | ")
|
|
71
71
|
);
|
|
72
72
|
const schema$4 = {
|
|
73
|
-
"
|
|
74
|
-
accepts: oneOf(
|
|
73
|
+
"id": {
|
|
74
|
+
accepts: oneOf(isNumber, isNull),
|
|
75
75
|
defaults: () => null,
|
|
76
|
-
readonly:
|
|
76
|
+
readonly: true
|
|
77
|
+
},
|
|
78
|
+
"email": {
|
|
79
|
+
accepts: isString,
|
|
80
|
+
defaults: () => "",
|
|
81
|
+
readonly: true
|
|
77
82
|
},
|
|
78
83
|
"firstName": {
|
|
79
84
|
accepts: oneOf(isString, isNull),
|
|
80
85
|
defaults: () => null,
|
|
81
|
-
readonly:
|
|
86
|
+
readonly: true
|
|
82
87
|
},
|
|
83
|
-
"
|
|
88
|
+
"lastName": {
|
|
84
89
|
accepts: oneOf(isString, isNull),
|
|
85
90
|
defaults: () => null,
|
|
86
|
-
readonly: false
|
|
87
|
-
},
|
|
88
|
-
"email": {
|
|
89
|
-
accepts: isString,
|
|
90
|
-
defaults: () => "",
|
|
91
91
|
readonly: true
|
|
92
92
|
},
|
|
93
|
-
"
|
|
94
|
-
accepts: oneOf(
|
|
93
|
+
"patronymic": {
|
|
94
|
+
accepts: oneOf(isString, isNull),
|
|
95
95
|
defaults: () => null,
|
|
96
96
|
readonly: true
|
|
97
97
|
},
|
package/dist/meta.json
CHANGED
|
@@ -2,14 +2,24 @@
|
|
|
2
2
|
"contexts": {
|
|
3
3
|
"user/current": [
|
|
4
4
|
{
|
|
5
|
-
"name": "
|
|
6
|
-
"type": "
|
|
5
|
+
"name": "id",
|
|
6
|
+
"type": "number | null",
|
|
7
7
|
"description": {
|
|
8
|
-
"en-GB": "User
|
|
9
|
-
"es-ES": "
|
|
10
|
-
"ru-RU": "
|
|
8
|
+
"en-GB": "User ID",
|
|
9
|
+
"es-ES": "ID del usuario",
|
|
10
|
+
"ru-RU": "ID пользователя"
|
|
11
11
|
},
|
|
12
|
-
"readonly":
|
|
12
|
+
"readonly": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "email",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": {
|
|
18
|
+
"en-GB": "User email",
|
|
19
|
+
"es-ES": "Correo electrónico del usuario",
|
|
20
|
+
"ru-RU": "Email пользователя"
|
|
21
|
+
},
|
|
22
|
+
"readonly": true
|
|
13
23
|
},
|
|
14
24
|
{
|
|
15
25
|
"name": "firstName",
|
|
@@ -19,35 +29,25 @@
|
|
|
19
29
|
"es-ES": "Nombre del usuario",
|
|
20
30
|
"ru-RU": "Имя пользователя"
|
|
21
31
|
},
|
|
22
|
-
"readonly":
|
|
32
|
+
"readonly": true
|
|
23
33
|
},
|
|
24
34
|
{
|
|
25
|
-
"name": "
|
|
35
|
+
"name": "lastName",
|
|
26
36
|
"type": "string | null",
|
|
27
37
|
"description": {
|
|
28
|
-
"en-GB": "
|
|
29
|
-
"es-ES": "
|
|
30
|
-
"ru-RU": "
|
|
31
|
-
},
|
|
32
|
-
"readonly": false
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "email",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"description": {
|
|
38
|
-
"en-GB": "User email",
|
|
39
|
-
"es-ES": "Correo electrónico del usuario",
|
|
40
|
-
"ru-RU": "Email пользователя"
|
|
38
|
+
"en-GB": "User last name",
|
|
39
|
+
"es-ES": "Apellido del usuario",
|
|
40
|
+
"ru-RU": "Фамилия пользователя"
|
|
41
41
|
},
|
|
42
42
|
"readonly": true
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
"name": "
|
|
46
|
-
"type": "
|
|
45
|
+
"name": "patronymic",
|
|
46
|
+
"type": "string | null",
|
|
47
47
|
"description": {
|
|
48
|
-
"en-GB": "
|
|
49
|
-
"es-ES": "
|
|
50
|
-
"ru-RU": "
|
|
48
|
+
"en-GB": "Patronymic of the user",
|
|
49
|
+
"es-ES": "Patronímico del usuario",
|
|
50
|
+
"ru-RU": "Отчество пользователя"
|
|
51
51
|
},
|
|
52
52
|
"readonly": true
|
|
53
53
|
},
|
package/index.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ import type { ContextSchema } from './types/context/schema'
|
|
|
6
6
|
import type { Endpoint, RemoteCallable } from '@remote-ui/rpc'
|
|
7
7
|
import type { IsReadonly } from './types/context/schema'
|
|
8
8
|
import type { MessageEndpoint } from '@remote-ui/rpc'
|
|
9
|
-
import type { Schema } from './types/context/customer/card'
|
|
10
|
-
import type { Schema as
|
|
11
|
-
import type { Schema as
|
|
12
|
-
import type { Schema as
|
|
9
|
+
import type { Schema as CustomerCardSchema } from './types/context/customer/card'
|
|
10
|
+
import type { Schema as CustomerCardPhoneSchema } from './types/context/customer/card-phone'
|
|
11
|
+
import type { Schema as OrderCardSchema } from './types/context/order/card'
|
|
12
|
+
import type { Schema as CurrentUserSchema } from './types/context/user/current'
|
|
13
|
+
import type { Schema as SettingsSchema } from './types/context/settings'
|
|
13
14
|
import type { SchemaList } from './types/context'
|
|
14
15
|
import type { Store } from 'pinia'
|
|
15
16
|
import type { StoreDefinition } from 'pinia'
|
|
@@ -19,52 +20,46 @@ import type { WritableComputedRef } from 'vue'
|
|
|
19
20
|
|
|
20
21
|
declare type Computed<S extends ContextSchema, F extends keyof S> = IsReadonly<S[F]> extends true ? ComputedRef<TypeOf<S[F]>> : WritableComputedRef<TypeOf<S[F]>>;
|
|
21
22
|
|
|
22
|
-
export declare const createWidgetEndpoint: (
|
|
23
|
+
export declare const createWidgetEndpoint: (
|
|
24
|
+
widget: WidgetRunner,
|
|
25
|
+
messenger: MessageEndpoint
|
|
26
|
+
) => Endpoint<ContextAccessor<SchemaList>>
|
|
23
27
|
|
|
24
|
-
export declare const customerCardPhoneSchema:
|
|
28
|
+
export declare const customerCardPhoneSchema: CustomerCardPhoneSchema
|
|
29
|
+
export declare const customerCardSchema: CustomerCardSchema
|
|
30
|
+
export declare const orderCardSchema: OrderCardSchema
|
|
31
|
+
export declare const currentUserSchema: CurrentUserSchema
|
|
32
|
+
export declare const settingsSchema: SettingsSchema
|
|
25
33
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
export declare const orderCardSchema: Schema_3
|
|
29
|
-
|
|
30
|
-
export declare const settingsSchema: Schema_4
|
|
31
|
-
|
|
32
|
-
export declare const useCustomerCardContext: StoreDefinition<'customer/card', Context<Schema>, {
|
|
33
|
-
schema: () => Schema;
|
|
34
|
+
export type ContextStore<S extends ContextSchema> = Store<string, Context<S>, {
|
|
35
|
+
schema(): S;
|
|
34
36
|
}, {
|
|
35
37
|
initialize(): Promise<void>;
|
|
36
|
-
set<F extends keyof
|
|
38
|
+
set<F extends keyof S>(field: F, value: TypeOf<S[F]>): void;
|
|
37
39
|
}>
|
|
38
40
|
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
+
export type ContextStoreDefinition<
|
|
42
|
+
Id extends string,
|
|
43
|
+
S extends ContextSchema
|
|
44
|
+
> = StoreDefinition<Id, Context<S>, {
|
|
45
|
+
schema: () => S;
|
|
41
46
|
}, {
|
|
42
47
|
initialize(): Promise<void>;
|
|
43
|
-
set<F extends keyof
|
|
48
|
+
set<F extends keyof S>(field: F, value: TypeOf<S[F]>): void;
|
|
44
49
|
}>
|
|
45
50
|
|
|
46
|
-
export declare const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}>, field: F) => Computed<S, F>
|
|
52
|
-
|
|
53
|
-
export declare const useHost = () => RemoteCallable<Callable>
|
|
51
|
+
export declare const useCustomerCardContext: ContextStoreDefinition<'customer/card', CustomerCardSchema>
|
|
52
|
+
export declare const useCustomerCardPhoneContext: ContextStoreDefinition<'customer/card:phone', CustomerCardPhoneSchema>
|
|
53
|
+
export declare const useOrderCardContext: ContextStoreDefinition<'order/card', OrderCardSchema>
|
|
54
|
+
export declare const useCurrentUserContext = DefineStore<'user/current', CurrentUserSchema>
|
|
55
|
+
export declare const useSettingsContext: ContextStoreDefinition<'settings', SettingsSchema>
|
|
54
56
|
|
|
55
|
-
export declare const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
set<F extends keyof Schema_3>(field: F, value: TypeOf<Schema_3[F]>): void;
|
|
60
|
-
}>
|
|
57
|
+
export declare const useField: <S extends ContextSchema, F extends keyof S>(
|
|
58
|
+
store: ContextStore<S>,
|
|
59
|
+
field: F
|
|
60
|
+
) => Computed<S, F>
|
|
61
61
|
|
|
62
|
-
export declare const
|
|
63
|
-
schema: () => Schema_4;
|
|
64
|
-
}, {
|
|
65
|
-
initialize(): Promise<void>;
|
|
66
|
-
set<F extends keyof Schema_4>(field: F, value: TypeOf<Schema_4[F]>): void;
|
|
67
|
-
}>
|
|
62
|
+
export declare const useHost = () => RemoteCallable<Callable>
|
|
68
63
|
|
|
69
64
|
declare module 'pinia' {
|
|
70
65
|
interface PiniaCustomProperties {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retailcrm/embed-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.1-alpha.
|
|
4
|
+
"version": "0.4.1-alpha.9",
|
|
5
5
|
"description": "API and components for creating RetailCRM UI extensions",
|
|
6
6
|
"repository": "git@github.com:retailcrm/embed-ui.git",
|
|
7
7
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReadonlyField } from '../schema'
|
|
2
2
|
|
|
3
3
|
export type Schema = {
|
|
4
|
-
'
|
|
4
|
+
'id': ReadonlyField<number | null>;
|
|
5
|
+
'email': ReadonlyField<string>;
|
|
5
6
|
'firstName': ReadonlyField<number | null>;
|
|
7
|
+
'lastName': ReadonlyField<string | null>;
|
|
6
8
|
'patronymic': ReadonlyField<number | null>;
|
|
7
|
-
'email': ReadonlyField<string>;
|
|
8
|
-
'id': ReadonlyField<number | null>;
|
|
9
9
|
'permissions': ReadonlyField<string[]>;
|
|
10
10
|
}
|