@triplinkintl/embedded-card 1.0.0 → 1.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.
package/dist/index.cjs CHANGED
@@ -33,7 +33,7 @@ var import_uuid = require("uuid");
33
33
  // src/constants.ts
34
34
  var DEFAULT_LOCALE = "en-US", DEFAULT_ENV = "PROD", IFRAME_BASE_URLS = {
35
35
  FAT: "https://vcc-hosting.fat.ctripqa.com/embedded-card/cardInfo",
36
- PROD: "https://vcc-hosting.fat.ctripqa.com/embedded-card/cardInfo"
36
+ PROD: "https://www.triplinkintl.com/embedded-card/cardInfo"
37
37
  };
38
38
 
39
39
  // src/enums/resultCode.ts
@@ -46,14 +46,8 @@ function isNonEmptyString(value) {
46
46
  }
47
47
  function isSupported() {
48
48
  return [
49
- "postMessage",
49
+ "postMessage"
50
50
  // Portal/SDK 需要支持 postMessage
51
- "TextEncoder",
52
- // Portal 需要支持 TextEncoder
53
- "Uint8Array",
54
- // Portal 需要支持 Uint8Array
55
- "atob"
56
- // Portal 需要支持 atob
57
51
  ].every((key) => {
58
52
  let isSupported3 = typeof window[key] == "function";
59
53
  return isSupported3 || console.warn(`[TripLink SDK] ${key} is not supported`), isSupported3;
@@ -148,6 +142,9 @@ function renderCard(options) {
148
142
  case "CARD_INIT_SUCCESS" /* InitSuccess */:
149
143
  onSuccess();
150
144
  break;
145
+ case "BROWSER_NOT_SUPPORTED" /* BrowserNotSupported */:
146
+ onError("BROWSER_VERSION_LOW" /* BROWSER_VERSION_LOW */, "Browser version is too low");
147
+ break;
151
148
  case "CARD_INIT_FAILED" /* InitFailed */:
152
149
  let message = messagePayload?.message || "Failed to initialize card information";
153
150
  onError("CARD_INIT_FAILED" /* CARD_INIT_FAILED */, message);
package/dist/index.d.cts CHANGED
@@ -84,7 +84,7 @@ declare function renderCard(options: RenderCardOptions): RenderCardInstance;
84
84
  declare const DEFAULT_LOCALE = "en-US";
85
85
  /** 默认环境 */
86
86
  declare const DEFAULT_ENV: Env;
87
- /** 托管卡页地址 TODO */
87
+ /** 托管卡页地址 */
88
88
  declare const IFRAME_BASE_URLS: Record<Env, string>;
89
89
 
90
90
  /** 对外 SDK 命名空间:`TripLink.renderCard(...)`。 */
package/dist/index.d.ts CHANGED
@@ -84,7 +84,7 @@ declare function renderCard(options: RenderCardOptions): RenderCardInstance;
84
84
  declare const DEFAULT_LOCALE = "en-US";
85
85
  /** 默认环境 */
86
86
  declare const DEFAULT_ENV: Env;
87
- /** 托管卡页地址 TODO */
87
+ /** 托管卡页地址 */
88
88
  declare const IFRAME_BASE_URLS: Record<Env, string>;
89
89
 
90
90
  /** 对外 SDK 命名空间:`TripLink.renderCard(...)`。 */
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { v4 as uuidv4 } from "uuid";
4
4
  // src/constants.ts
5
5
  var DEFAULT_LOCALE = "en-US", DEFAULT_ENV = "PROD", IFRAME_BASE_URLS = {
6
6
  FAT: "https://vcc-hosting.fat.ctripqa.com/embedded-card/cardInfo",
7
- PROD: "https://vcc-hosting.fat.ctripqa.com/embedded-card/cardInfo"
7
+ PROD: "https://www.triplinkintl.com/embedded-card/cardInfo"
8
8
  };
9
9
 
10
10
  // src/enums/resultCode.ts
@@ -17,14 +17,8 @@ function isNonEmptyString(value) {
17
17
  }
18
18
  function isSupported() {
19
19
  return [
20
- "postMessage",
20
+ "postMessage"
21
21
  // Portal/SDK 需要支持 postMessage
22
- "TextEncoder",
23
- // Portal 需要支持 TextEncoder
24
- "Uint8Array",
25
- // Portal 需要支持 Uint8Array
26
- "atob"
27
- // Portal 需要支持 atob
28
22
  ].every((key) => {
29
23
  let isSupported3 = typeof window[key] == "function";
30
24
  return isSupported3 || console.warn(`[TripLink SDK] ${key} is not supported`), isSupported3;
@@ -119,6 +113,9 @@ function renderCard(options) {
119
113
  case "CARD_INIT_SUCCESS" /* InitSuccess */:
120
114
  onSuccess();
121
115
  break;
116
+ case "BROWSER_NOT_SUPPORTED" /* BrowserNotSupported */:
117
+ onError("BROWSER_VERSION_LOW" /* BROWSER_VERSION_LOW */, "Browser version is too low");
118
+ break;
122
119
  case "CARD_INIT_FAILED" /* InitFailed */:
123
120
  let message = messagePayload?.message || "Failed to initialize card information";
124
121
  onError("CARD_INIT_FAILED" /* CARD_INIT_FAILED */, message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triplinkintl/embedded-card",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "TripLink Embedded Card lets you show virtual card details in your own product, without taking on PCI scope.",
5
5
  "license": "MIT",
6
6
  "author": "q_yao",