@viceme-ai/sdk 0.3.0 → 0.6.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.
Files changed (84) hide show
  1. package/README.md +158 -44
  2. package/dist/browser-events.d.ts +52 -0
  3. package/dist/browser-events.d.ts.map +1 -0
  4. package/dist/capability-mount.d.ts +15 -0
  5. package/dist/capability-mount.d.ts.map +1 -0
  6. package/dist/chunks/build-endpoints-NrDmg6jf.js +12 -0
  7. package/dist/chunks/build-endpoints-NrDmg6jf.js.map +1 -0
  8. package/dist/chunks/{client-DKsaEtwq.js → client-w9vih8Ng.js} +386 -349
  9. package/dist/chunks/client-w9vih8Ng.js.map +1 -0
  10. package/dist/chunks/{version-C3KVoLNb.js → errors-C7DfLKcF.js} +14 -25
  11. package/dist/chunks/errors-C7DfLKcF.js.map +1 -0
  12. package/dist/chunks/validation-patAYhXC.js +43 -0
  13. package/dist/chunks/validation-patAYhXC.js.map +1 -0
  14. package/dist/chunks/version-uPTHb89K.js +6 -0
  15. package/dist/chunks/version-uPTHb89K.js.map +1 -0
  16. package/dist/core/build-endpoints.d.ts +2 -0
  17. package/dist/core/build-endpoints.d.ts.map +1 -1
  18. package/dist/core/capabilities.d.ts +4 -2
  19. package/dist/core/capabilities.d.ts.map +1 -1
  20. package/dist/core/client.d.ts +4 -2
  21. package/dist/core/client.d.ts.map +1 -1
  22. package/dist/core/config.d.ts +1 -1
  23. package/dist/core/config.d.ts.map +1 -1
  24. package/dist/core/errors.d.ts +1 -1
  25. package/dist/core/errors.d.ts.map +1 -1
  26. package/dist/core/lifecycle.d.ts +2 -4
  27. package/dist/core/lifecycle.d.ts.map +1 -1
  28. package/dist/core/presentation.d.ts +7 -2
  29. package/dist/core/presentation.d.ts.map +1 -1
  30. package/dist/danmaku/index.d.ts +1 -0
  31. package/dist/danmaku/index.d.ts.map +1 -1
  32. package/dist/danmaku/mount.d.ts +1 -1
  33. package/dist/danmaku/mount.d.ts.map +1 -1
  34. package/dist/danmaku.js +128 -121
  35. package/dist/danmaku.js.map +1 -1
  36. package/dist/generated/public-contract.d.ts +124 -373
  37. package/dist/generated/public-contract.d.ts.map +1 -1
  38. package/dist/index.d.ts +3 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +23 -21
  41. package/dist/index.js.map +1 -1
  42. package/dist/loader/attributes.d.ts +3 -2
  43. package/dist/loader/attributes.d.ts.map +1 -1
  44. package/dist/loader/auto-loader.d.ts +1 -1
  45. package/dist/loader/auto-loader.d.ts.map +1 -1
  46. package/dist/loader/events.d.ts +1 -44
  47. package/dist/loader/events.d.ts.map +1 -1
  48. package/dist/loader/registry.d.ts +2 -1
  49. package/dist/loader/registry.d.ts.map +1 -1
  50. package/dist/manifest.json +60 -35
  51. package/dist/session/session.d.ts +7 -6
  52. package/dist/session/session.d.ts.map +1 -1
  53. package/dist/testing/test-adapter.d.ts +1 -1
  54. package/dist/testing/test-adapter.d.ts.map +1 -1
  55. package/dist/testing.js +18 -17
  56. package/dist/testing.js.map +1 -1
  57. package/dist/tip/headless.d.ts +4 -0
  58. package/dist/tip/headless.d.ts.map +1 -0
  59. package/dist/tip/index.d.ts +67 -0
  60. package/dist/tip/index.d.ts.map +1 -0
  61. package/dist/tip/mount.d.ts +5 -0
  62. package/dist/tip/mount.d.ts.map +1 -0
  63. package/dist/tip/testing.d.ts +9 -0
  64. package/dist/tip/testing.d.ts.map +1 -0
  65. package/dist/tip/testing.js +43 -0
  66. package/dist/tip/testing.js.map +1 -0
  67. package/dist/tip/validation.d.ts +7 -0
  68. package/dist/tip/validation.d.ts.map +1 -0
  69. package/dist/tip.js +472 -0
  70. package/dist/tip.js.map +1 -0
  71. package/dist/transport/transport.d.ts +3 -1
  72. package/dist/transport/transport.d.ts.map +1 -1
  73. package/dist/version.d.ts +1 -1
  74. package/dist/viceme.min.js +5 -22
  75. package/dist/viceme.min.js.map +1 -1
  76. package/package.json +12 -7
  77. package/dist/bootstrap.min.js +0 -2
  78. package/dist/bootstrap.min.js.map +0 -1
  79. package/dist/chunks/client-DKsaEtwq.js.map +0 -1
  80. package/dist/chunks/version-C3KVoLNb.js.map +0 -1
  81. package/dist/loader/bootstrap.d.ts +0 -1
  82. package/dist/loader/bootstrap.d.ts.map +0 -1
  83. package/dist/loader/mount-handle.d.ts +0 -25
  84. package/dist/loader/mount-handle.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # @viceme-ai/sdk
