@bootpay/client-js 4.4.0 → 5.0.0-beta.10

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 (55) hide show
  1. package/README.md +14 -2
  2. package/dist/index.es.js +6882 -0
  3. package/dist/index.umd.js +2 -0
  4. package/dist/package.json.d.ts +55 -0
  5. package/dist/src/bootpay-es5.d.ts +2 -0
  6. package/{bootpay-widget.d.ts → dist/src/bootpay-widget.d.ts} +4 -2
  7. package/{bootpay.d.ts → dist/src/bootpay.d.ts} +1 -2
  8. package/dist/src/index.d.ts +77 -0
  9. package/{lib → dist/src/lib}/bootpay-widget.d.ts +15 -3
  10. package/{lib → dist/src/lib}/bootpay.d.ts +1 -1
  11. package/{lib → dist/src/lib}/event/payment.d.ts +1 -2
  12. package/{lib → dist/src/lib}/event/widget.d.ts +2 -0
  13. package/{lib → dist/src/lib}/locale/message.d.ts +4 -0
  14. package/{lib/template/card-easy.d.ts → dist/src/lib/template/oopay.d.ts} +8 -5
  15. package/{lib → dist/src/lib}/template/payment.d.ts +0 -1
  16. package/{lib → dist/src/lib}/template/widget.d.ts +1 -0
  17. package/{models → dist/src/models}/bootpay-interface.d.ts +12 -1
  18. package/dist/src/models/bootpay-widget-interface.d.ts +25 -0
  19. package/{support → dist/src/support}/alfred-progress/index.d.ts +0 -1
  20. package/{support → dist/src/support}/environment.d.ts +1 -0
  21. package/{support/logger.d.ts → dist/src/support/event-logger.d.ts} +2 -23
  22. package/dist/src/support/logger.d.ts +21 -0
  23. package/{support → dist/src/support}/storage.d.ts +1 -0
  24. package/{support → dist/src/support}/widget-store.d.ts +13 -1
  25. package/dist/vite.config.d.ts +2 -0
  26. package/package.json +12 -7
  27. package/tsconfig.json +37 -0
  28. package/tsconfig.json.esnext +42 -0
  29. package/vite.config.ts +27 -0
  30. package/bootpay-environment.js +0 -1
  31. package/bootpay-sdk.js +0 -2
  32. package/bootpay-sdk.js.LICENSE.txt +0 -1
  33. package/bootpay-widget.js +0 -2
  34. package/bootpay-widget.js.LICENSE.txt +0 -1
  35. package/bootpay.js +0 -2
  36. package/bootpay.js.LICENSE.txt +0 -1
  37. package/dist/bootpay.d.ts +0 -2
  38. package/index.d.ts +0 -6
  39. package/index.js +0 -8
  40. package/models/bootpay-widget-interface.d.ts +0 -8
  41. /package/{bootpay-environment.d.ts → dist/src/bootpay-environment.d.ts} +0 -0
  42. /package/{bootpay-sdk.d.ts → dist/src/bootpay-sdk.d.ts} +0 -0
  43. /package/{lib → dist/src/lib}/analytics.d.ts +0 -0
  44. /package/{lib → dist/src/lib}/event/polling.d.ts +0 -0
  45. /package/{lib → dist/src/lib}/event/user-token.d.ts +0 -0
  46. /package/{lib → dist/src/lib}/template/user-token.d.ts +0 -0
  47. /package/{models → dist/src/models}/bootpay-sdk-interface.d.ts +0 -0
  48. /package/{models → dist/src/models}/const.d.ts +0 -0
  49. /package/{support → dist/src/support}/bootpay-manager.d.ts +0 -0
  50. /package/{support → dist/src/support}/event.d.ts +0 -0
  51. /package/{support → dist/src/support}/resource.d.ts +0 -0
  52. /package/{support → dist/src/support}/template-manager.d.ts +0 -0
  53. /package/{support → dist/src/support}/util.d.ts +0 -0
  54. /package/{test → dist/src/test}/index.d.ts +0 -0
  55. /package/{test → dist/src/test}/moduleRequire.d.ts +0 -0
