@eclaw/openclaw-channel 1.0.2 → 1.0.3
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/client.d.ts +0 -1
- package/dist/client.js +0 -5
- package/dist/config.js +1 -1
- package/dist/onboarding.js +2 -9
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
export class EClawClient {
|
|
6
6
|
apiBase;
|
|
7
7
|
apiKey;
|
|
8
|
-
apiSecret;
|
|
9
8
|
deviceId = null;
|
|
10
9
|
botSecret = null;
|
|
11
10
|
entityId;
|
|
12
11
|
constructor(config) {
|
|
13
12
|
this.apiBase = config.apiBase;
|
|
14
13
|
this.apiKey = config.apiKey;
|
|
15
|
-
this.apiSecret = config.apiSecret;
|
|
16
14
|
this.entityId = config.entityId;
|
|
17
15
|
}
|
|
18
16
|
/** Register callback URL with E-Claw backend */
|
|
@@ -22,7 +20,6 @@ export class EClawClient {
|
|
|
22
20
|
headers: { 'Content-Type': 'application/json' },
|
|
23
21
|
body: JSON.stringify({
|
|
24
22
|
channel_api_key: this.apiKey,
|
|
25
|
-
channel_api_secret: this.apiSecret,
|
|
26
23
|
callback_url: callbackUrl,
|
|
27
24
|
callback_token: callbackToken,
|
|
28
25
|
}),
|
|
@@ -41,7 +38,6 @@ export class EClawClient {
|
|
|
41
38
|
headers: { 'Content-Type': 'application/json' },
|
|
42
39
|
body: JSON.stringify({
|
|
43
40
|
channel_api_key: this.apiKey,
|
|
44
|
-
channel_api_secret: this.apiSecret,
|
|
45
41
|
entityId,
|
|
46
42
|
name: name || undefined,
|
|
47
43
|
}),
|
|
@@ -83,7 +79,6 @@ export class EClawClient {
|
|
|
83
79
|
headers: { 'Content-Type': 'application/json' },
|
|
84
80
|
body: JSON.stringify({
|
|
85
81
|
channel_api_key: this.apiKey,
|
|
86
|
-
channel_api_secret: this.apiSecret,
|
|
87
82
|
}),
|
|
88
83
|
});
|
|
89
84
|
}
|
package/dist/config.js
CHANGED
|
@@ -15,7 +15,7 @@ export function resolveAccount(cfg, accountId) {
|
|
|
15
15
|
return {
|
|
16
16
|
enabled: account?.enabled ?? true,
|
|
17
17
|
apiKey: account?.apiKey ?? '',
|
|
18
|
-
apiSecret: account?.apiSecret
|
|
18
|
+
apiSecret: account?.apiSecret,
|
|
19
19
|
apiBase: (account?.apiBase ?? 'https://eclawbot.com').replace(/\/$/, ''),
|
|
20
20
|
entityId: account?.entityId ?? 0,
|
|
21
21
|
botName: account?.botName,
|
package/dist/onboarding.js
CHANGED
|
@@ -7,7 +7,7 @@ export const eclawOnboardingAdapter = {
|
|
|
7
7
|
const ids = listAccountIds(cfg);
|
|
8
8
|
const configured = ids.some((id) => {
|
|
9
9
|
const acc = resolveAccount(cfg, id);
|
|
10
|
-
return Boolean(acc.apiKey
|
|
10
|
+
return Boolean(acc.apiKey);
|
|
11
11
|
});
|
|
12
12
|
return {
|
|
13
13
|
channel: 'eclaw',
|
|
@@ -24,7 +24,7 @@ export const eclawOnboardingAdapter = {
|
|
|
24
24
|
await prompter.note([
|
|
25
25
|
'1. Log in to https://eclawbot.com',
|
|
26
26
|
'2. Go to Portal → Settings → Channel API',
|
|
27
|
-
'3. Create an API Key
|
|
27
|
+
'3. Create an API Key',
|
|
28
28
|
'4. Enter the credentials below',
|
|
29
29
|
].join('\n'), 'E-Claw Setup');
|
|
30
30
|
const apiKey = await prompter.text({
|
|
@@ -33,12 +33,6 @@ export const eclawOnboardingAdapter = {
|
|
|
33
33
|
initialValue: resolved.apiKey || '',
|
|
34
34
|
validate: (v) => (String(v ?? '').trim() ? undefined : 'Required'),
|
|
35
35
|
});
|
|
36
|
-
const apiSecret = await prompter.text({
|
|
37
|
-
message: 'Channel API Secret',
|
|
38
|
-
placeholder: 'ecs_...',
|
|
39
|
-
initialValue: resolved.apiSecret || '',
|
|
40
|
-
validate: (v) => (String(v ?? '').trim() ? undefined : 'Required'),
|
|
41
|
-
});
|
|
42
36
|
const entityIdStr = await prompter.text({
|
|
43
37
|
message: 'Entity ID (0–3)',
|
|
44
38
|
placeholder: '0',
|
|
@@ -63,7 +57,6 @@ export const eclawOnboardingAdapter = {
|
|
|
63
57
|
...(cfg.channels?.eclaw?.accounts ?? {}), // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
64
58
|
[accountId]: {
|
|
65
59
|
apiKey: String(apiKey).trim(),
|
|
66
|
-
apiSecret: String(apiSecret).trim(),
|
|
67
60
|
apiBase: resolved.apiBase || 'https://eclawbot.com',
|
|
68
61
|
entityId: Number(entityIdStr),
|
|
69
62
|
botName: String(botName).trim() || undefined,
|
package/dist/types.d.ts
CHANGED