2
2
 
3
- Public ViceMe browser SDK: headless core, public session, and capability
4
- subpaths for static HTML, browser-native ESM, React/Next.js, and
5
- Agent-generated sites.
3
+ ViceMe browser SDK for Shop-hosted engagement and origin-bound Website Work access.
4
+
5
+ The release PR atomically owns the package version, runtime manifest, and
6
+ changelog update. During the current preview stage, publication does not
7
+ require a repository license file. The root `LICENSE-PENDING.md` records the
8
+ deferred decision without blocking release; licensing will be finalized
9
+ separately.
6
10
 
7
11
  ## Install
8
12
 
@@ -10,63 +14,173 @@ Agent-generated sites.
10
14
  pnpm add @viceme-ai/sdk
11
15
  ```
12
16
 
13
- ## Usage
17
+ ## Static HTML
18
+
19
+ ```html
20
+ <div id="viceme-engagement"></div>
21
+ <script
22
+ defer
23
+ src="https://s3.viceme.cn/viceme-sdk/0.5.0/viceme.min.js"
24
+ data-viceme-work="wrk_live_demo"
25
+ data-viceme-region="cn"
26
+ data-viceme-features="danmaku,tip"
27
+ data-viceme-target="#viceme-engagement"
28
+ data-viceme-theme="auto"
29
+ ></script>
30
+ ```
31
+
32
+ The feature declaration accepts `danmaku`, `tip`, or both without whitespace or
33
+ duplicates.
34
+
35
+ Static CDN entry points always use an immutable exact-version directory. The CN
36
+ host is `s3.viceme.cn`; GLOBAL uses `s3.viceme.ai`. The `0.5.0` URL above is the
37
+ current source target and is unavailable until that exact release is published
38
+ and verified.
39
+
40
+ With CSP, allow the exact regional S3 origin in `script-src` and `connect-src`,
41
+ the exact regional Shop origin in `frame-src`, and keep `object-src 'none'`. A
42
+ nonce with `'strict-dynamic'` may authorize dynamic scripts, but the other
43
+ directives still need exact origins. Do not use `*` or a ViceMe subdomain
44
+ wildcard.
45
+
46
+ ## ESM
14
47
 
15
48
  ```ts
16
49
  import { createViceMe } from '@viceme-ai/sdk';
50
+ import { mountDanmaku } from '@viceme-ai/sdk/danmaku';
51
+ import { mountTip } from '@viceme-ai/sdk/tip';
17
52
 
18
- const client = createViceMe({ workKey: 'wrk_public_xxx', region: 'cn' });
53
+ const client = createViceMe({ workKey: 'wrk_live_demo', region: 'cn' });
19
54
  await client.ready();
