demoway-sdk
Advanced tools
Comparing version 0.7.0-beta.0 to 0.7.0
@@ -6,5 +6,5 @@ import { ISDKService } from './lib/service-host'; | ||
export type { ISDKService }; | ||
export declare const openDemoDialog: (demoId: string, options?: import('./lib/types').IDemoDialogOptions) => Promise<import('./lib/types').IDemoDialog>; | ||
export declare const enableRecord: () => Promise<void>; | ||
export declare function initialize(options: ISDKInitializeOptions): void; | ||
declare const openDemoDialog: (demoId: string, options?: import('./lib/types').IDemoDialogOptions) => Promise<import('./lib/types').IDemoDialog>, enableRecord: () => Promise<void>, getDemoUrl: (demoId: string, params?: import('./lib/types').IDemoUrlParams) => string; | ||
export { openDemoDialog, enableRecord, getDemoUrl }; | ||
export declare function initialize(options: ISDKInitializeOptions): Promise<ISDKService>; | ||
export declare function rageClick(element: HTMLElement, count: number, timeLimit: number): Promise<void>; |
@@ -1,7 +0,7 @@ | ||
import { DemoDialogElement, IDemoDialog } from './types'; | ||
import { IDemoDialog, IDemoDialogOptions } from './types'; | ||
export declare class DemoDialogController implements IDemoDialog { | ||
private readonly element; | ||
constructor(element: DemoDialogElement); | ||
constructor(href: string, origin: string, options?: IDemoDialogOptions); | ||
close(): void; | ||
} |
@@ -1,5 +0,6 @@ | ||
import { IDemoDialog, IDemoDialogOptions, IRecorderService } from './types'; | ||
import { IDemoDialog, IDemoDialogOptions, IDemoUrlParams, IRecorderService } from './types'; | ||
export interface ISDKService extends IRecorderService { | ||
openDemoDialog(demoId: string, options?: IDemoDialogOptions): Promise<IDemoDialog>; | ||
getDemoUrl(demoId: string, params?: IDemoUrlParams): string; | ||
} | ||
@@ -11,3 +12,4 @@ export declare class ServiceHost implements ISDKService { | ||
enableRecord(): Promise<void>; | ||
getDemoUrl(demoId: string, params?: IDemoUrlParams): string; | ||
openDemoDialog(demoId: string, options?: IDemoDialogOptions): Promise<IDemoDialog>; | ||
} |
import { ISDKService } from './service-host'; | ||
import { IDemoDialog, IDemoDialogOptions, ISDKInitializeOptions } from './types'; | ||
import { IDemoDialog, IDemoDialogOptions, IDemoUrlParams, ISDKInitializeOptions } from './types'; | ||
@@ -7,5 +7,7 @@ export declare class ServiceImpl implements ISDKService { | ||
private readonly demoLoad$; | ||
private readonly origin; | ||
private recorderServiceDelegate; | ||
private demoDialog; | ||
constructor(options: ISDKInitializeOptions); | ||
getDemoUrl(demoId: string, params?: IDemoUrlParams): string; | ||
openDemoDialog(demoId: string, options?: IDemoDialogOptions | undefined): Promise<IDemoDialog>; | ||
@@ -12,0 +14,0 @@ enableRecord(): Promise<void>; |
@@ -1,5 +0,13 @@ | ||
export interface IDemoDialogOptions { | ||
zIndex?: number; | ||
export interface IDemoParamsBase { | ||
checklistId?: string; | ||
} | ||
export interface IDemoDialogOptions extends IDemoParamsBase { | ||
class?: string; | ||
backdropClass?: string; | ||
} | ||
export interface IDemoUrlParams extends IDemoParamsBase { | ||
browser?: boolean; | ||
scaleDown?: boolean; | ||
scale?: number; | ||
} | ||
export interface DemoDialogElement extends HTMLElement, IDemoDialogOptions { | ||
@@ -6,0 +14,0 @@ demoId: string; |
{ | ||
"name": "demoway-sdk", | ||
"version": "0.7.0-beta.0", | ||
"version": "0.7.0", | ||
"type": "module", | ||
@@ -13,4 +13,8 @@ "files": [ | ||
"import": "./dist/sdk.js", | ||
"require": "./dist/sdk.cjs", | ||
"require": "./dist/sdk.umd.cjs", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./style.css": { | ||
"import": "./dist/style.css", | ||
"require": "./dist/style.css" | ||
} | ||
@@ -30,3 +34,3 @@ }, | ||
"@histoire/plugin-svelte": "^0.17.17", | ||
"@sveltejs/vite-plugin-svelte": "^3.1.1", | ||
"@sveltejs/vite-plugin-svelte": "^4.0.0", | ||
"@tsconfig/svelte": "^5.0.4", | ||
@@ -39,6 +43,7 @@ "@types/node": "^20.14.10", | ||
"sass": "^1.77.7", | ||
"svelte": "^4.2.18", | ||
"svelte": "^5.0.0", | ||
"svelte-check": "^3.8.4", | ||
"tslib": "^2.6.3", | ||
"typescript": "^5.5.3", | ||
"unocss": "^0.63.6", | ||
"vite": "^5.3.3", | ||
@@ -49,2 +54,3 @@ "vite-plugin-css-injected-by-js": "^3.5.1", | ||
"dependencies": { | ||
"clsx": "^2.1.1", | ||
"rxjs": "^7.8.1" | ||
@@ -51,0 +57,0 @@ }, |
@@ -23,2 +23,42 @@ # Demoway SDK | ||
## Setup | ||
### Tailwind user | ||
```js | ||
// tailwind.config.js | ||
module.exports = { | ||
content: [ | ||
'**/demoway-sdk/dist/**/*.{js,cjs}', | ||
// ... | ||
], | ||
}; | ||
``` | ||
### Uno CSS user | ||
```js | ||
// uno.config.js | ||
export default defineConfig({ | ||
content: { | ||
pipeline: { | ||
include: [ | ||
'**/demoway-sdk/dist/**/*.{js,cjs}', | ||
// ... | ||
], | ||
}, | ||
}, | ||
}); | ||
``` | ||
### If you are not using tailwind or unocss or something similar | ||
```js | ||
import 'demoway-sdk/style.css'; | ||
// or | ||
require('demoway-sdk/style.css'); | ||
``` | ||
## Initialize DemoWay SDK | ||
@@ -35,3 +75,3 @@ | ||
initialize({ | ||
accessToken: '', | ||
accessToken: '', | ||
appId: '', | ||
@@ -43,5 +83,5 @@ userInfo: { | ||
xxx: '', | ||
company: { | ||
id: '' | ||
name: '' | ||
company: { | ||
id: '' | ||
name: '' | ||
} | ||
@@ -63,3 +103,3 @@ } as IUserInfo, // IUserInfo is TS interface, you can remove it if you are not using TS | ||
initialize({ | ||
accessToken: '', | ||
accessToken: '', | ||
appId: '', | ||
@@ -71,5 +111,5 @@ userInfo: { | ||
xxx: '', | ||
company: { | ||
id: '' | ||
name: '' | ||
company: { | ||
id: '' | ||
name: '' | ||
} | ||
@@ -87,15 +127,15 @@ } as IUserInfo, // IUserInfo is TS interface, you can remove it if you are not using TS | ||
| Name | Required | Description | | ||
| -------- | ------- | ---------| | ||
| accessToken | required | temporary access token fot test, you can get it from your DemoWay dashboard | | ||
| appId | required | your DemoWay application id, you can get it from your DemoWay dashboard | | ||
| userInfo | optional | **strongly recommend** | | ||
| userInfo.openId | optional | open user id of the user in your system, you can associate each user with the users in your own system when retrieving user access records through the API. **strongly recommend** | | ||
| userInfo.nickName | optional | the nick name of the user in your system | | ||
| userInfo.xxx | optional | you can add string value with any key name to "userInfo" | | ||
| userInfo.company | optional | **strongly recommend** | | ||
| userInfo.company.id | optional | the company id of the user in your system | | ||
| userInfo.company.name | required | the company or organization name of the user, required in `userInfo.company`| | ||
| Name | Required | Description | | ||
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| accessToken | required | temporary access token fot test, you can get it from your DemoWay dashboard | | ||
| appId | required | your DemoWay application id, you can get it from your DemoWay dashboard | | ||
| userInfo | optional | **strongly recommend** | | ||
| userInfo.openId | optional | open user id of the user in your system, you can associate each user with the users in your own system when retrieving user access records through the API. **strongly recommend** | | ||
| userInfo.nickName | optional | the nick name of the user in your system | | ||
| userInfo.xxx | optional | you can add string value with any key name to "userInfo" | | ||
| userInfo.company | optional | **strongly recommend** | | ||
| userInfo.company.id | optional | the company id of the user in your system | | ||
| userInfo.company.name | required | the company or organization name of the user, required in `userInfo.company` | | ||
When a user accesses the demo, Demoway will create an anonymous user for them. If you provide the "userInfo" field when initializing the SDK, this information will be associated with the anonymous user. In the Demoway dashboard, when viewing the user's access records, you may also see this information. This makes it convenient to identify different users. If the "userInfo" includes the "openId" field, you can associate each user with the users in your own system when retrieving access records through the API. | ||
When a user accesses the demo, Demoway will create an anonymous user for them. If you provide the "userInfo" field when initializing the SDK, this information will be associated with the anonymous user. In the Demoway dashboard, when viewing the user's access records, you may also see this information. This makes it convenient to identify different users. If the "userInfo" includes the "openId" field, you can associate each user with the users in your own system when retrieving access records through the API. | ||
@@ -123,3 +163,3 @@ ## Usage | ||
openDemoDialog('demo-id', {checklistId: 'checklist-id'}); // demo-id and checklist-id can be got from DemoWay dashboard | ||
openDemoDialog('demo-id', { checklistId: 'checklist-id' }); // demo-id and checklist-id can be got from DemoWay dashboard | ||
``` | ||
@@ -126,0 +166,0 @@ |
@@ -11,3 +11,3 @@ { | ||
"isolatedModules": true, | ||
"importsNotUsedAsValues": "error" | ||
"verbatimModuleSyntax": true | ||
}, | ||
@@ -14,0 +14,0 @@ "include": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
160501
15
5010
186
0
2
17
+ Addedclsx@^2.1.1
+ Addedclsx@2.1.1(transitive)