arcy.js 0.1.0 → 0.1.2
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/arcy.chat.39921845e233.js +1271 -0
- package/dist/arcy.legacy.7037dec7a67f.js +568 -0
- package/dist/arcy.loader.js +1 -1
- package/dist/arcy.modern.0ffea3108a8d.js +568 -0
- package/dist/arcy.picker.73f47221b73c.js +59 -0
- package/dist/chat-IU4IJMGO.js +3860 -0
- package/dist/chunk-7VVKR3AO.js +122 -0
- package/dist/chunk-CQ2DESAJ.js +263 -0
- package/dist/chunk-DKYMIAYF.js +7 -0
- package/dist/chunk-DW3GUQ6J.js +234 -0
- package/dist/chunk-FR6SJSDU.js +220 -0
- package/dist/chunk-LGWYJSYX.js +271 -0
- package/dist/chunk-NIHUDSWK.js +155 -0
- package/dist/chunk-NY3NXM2V.js +213 -0
- package/dist/design-mode.js +2 -127
- package/dist/flow-M7W3H3C5.js +1422 -0
- package/dist/index.cjs +9915 -1158
- package/dist/index.d.ts +44 -8
- package/dist/index.js +799 -1157
- package/dist/picker-JPESE6JJ.js +2134 -0
- package/package.json +1 -1
- package/dist/arcy.chat.ab181cf5a84b.js +0 -1258
- package/dist/arcy.legacy.ab4e9266b657.js +0 -567
- package/dist/arcy.modern.60faeffc62a2.js +0 -567
- package/dist/arcy.picker.c598a581d964.js +0 -59
- package/dist/design-mode.d.cts +0 -197
- package/dist/index.d.cts +0 -133
- package/dist/snippet.d.cts +0 -39
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,21 @@ type Unsubscribe = () => void;
|
|
|
22
22
|
*/
|
|
23
23
|
type AttributeValue = string | number | boolean | null | string[];
|
|
24
24
|
type Attributes = Record<string, AttributeValue>;
|
|
25
|
+
/**
|
|
26
|
+
* What a caller may hand `identify()`, and it is deliberately wider than what
|
|
27
|
+
* goes on the wire (ADR 0194).
|
|
28
|
+
*
|
|
29
|
+
* `undefined` means "nothing to send for this key": the key is dropped from the
|
|
30
|
+
* payload before it leaves the browser, silently, and never reaches the server.
|
|
31
|
+
* It exists because every auth SDK returns optional fields, so the line an
|
|
32
|
+
* operator naturally writes is `user_email: user.primaryEmailAddress?.emailAddress`,
|
|
33
|
+
* and a type that refuses it refuses the install snippet we publish.
|
|
34
|
+
*
|
|
35
|
+
* This keeps the three spellings distinct. An absent key means "do not touch",
|
|
36
|
+
* `null` means "clear it", and a value means "set it". `undefined` is the first
|
|
37
|
+
* of those, spelled the way JavaScript spells it.
|
|
38
|
+
*/
|
|
39
|
+
type AttributesInput = Record<string, AttributeValue | undefined>;
|
|
25
40
|
/**
|
|
26
41
|
* The complete set of `init()` options, and it is complete by design
|
|
27
42
|
* (PRODUCT_SCOPE §11.5.1, resolved at G1 as Q41). **Reopened once, D733**
|
|
@@ -41,6 +56,21 @@ type Attributes = Record<string, AttributeValue>;
|
|
|
41
56
|
interface ArcyOptions {
|
|
42
57
|
/** Consent signal for behavioral telemetry. A cookie banner is code. */
|
|
43
58
|
telemetry?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Where the widget talks to ARCY, if not `https://api.arcyai.com`.
|
|
61
|
+
*
|
|
62
|
+
* The fifth escape hatch (D1396, ADR 0186), and it exists for one reason:
|
|
63
|
+
* a page under a Content Security Policy has to name every origin the
|
|
64
|
+
* widget reaches, and a customer who would rather name none can rewrite a
|
|
65
|
+
* path on their own domain to our API and pass it here. Session, chat,
|
|
66
|
+
* flows, telemetry, image uploads and the panel's web fonts all follow it,
|
|
67
|
+
* so proxying moves the whole widget rather than most of it.
|
|
68
|
+
*
|
|
69
|
+
* An origin or an origin with a path prefix, no trailing slash, for
|
|
70
|
+
* example `https://example.com/_arcy`. Anything that is not a string is
|
|
71
|
+
* ignored with a warning, like every other bad option.
|
|
72
|
+
*/
|
|
73
|
+
apiBase?: string;
|
|
44
74
|
/**
|
|
45
75
|
* The host app usually knows the user's language before ARCY loads.
|
|
46
76
|
*
|
|
@@ -106,9 +136,9 @@ interface IdentifyOptions {
|
|
|
106
136
|
}
|
|
107
137
|
interface Arcy {
|
|
108
138
|
init(token: string, options?: ArcyOptions): Promise<void>;
|
|
109
|
-
identify(userId: string, attributes?:
|
|
110
|
-
identifyAnonymous(attributes?:
|
|
111
|
-
updateUser(attributes?:
|
|
139
|
+
identify(userId: string, attributes?: AttributesInput, options?: IdentifyOptions): Promise<void>;
|
|
140
|
+
identifyAnonymous(attributes?: AttributesInput): Promise<void>;
|
|
141
|
+
updateUser(attributes?: AttributesInput): Promise<void>;
|
|
112
142
|
reset(): void;
|
|
113
143
|
open(): void;
|
|
114
144
|
close(): void;
|
|
@@ -121,13 +151,19 @@ interface Arcy {
|
|
|
121
151
|
* so the ESM, CJS, and IIFE builds all carry the same value with no build-time
|
|
122
152
|
* indirection. Bumped with the package version.
|
|
123
153
|
*/
|
|
124
|
-
declare const VERSION = "0.1.
|
|
154
|
+
declare const VERSION = "0.1.1";
|
|
125
155
|
|
|
126
156
|
/**
|
|
127
|
-
* The namespace object
|
|
128
|
-
* the
|
|
129
|
-
*
|
|
157
|
+
* The namespace object, and the npm build's default export. `src/browser.ts`
|
|
158
|
+
* builds the same object for `window.arcy` on the script path.
|
|
159
|
+
*
|
|
160
|
+
* The two entry points differ in exactly one argument (ADR 0185): this one
|
|
161
|
+
* loads the chat panel, the flow engine and the picker with `import()`, so
|
|
162
|
+
* they become chunks in the customer's own build on the customer's own
|
|
163
|
+
* origin. The script build injects them from the CDN, which is the origin
|
|
164
|
+
* its install snippet already comes from. Nothing else about the two paths
|
|
165
|
+
* differs, and a call written against one behaves identically on the other.
|
|
130
166
|
*/
|
|
131
167
|
declare const arcy: Arcy;
|
|
132
168
|
|
|
133
|
-
export { type Arcy, type ArcyEvent, type ArcyEventHandler, type ArcyOptions, type AttributeValue, type Attributes, type Unsubscribe, VERSION, arcy as default };
|
|
169
|
+
export { type Arcy, type ArcyEvent, type ArcyEventHandler, type ArcyOptions, type AttributeValue, type Attributes, type AttributesInput, type Unsubscribe, VERSION, arcy as default };
|