20
55
 
21
- // Use server-authoritative titles and prices in the host site's existing
22
- // Button/Card components. This does not open or customize ViceMe checkout.
23
- const features = await client.access.getFeatures();
24
- const emperor = features.find((feature) => feature.featureKey === 'emperor');
25
-
26
- const access = await client.access.checkMany(['dingdong', 'emperor']);
27
- if (access.dingdong.allowed) enableDingdong();
28
- if (access.emperor.allowed) enableEmperor();
56
+ const target = document.querySelector('#viceme-engagement');
57
+ if (!target) throw new Error('ViceMe target missing');
29
58
 
30
- // Call from a user gesture. A denied decision opens the ViceMe
31
- // bottom-sheet/in-page Web Component. Creator details and recent work covers appear
32
- // above one authorization action; accepted authorization automatically follows.
33
- const decision = await client.access.require('emperor');
34
- if (decision.allowed) enableEmperor();
59
+ const results = await Promise.allSettled([
60
+ mountDanmaku(client, { target, theme: 'auto' }),
61
+ mountTip(client, { target, theme: 'auto' }),
62
+ ]);
63
+ const mounted = results.flatMap((result) => (result.status === 'fulfilled' ? [result.value] : []));
35
64
 
65
+ mounted.forEach((handle) => handle.destroy());
36
66
  client.destroy();
37
67
  ```
38
68
 
39
- When adding a host-side locked state or purchase entry, preserve the site's
40
- existing component library, design tokens, responsive behavior, and feedback
41
- patterns. Keep the original business action unchanged and call it only after
42
- `access.require()` returns an allowed decision. Never hard-code a price from
43
- local configuration; `getFeatures()` returns the current display price. The
44
- ViceMe-owned authorization and checkout layer remains isolated and unchanged.
69
+ Run those cleanup calls from the owning component's unmount path or another
70
+ explicit lifecycle boundary, not from `pagehide` (which also covers bfcache).
71
+
72
+ `createViceMe` and `ready()` are purely local and never contact Shop. A live client reports
73
+ build support for `danmaku` and `tip`; Shop remains authoritative for whether a
74
+ Work enables either capability. The hosted `/embed/danmaku` iframe uses Shop's
75
+ internal SDK to read and create anonymous messages through
76
+ `/v1/danmaku/messages`. The `/widget/tip/<workKey>` iframe owns confirmation,
77
+ payment, risk, and result authority. Visitors do not sign in to ViceMe and are
78
+ anonymous to the creator; the observed parent Origin is attribution rather than
79
+ an authorization gate.
80
+
81
+ Pass a selected public pair value: `keys.test` is `wrk_test_...` and `keys.live`
82
+ is `wrk_live_...`. Other Work key shapes are rejected locally.
83
+
84
+ Access operations establish a short-lived, memory-only Work session on first
85
+ use. They expose `client.auth`, `client.access`, and `client.checkout`; login,
86
+ explicit follow, and hosted checkout remain ViceMe-owned UI. The host never
87
+ receives a general ViceMe session or payment credential. Tests can inject a
88
+ deterministic transport and presenter through `@viceme-ai/sdk/testing`.
89
+
90
+ Website access login renders the work-bound WeChat QR code directly in the SDK
91
+ layer. Paid access keeps desktop QR payment and WeChat JSAPI in that layer;
92
+ mobile H5/WAP payment may open a provider page or app. The original page polls
93
+ the server-authoritative access decision and closes the layer after entitlement
94
+ is active. This behavior does not change the separate Tip Widget flow.
45
95
 
46
- The SDK registers and mounts `<viceme-access-layer>` with isolated ViceMe-owned
47
- styles. Authorization and checkout remain inside its iframe area and complete through
48
- an origin- and channel-validated message; no browser popup, page navigation,
49
- `confirm`, or `alert` is used. Custom site presenters and style inference are
50
- not part of the current public contract. WeChat opens directly inside the frame,
51
- and the checkout frame keeps a stable height while its content loads.
96
+ ```ts
97
+ const decisions = await client.access.checkMany(['members', 'pro-tools']);
98
+ if (!decisions['pro-tools']?.allowed) {
99
+ await client.access.require('pro-tools');
100
+ }
101
+ ```
102
+
103
+ The Tip subpath exports `TipPaidDetail` and `TipWidgetCloseDetail` for the
104
+ sanitized `viceme:tip-paid` and `viceme:widget-close` `CustomEvent` details.
105
+ `TipPaidDetail` contains only `status`, trusted `work.id/title`, amount, and CNY;
106
+ it contains no key, provider, order number, token, or transaction identifier.
52
107
 
53
- Static HTML sites can use the CDN auto-loader instead see the
54
- [repository README](https://github.com/ViceMe-AI/sdk).
108
+ The danmaku mount hashes the canonical page URL locally, combines it with a 10%
109
+ scroll bucket, and sends only the opaque anchor to the hosted iframe. Destroying
110
+ the mount removes its nodes, listeners, debounce timer, and location poll.
55
111
 
56
- ## Testing your integration
112
+ The Tip mount sends no amount, provider, token, or application ID. It enables
113
+ interaction only after a trusted resize handshake. Shop resets its hosted
114
+ payment surface on Escape before sending close; the SDK forwards sanitized
115
+ close and paid notifications, and removes its iframe, timer, media listener,
116
+ and message listener on destroy.
117
+
118
+ ## Headless Tip
119
+
120
+ This additive API targets `0.5.0`. Do not expect `createTip` or
121
+ `@viceme-ai/sdk/tip/testing` from the immutable npm `0.4.0` package.
57
122
 
58
123
  ```ts
