@askdialog/dialog-sdk 1.0.13 → 1.0.15
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/README.md +16 -0
- package/dist/Dialog.js +1 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/utils/localization.js +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -28,6 +28,22 @@ pnpm add @dialog/dialog-sdk
|
|
|
28
28
|
yarn add @dialog/dialog-sdk
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
You can also use our CDN link if you’re not using a package manager.
|
|
32
|
+
|
|
33
|
+
- Add the script to your project (replace X, Y, Z by versions)
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<script src="https://d2m6yt8rnm4dos.cloudfront.net/dialog-sdk.X.Y.Z.min.js"></script>
|
|
37
|
+
```
|
|
38
|
+
- The `DialogSDK` object will be available on the `window`. You can access all features as shown below:
|
|
39
|
+
```typescript
|
|
40
|
+
|
|
41
|
+
const client = new window.DialogSDK.Dialog({
|
|
42
|
+
apiKey: 'YOUR_API_KEY',
|
|
43
|
+
// ........
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
31
47
|
### Instantiate the client
|
|
32
48
|
|
|
33
49
|
```typescript
|
package/dist/Dialog.js
CHANGED
|
@@ -100,6 +100,7 @@ export class Dialog {
|
|
|
100
100
|
script.type = 'text/javascript';
|
|
101
101
|
script.defer = true;
|
|
102
102
|
script.async = true;
|
|
103
|
+
script.type = 'module';
|
|
103
104
|
script.src = config.assistantUrl;
|
|
104
105
|
document.head.insertBefore(script, document.head.firstChild);
|
|
105
106
|
const div = document.createElement('div');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/types/theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/types/theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askdialog/dialog-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Dialog SDK",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
30
30
|
"@typescript-eslint/parser": "^7.18.0",
|
|
31
|
+
"esbuild": "^0.25.8",
|
|
31
32
|
"eslint": "^8.56.0",
|
|
32
33
|
"eslint-config-prettier": "^10.1.1",
|
|
33
34
|
"eslint-import-resolver-typescript": "^4.3.2",
|
|
@@ -52,6 +53,11 @@
|
|
|
52
53
|
"test-type": "tsc --noEmit",
|
|
53
54
|
"link": "pnpm link --global",
|
|
54
55
|
"unlink": "pnpm unlink",
|
|
55
|
-
"watch": "tsc --watch"
|
|
56
|
+
"watch": "tsc --watch",
|
|
57
|
+
"build:bundle:iife": "pnpm run build:prod && mkdir -p bundle && esbuild src/index.ts --bundle --platform=browser --format=iife --global-name=DialogSDK --minify --outfile=bundle/dialog-sdk.$npm_package_version.min.js",
|
|
58
|
+
"deploy:s3": "aws s3 cp bundle/dialog-sdk.$npm_package_version.min.js s3://dialog-sdk/",
|
|
59
|
+
"deploy:cloudfront": "aws cloudfront create-invalidation --distribution-id E3NRPUUF94K3P6 --no-cli-pager --paths \"/dialog-sdk.$npm_package_version.min.js\"",
|
|
60
|
+
"deploy:cdn": "pnpm run build:prod && pnpm run build:bundle:iife && pnpm run deploy:s3 && pnpm run deploy:cloudfront",
|
|
61
|
+
"deploy:cdn:publish": "pnpm run build:prod && pnpm run build:bundle:iife && pnpm run deploy:s3 && pnpm run deploy:cloudfront && pnpm publish"
|
|
56
62
|
}
|
|
57
63
|
}
|