@retailcrm/embed-ui 0.0.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.
@@ -0,0 +1,39 @@
1
+ name: Tests
2
+
3
+ on: [push, pull_request]
4
+
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.ref }}
7
+ cancel-in-progress: true
8
+
9
+ jobs:
10
+ eslint:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [ 18.18.x, 20.x ]
16
+
17
+ steps:
18
+ - name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Use Node.js ${{ matrix.node-version }}
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: ${{ matrix.node-version }}
25
+
26
+ - name: Cache dependencies
27
+ id: cache-deps
28
+ uses: actions/cache@v4
29
+ with:
30
+ path: .yarn
31
+ key: ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
32
+ restore-keys: |
33
+ ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-
34
+
35
+ - name: Install dependencies
36
+ run: yarn install
37
+
38
+ - name: Run lint
39
+ run: yarn lint
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### 0.0.1 (2024-04-26)
6
+
7
+
8
+ ### Features
9
+
10
+ * Added basic types ([6bb2706](https://github.com/retailcrm/embed-ui/commit/6bb27060b3a9eca281865029e1688e44117f03f7))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 RetailCRM
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # embed-ui
2
+ API и компоненты для создания расширений интерфейса RetailCRM
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@retailcrm/embed-ui",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "description": "API and components for creating RetailCRM UI extensions",
6
+ "main": "index.js",
7
+ "repository": "git@github.com:retailcrm/embed-ui.git",
8
+ "author": "RetailDriverLLC <integration@retailcrm.ru>",
9
+ "license": "MIT",
10
+ "contributors": [
11
+ "Kirill Zaytsev <zaytsev.cmath10@gmail.com>"
12
+ ],
13
+ "scripts": {
14
+ "lint": "eslint .",
15
+ "release": "standard-version",
16
+ "release:major": "standard-version --release-as major",
17
+ "release:minor": "standard-version --release-as minor",
18
+ "release:patch": "standard-version --release-as patch"
19
+ },
20
+ "dependencies": {
21
+ "@remote-ui/core": "^2.2.4",
22
+ "@remote-ui/rpc": "^1.4.5"
23
+ },
24
+ "devDependencies": {
25
+ "@eslint/eslintrc": "^3.0.2",
26
+ "@eslint/js": "^9.1.1",
27
+ "@stylistic/eslint-plugin": "^1.7.2",
28
+ "eslint": "^9.1.1",
29
+ "eslint-config-standard-with-typescript": "^43.0.1",
30
+ "eslint-plugin-import": "^2.25.2",
31
+ "eslint-plugin-n": "^17.3.1",
32
+ "eslint-plugin-promise": "^6.1.1",
33
+ "globals": "^15.0.0",
34
+ "standard-version": "^9.5.0",
35
+ "typescript": "^5.4.5",
36
+ "typescript-eslint": "^7.7.1"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ }
41
+ }
@@ -0,0 +1,18 @@
1
+ import type {
2
+ AnyFunction,
3
+ None,
4
+ } from './scaffolding'
5
+
6
+ import type { RemoteChannel } from '@remote-ui/core'
7
+ import type { Endpoint as RemoteEndpoint } from '@remote-ui/rpc'
8
+
9
+ export interface EndpointApi<
10
+ PageApi extends Record<string, AnyFunction> = None
11
+ > {
12
+ run (channel: RemoteChannel, api: PageApi): Promise<void>;
13
+ release (): void;
14
+ }
15
+
16
+ export type Endpoint<
17
+ PageApi extends Record<string, AnyFunction> = None
18
+ > = RemoteEndpoint<EndpointApi<PageApi>>
@@ -0,0 +1,11 @@
1
+ export type OrderCardMethods = {
2
+ getCustomerEmail: () => string | null,
3
+ setCustomerEmail: (value: string) => void,
4
+
5
+ getCustomerPhone: () => string | null,
6
+ setCustomerPhone: (value: string) => void,
7
+
8
+ getDeliveryAddress: () => string | null,
9
+ setDeliveryAddress: (value: string) => void,
10
+ parseDeliveryAddress: () => void,
11
+ }
@@ -0,0 +1,2 @@
1
+ export type AnyFunction = (...payload: any[]) => unknown
2
+ export type None = Record<string, never>