@@ -0,0 +1,25 @@
1
+ import { WidgetExtraModel } from './bootpay-interface';
2
+ export interface RequestBootpayWidgetModel {
3
+ application_id?: string;
4
+ price: number;
5
+ tax_free?: number;
6
+ currency?: string;
7
+ user_token?: string;
8
+ use_only_oopay?: boolean;
9
+ use_terms?: boolean;
10
+ sandbox?: boolean;
11
+ external_terms?: ExternalBootpayWidgetTermsModel[];
12
+ extra?: WidgetExtraModel;
13
+ }
14
+ export interface ResponseBootpayWidgetTermsModel {
15
+ term_id?: string;
16
+ pk: string;
17
+ title: string;
18
+ agree?: boolean;
19
+ }
20
+ export interface ExternalBootpayWidgetTermsModel {
21
+ pk: string;
22
+ title: string;
23
+ url: string;
24
+ required: 'required' | 'optional';
25
+ }
@@ -1,4 +1,3 @@
1
- import './style.sass';
2
1
  import { TemplateManager } from "../template-manager";
3
2
  declare class AlfredProgressManager extends TemplateManager {
4
3
  $alfredId: string;
@@ -21,6 +21,7 @@ interface SdkNameInterface {
21
21
  export interface EnvironmentInterface {
22
22
  mode: 'development' | 'stage' | 'production';
23
23
  locale: 'ko' | 'en';
24
+ isSetLocale: boolean;
24
25
  applicationId: string;
25
26
  API_URL: EnvironmentMode;
26
27
  ANALYTICS_URL: EnvironmentMode;
@@ -1,11 +1,5 @@
1
- import { Resource } from "./resource";
2
- import { SessionStorageManager } from "./storage";
3
- export declare const LOG_LEVEL: {
4
- debug: number;
5
- info: number;
6
- warning: number;
7
- error: number;
8
- };
1
+ import { Resource } from './resource';
2
+ import { SessionStorageManager } from './storage';
9
3
  interface EventDataModel {
10
4
  application_id?: string;
11
5
  step: string;
@@ -17,21 +11,6 @@ interface EventDataModel {
17
11
  response?: any;
18
12
  version?: string;
19
13
  }
20
- export declare const Logger: {
21
- level: number;
22
- /**
23
- * 로그 레벨을 설정한다
24
- * Comment by John
25
- * @date: 2021-02-18
26
- * @param logLevel: number
27
- */
28
- setLogLevel(logLevel: number): void;
29
- messageStringify(key: string, message: any): string | undefined;
30
- debug(key: string, message: any): void;
31
- info(key: string, message: any): void;
32
- warn(key: string, message: any): void;
33
- error(key: string, message: any): void;
34
- };
35
14
  export declare class EventLoggerManager extends Resource {
36
15
  $session: SessionStorageManager;
37
16
  $tk?: string;
@@ -0,0 +1,21 @@
1
+ export declare const LOG_LEVEL: {
2
+ debug: number;
3
+ info: number;
4
+ warning: number;
5
+ error: number;
6
+ };
7
+ export declare const Logger: {
8
+ level: number;
9
+ /**
10
+ * 로그 레벨을 설정한다
11
+ * Comment by John
12
+ * @date: 2021-02-18
13
+ * @param logLevel: number
14
+ */
15
+ setLogLevel(logLevel: number): void;
16
+ messageStringify(key: string, message: any): string | undefined;
17
+ debug(key: string, message: any): void;
18
+ info(key: string, message: any): void;
19
+ warn(key: string, message: any): void;
20
+ error(key: string, message: any): void;
21
+ };
@@ -55,6 +55,7 @@ declare class StorageManager extends BootpayManager {
55
55
  * @returns any
56
56
  */
57
57
  setToJSON(key: string, value: any): any;
58
+ caseMarshalToJson(data: string): any;
58
59
  }
59
60
  export declare class SessionStorageManager extends StorageManager {
60
61
  constructor();
@@ -1,3 +1,5 @@
1
+ import { ExternalBootpayWidgetTermsModel, ResponseBootpayWidgetTermsModel } from '../models/bootpay-widget-interface';
2
+ import { ExtraModel, WidgetExtraModel } from '../models/bootpay-interface';
1
3
  export interface WidgetStoreModel {
2
4
  el: string | undefined;
3
5
  applicationId: string | undefined;
@@ -10,8 +12,14 @@ export interface WidgetStoreModel {
10
12
  walletId?: string;
11
13
  useOnlyOOpay: boolean;
12
14
  termsPassed: boolean;
15
+ sandbox: boolean;
16
+ useTerms: boolean;
17
+ externalTerms?: ExternalBootpayWidgetTermsModel[];
18
+ extra: ExtraModel;
19
+ widgetExtra: WidgetExtraModel | undefined;
20
+ selectTerms: ResponseBootpayWidgetTermsModel[];
13
21
  setWidgetData(data: WidgetStoreData): void;
14
- setPayment(pg: string | undefined, method: string | undefined, wallet_id: string | undefined, terms: boolean): void;
22
+ setPayment(pg: string | undefined, method: string | undefined, wallet_id: string | undefined, terms: boolean, select_terms: ResponseBootpayWidgetTermsModel[], extra: ExtraModel): void;
15
23
  updateOnProcessing(data: WidgetStoreData): void;
16
24
  }
17
25
  export interface WidgetStoreData {
@@ -25,5 +33,9 @@ export interface WidgetStoreData {
25
33
  method?: string;
26
34
  wallet_id?: string;
27
35
  use_only_oopay?: boolean;
36
+ use_terms?: boolean;
37
+ sandbox?: boolean;
38
+ external_terms?: ExternalBootpayWidgetTermsModel[];
39
+ widget_extra?: WidgetExtraModel;
28
40
  }
29
41
  export declare const WidgetStore: WidgetStoreModel;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@bootpay/client-js",
3
- "version": "4.4.0",
4
- "main": "index.js",
5
- "types": "index.d.ts",
3
+ "version": "5.0.0-beta.10",
4
+ "main": "dist/index.es.js",
5
+ "types": "dist/src/index.d.ts",
6
+ "styles": "dist/index.css",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "rm -rf ./dist && NODE_ENV=build ./node_modules/.bin/webpack --output-path=./dist --mode=production && tsc --declaration && cp ./package.json dist/package.json && cp ./src/index.js ./dist/index.js && mv ./dist/src/* ./dist && rm -rf ./dist/src && cp ./README.md dist/",
9
+ "build": "rm -rf ./dist && vite build",
9
10
  "deploy": "NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"
10
11
  },
11
12
  "dependencies": {
12
- "typescript":"^5.1.6"
13
+ "typescript": "^5.1.6"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@types/ws": "^8.5.5",
@@ -18,7 +19,7 @@
18
19
  "webpack-dev-server": "^4.15.1",
19
20
  "webpack": "^5.87.0",
20
21
  "webpack-cli": "^5.1.4",
21
- "axios": "^1.4.0",
22
+ "axios": "^0.27.2",
22
23
  "crypto-js": "^4.1.1",
23
24
  "@types/crypto-js": "^4.1.1",
24
25
  "@babel/core": "^7.22.5",
@@ -35,7 +36,11 @@
35
36
  "css-loader": "^6.8.1",
36
37
  "sass": "^1.63.4",
37
38
  "sass-loader": "^13.3.2",
38
- "style-loader": "^3.3.3"
39
+ "style-loader": "^3.3.3",
40
+ "vite": "^5.0.10",
41
+ "vite-plugin-dts": "^3.6.4",
42
+ "vite-plugin-tsconfig": "^1.0.4",
43
+ "vite-plugin-css-injected-by-js": "^3.3.0"
39
44
  },
40
45
  "resolutions": {
41
46
  "@webpack-cli/serve": "^1.3.1"
package/tsconfig.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "sourceMap": false,
5
+ "lib": [
6
+ "esnext",
7
+ "dom"
8
+ ],
9
+ "module": "commonjs",
10
+ "moduleResolution": "node",
11
+ "allowSyntheticDefaultImports": true,
12
+ "resolveJsonModule": true,
13
+ "esModuleInterop": true,
14
+ "declarationMap": false,
15
+ "allowJs": true,
16
+ "declaration": true,
17
+ "emitDeclarationOnly": true,
18
+ "outDir": "./dist",
19
+ "strict": true,
20
+ "rootDir": "./",
21
+ "baseUrl": "./src/",
22
+ "paths": {
23
+ "*": [
24
+ "../node_modules/*",
25
+ "./*"
26
+ ]
27
+ }
28
+ },
29
+ "exclude": [
30
+ "**/*.spec.ts",
31
+ "node_modules",
32
+ "dist",
33
+ "public",
34
+ "webpack.config.js"
35
+ ],
36
+ "compileOnSave": false
37
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "node16",
5
+ "declarationMap": false,
6
+ "sourceMap": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "lib": [
11
+ "esnext",
12
+ "DOM"
13
+ ],
14
+ "moduleResolution": "node16",
15
+ "resolveJsonModule": true,
16
+ "esModuleInterop": true,
17
+ "declaration": true,
18
+ "allowJs": true,
19
+ "outDir": "./dist",
20
+ "rootDir": "./",
21
+ "baseUrl": "./src/",
22
+ "paths": {
23
+ "*": [
24
+ "../node_modules/*",
25
+ "./*"
26
+ ]
27
+ }
28
+ },
29
+ "include": [
30
+ "src/**/*"
31
+ ],
32
+ "exclude": [
33
+ "**/*.spec.ts",
34
+ "./node_modules",
35
+ "./dist",
36
+ "./public",
37
+ "./webpack.config.js",
38
+ "./tsconfig.json",
39
+ "./test/**/*.html"
40
+ ],
41
+ "compileOnSave": false
42
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,27 @@
1
+ import { defineConfig } from 'vite'
2
+ import dts from 'vite-plugin-dts'
3
+ import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
4
+
5
+ const path = require('path')
6
+
7
+ export default defineConfig({
8
+ build: {
9
+ target: 'es6',
10
+ minify: 'terser',
11
+ lib: {
12
+ entry: path.resolve(__dirname, 'src/index.ts'),
13
+ name: 'Bootpay',
14
+ fileName: (format) => `index.${ format }.js`
15
+ }
16
+ },
17
+ base: './',
18
+ root: './',
19
+ plugins: [
20
+ dts(),
21
+ cssInjectedByJsPlugin()
22
+ ],
23
+ publicDir: '_public',
24
+ resolve: {
25
+ extensions: ['.css', '.sass', '.scss', '.ts', '.js']
26
+ }
27
+ })
@@ -1 +0,0 @@
1
- !function(t,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var e=o();for(var i in e)("object"==typeof exports?exports:t)[i]=e[i]}}(self,(function(){return function(){"use strict";var t={d:function(o,e){for(var i in e)t.o(e,i)&&!t.o(o,i)&&Object.defineProperty(o,i,{enumerable:!0,get:e[i]})},o:function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};t.r(o),t.d(o,{default:function(){return e}});var e={mode:"production",locale:"ko",applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set:function(t){this.mode=t},setApplicationId:function(t){return this.applicationId=t,this.currentApplicationId(void 0)},setLocale:function(t){this.locale=t},currentApplicationId:function(t){return void 0===t&&(t=void 0),void 0===t?this.applicationId:t},setDevelopmentHost:function(t){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,t)},setVersion:function(t,o){this.sdkName=void 0===this.sdkNames[o]?0:this.sdkNames[o],this.sdkVersion=t},toApi:function(t){return[this.API_URL[this.mode],t].join("/")},toDoor:function(t){return[this.DOOR_URL[this.mode],t].join("/")},toWidget:function(t){return[this.WIDGET_URL[this.mode],t].join("/")},isMobile:function(){var t=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(t)},isMobileSafari:function(){var t=window.navigator.userAgent;return(t.match(/iPad/i)||t.match(/iPhone/i))&&!t.match(/CriOS/i)},toAnalytics:function(t){return[this.ANALYTICS_URL[this.mode],t].join("/")}};return o}()}));