59
- import { createTestViceMe, createMemoryTransport } from '@viceme-ai/sdk/testing';
60
-
61
- const client = createTestViceMe({
62
- workKey: 'wrk_test',
63
- region: 'cn',
64
- transport: createMemoryTransport({
65
- work: { key: 'wrk_test', capabilities: ['fixture'] },
66
- }),
124
+ import { createViceMe } from '@viceme-ai/sdk';
125
+ import { createTip } from '@viceme-ai/sdk/tip';
126
+
127
+ const client = createViceMe({ workKey: 'wrk_live_demo', region: 'cn' });
128
+ const tip = createTip(client);
129
+ const config = await tip.getConfig();
130
+
131
+ button.addEventListener('click', async () => {
132
+ const result = await tip.open({
133
+ amountCents: config.amount.minCents,
134
+ provider: config.providers[0],
135
+ locale: 'zh-CN',
136
+ appearance: 'auto',
137
+ });
138
+ console.log(result.status);
67
139
  });
68
- await client.ready();
140
+
141
+ function destroyTip() {
142
+ tip.destroy();
143
+ client.destroy();
144
+ }
145
+ ```
146
+
147
+ Call `destroyTip()` from the owning component or route cleanup. Do not bind it
148
+ to `pagehide`, because that event also fires when a page enters the bfcache.
149
+
150
+ `getConfig()` strictly parses the credential-free regional
151
+ `GET /v1/work-sdk/<encoded-workKey>/tip-config` response. Call `open()` directly
152
+ from user activation so it can create its secure full-screen frame in the same
153
+ call stack. Only `PAID`, `CANCELLED`, and `UNKNOWN` cross back; no order number,
154
+ token, payment action, or transaction ID is exposed. `scene`, `metadata`, and
155
+ `testMode` are rejected or absent from the API.
156
+
157
+ The config `environment` remains server-authoritative. The SDK checks only that
158
+ `wrk_test_...` is paired with `SANDBOX` and `wrk_live_...` with `PRODUCTION`, and
159
+ rejects inconsistent responses.
160
+
161
+ The first Tip release is CN/CNY only. `region: 'global'` fails locally with
162
+ `CAPABILITY_DISABLED` without a config request or iframe. Anonymous Tip does not
163
+ use the legacy WeChat JSAPI user/OpenID path.
164
+
165
+ `TIP_CONFIG_INVALID` is a non-retryable Shop/SDK contract mismatch and should be
166
+ reported rather than retried. `TIP_OPEN_IN_PROGRESS` means the existing call
167
+ must settle first. `TIP_READY_TIMEOUT` is retryable after the failed call has
168
+ cleaned itself up. On every component or route unmount, call `tip.destroy()`
169
+ before `client.destroy()` so an in-flight flow settles as `UNKNOWN` and leaves
170
+ no portal or message listener behind.
171
+
172
+ Immutable exact-version CDN ESM exports the same implementation from
173
+ `<origin>/viceme-sdk/<version>/index.js` and `tip.js` without adding a `window`
174
+ global.
175
+
176
+ Use the scoped fake in components and Storybook:
177
+
178
+ ```ts
179
+ import { createTestTip } from '@viceme-ai/sdk/tip/testing';
180
+
181
+ const paid = createTestTip({ config, outcome: 'PAID' });
182
+ const failed = createTestTip({ config, outcome: new Error('fixture failure') });
69
183
  ```
70
184
 
71
- Consumers branch on stable `ViceMeError.code` values only never on error
72
- messages. Work-session tokens and work-scoped users remain in memory only.
185
+ The config may also be an `Error`. `SANDBOX` is always supplied by server config
186
+ for a test Work, never by a production SDK switch.
@@ -0,0 +1,52 @@
1
+ /** Stable, allowlisted `viceme:*` DOM events shared by hosted capabilities. */
2
+ import type { ViceMeErrorCode } from './core/errors.ts';
3
+ export interface VicemeReadyDetail {
4
+ clientKey: string;
5
+ workKey: string;
6
+ capabilities: string[];
7
+ version: string;
8
+ }
9
+ export interface VicemeCapabilityReadyDetail {
10
+ clientKey: string;
11
+ instanceKey: string;
12
+ capability: string;
13
+ version: string;
14
+ }
15
+ export interface VicemeErrorDetail {
16
+ clientKey?: string;
17
+ instanceKey?: string;
18
+ capability?: string;
19
+ code: ViceMeErrorCode;
20
+ retryable: boolean;
21
+ requestId?: string;
22
+ }
23
+ export interface VicemeDestroyedDetail {
24
+ clientKey: string;
25
+ instanceKey: string;
26
+ capability: string;
27
+ }
28
+ export interface VicemeWidgetCloseDetail {
29
+ workId: string;
30
+ }
31
+ export interface VicemeTipPaidDetail {
32
+ status: 'PAID';
33
+ work: {
34
+ id: string;
35
+ title: string;
36
+ };
37
+ amountCents: number;
38
+ currency: 'CNY';
39
+ }
40
+ export type VicemeEventType = 'viceme:ready' | 'viceme:capability-ready' | 'viceme:error' | 'viceme:destroyed' | 'viceme:widget-close' | 'viceme:tip-paid';
41
+ export type VicemeEventDetailMap = {
42
+ 'viceme:ready': VicemeReadyDetail;
43
+ 'viceme:capability-ready': VicemeCapabilityReadyDetail;
44
+ 'viceme:error': VicemeErrorDetail;
45
+ 'viceme:destroyed': VicemeDestroyedDetail;
46
+ 'viceme:widget-close': VicemeWidgetCloseDetail;
47
+ 'viceme:tip-paid': VicemeTipPaidDetail;
48
+ };
49
+ /** Strip anything outside the documented allowlist before dispatch. */
50
+ export declare function sanitizeDetail(type: VicemeEventType, detail: VicemeEventDetailMap[VicemeEventType]): VicemeEventDetailMap[VicemeEventType];
51
+ export declare function dispatchViceMeEvent<K extends VicemeEventType>(target: EventTarget, type: K, detail: VicemeEventDetailMap[K]): void;
52
+ //# sourceMappingURL=browser-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-events.d.ts","sourceRoot":"","sources":["../src/browser-events.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,yBAAyB,GACzB,cAAc,GACd,kBAAkB,GAClB,qBAAqB,GACrB,iBAAiB,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,iBAAiB,CAAC;IAClC,yBAAyB,EAAE,2BAA2B,CAAC;IACvD,cAAc,EAAE,iBAAiB,CAAC;IAClC,kBAAkB,EAAE,qBAAqB,CAAC;IAC1C,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,iBAAiB,EAAE,mBAAmB,CAAC;CACxC,CAAC;AAcF,uEAAuE;AACvE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,oBAAoB,CAAC,eAAe,CAAC,GAC5C,oBAAoB,CAAC,eAAe,CAAC,CAgBvC;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,eAAe,EAC3D,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC9B,IAAI,CAQN"}
@@ -0,0 +1,15 @@
1
+ import type { ViceMeClient } from './core/client.ts';
2
+ export interface CapabilityMountOptions {
3
+ /** Mount host element; the capability owns its Shadow DOM subtree. */
4
+ target: Element;
5
+ theme: 'light' | 'dark' | 'auto';
6
+ /** Abort a mount that has not completed and destroy it after completion. */
7
+ signal?: AbortSignal;
8
+ }
9
+ /** A capability's own lifecycle handle; the loader assigns public identity. */
10
+ export interface CapabilityMountHandle {
11
+ readonly capability: string;
12
+ destroy(): void;
13
+ }
14
+ export type CapabilityMountFunction = (client: ViceMeClient, options: CapabilityMountOptions) => Promise<CapabilityMountHandle>;
15
+ //# sourceMappingURL=capability-mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-mount.d.ts","sourceRoot":"","sources":["../src/capability-mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,uBAAuB,GAAG,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ const t = {
2
+ cn: "https://api.viceme.cn",
3
+ global: "https://api.viceme.ai"
4
+ }, c = {
5
+ cn: "https://viceme.cn",
6
+ global: "https://viceme.ai"
7
+ };
8
+ export {
9
+ c as B,
10
+ t as a
11
+ };
12
+ //# sourceMappingURL=build-endpoints-NrDmg6jf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-endpoints-NrDmg6jf.js","sources":["../../src/core/build-endpoints.ts"],"sourcesContent":["declare const __VICEME_BUILD_CN_API_BASE_URL__: string | undefined;\ndeclare const __VICEME_BUILD_GLOBAL_API_BASE_URL__: string | undefined;\ndeclare const __VICEME_BUILD_CN_WIDGET_ORIGIN__: string | undefined;\ndeclare const __VICEME_BUILD_GLOBAL_WIDGET_ORIGIN__: string | undefined;\n\n/** Public Shop API origins baked into immutable release artifacts. */\nexport const BUILD_API_BASE_URLS = {\n cn:\n typeof __VICEME_BUILD_CN_API_BASE_URL__ === 'string'\n ? __VICEME_BUILD_CN_API_BASE_URL__\n : 'https://api.viceme.cn',\n global:\n typeof __VICEME_BUILD_GLOBAL_API_BASE_URL__ === 'string'\n ? __VICEME_BUILD_GLOBAL_API_BASE_URL__\n : 'https://api.viceme.ai',\n} as const;\n\n/** Hosted Shop origins baked into immutable release artifacts. */\nexport const BUILD_WIDGET_ORIGINS = {\n cn:\n typeof __VICEME_BUILD_CN_WIDGET_ORIGIN__ === 'string'\n ? __VICEME_BUILD_CN_WIDGET_ORIGIN__\n : 'https://viceme.cn',\n global:\n typeof __VICEME_BUILD_GLOBAL_WIDGET_ORIGIN__ === 'string'\n ? __VICEME_BUILD_GLOBAL_WIDGET_ORIGIN__\n : 'https://viceme.ai',\n} as const;\n"],"names":["BUILD_API_BASE_URLS","BUILD_WIDGET_ORIGINS"],"mappings":"AAMO,MAAMA,IAAsB;AAAA,EACjC,IAEM;AAAA,EAEN,QAEM;AAER,GAGaC,IAAuB;AAAA,EAClC,IAEM;AAAA,EAEN,QAEM;AAER;"}