@appthen/sdk-node 0.0.2 → 0.0.4
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.d.ts +9 -2
- package/dist/index.js +11 -0
- package/dist-cjs/index.d.ts +9 -2
- package/dist-cjs/index.js +11 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -51,8 +51,8 @@ export declare class TenantAppAuthProvider implements AuthProvider {
|
|
|
51
51
|
}
|
|
52
52
|
export declare function createChatHubNodeClient(options: CreateChatHubNodeClientOptions): ChatHubClient;
|
|
53
53
|
export declare function createChatHubNodeRuntime(options: CreateChatHubNodeRuntimeOptions): ChatHubAppRuntime;
|
|
54
|
-
import { PlatformApi, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult } from '@appthen/sdk-core';
|
|
55
|
-
export { PlatformApi, type PlatformLazySubject, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformNotifySelector, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult, } from '@appthen/sdk-core';
|
|
54
|
+
import { PlatformApi, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformReissueClaimTokenResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult } from '@appthen/sdk-core';
|
|
55
|
+
export { PlatformApi, type PlatformLazySubject, type PlatformLoginIdentifierInput, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformNotifySelector, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformReissueClaimTokenResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult, } from '@appthen/sdk-core';
|
|
56
56
|
export interface CreateAppThenSdkOptions {
|
|
57
57
|
baseUrl: string;
|
|
58
58
|
accessKey: string;
|
|
@@ -75,6 +75,11 @@ export declare class PlatformTenantClient {
|
|
|
75
75
|
* 收件人 selector(标签圈人)或 receive(单点声明,如微信客服消息迁移)二选一。
|
|
76
76
|
*/
|
|
77
77
|
notify(request: PlatformNotifyRequest, notify: PlatformNotifyInput): Promise<PlatformNotifyResult>;
|
|
78
|
+
/**
|
|
79
|
+
* 重发认领凭证(**旧 token 立即失效**):租户 7 天内未认领时的补救动作。
|
|
80
|
+
* 仅 `pending` 租户可重发;已认领 → 409 `TENANT_ALREADY_CLAIMED`。
|
|
81
|
+
*/
|
|
82
|
+
reissueClaimToken(): Promise<PlatformReissueClaimTokenResult>;
|
|
78
83
|
}
|
|
79
84
|
export declare class AppThenPlatformSdk {
|
|
80
85
|
private readonly http;
|
|
@@ -86,6 +91,8 @@ export declare class AppThenPlatformSdk {
|
|
|
86
91
|
provisionTenant(input: PlatformProvisionTenantInput): Promise<PlatformProvisionTenantResult>;
|
|
87
92
|
/** 对账:externalCorrelationId → tenantId + grants。未命中抛 CORRELATION_MISMATCH。 */
|
|
88
93
|
resolveTenant(externalCorrelationId: string): Promise<PlatformResolveTenantResult>;
|
|
94
|
+
/** 为已开通的租户生成或复用管理员邀请链接。 */
|
|
95
|
+
createAdminInvite(tenantId: string, input: Parameters<PlatformApi['createAdminInvite']>[1]): ReturnType<PlatformApi['createAdminInvite']>;
|
|
89
96
|
/** 启停授权:active ↔ revoked。 */
|
|
90
97
|
toggleGrant(grantId: string, status: 'active' | 'revoked'): Promise<Record<string, unknown>>;
|
|
91
98
|
/**
|
package/dist/index.js
CHANGED
|
@@ -185,6 +185,13 @@ export class PlatformTenantClient {
|
|
|
185
185
|
async notify(request, notify) {
|
|
186
186
|
return this.platform.notify(this.tenantId, request, notify);
|
|
187
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* 重发认领凭证(**旧 token 立即失效**):租户 7 天内未认领时的补救动作。
|
|
190
|
+
* 仅 `pending` 租户可重发;已认领 → 409 `TENANT_ALREADY_CLAIMED`。
|
|
191
|
+
*/
|
|
192
|
+
async reissueClaimToken() {
|
|
193
|
+
return this.platform.reissueClaimToken(this.tenantId);
|
|
194
|
+
}
|
|
188
195
|
}
|
|
189
196
|
export class AppThenPlatformSdk {
|
|
190
197
|
constructor(platform, http) {
|
|
@@ -203,6 +210,10 @@ export class AppThenPlatformSdk {
|
|
|
203
210
|
async resolveTenant(externalCorrelationId) {
|
|
204
211
|
return this.platform.resolveTenant(externalCorrelationId);
|
|
205
212
|
}
|
|
213
|
+
/** 为已开通的租户生成或复用管理员邀请链接。 */
|
|
214
|
+
async createAdminInvite(tenantId, input) {
|
|
215
|
+
return this.platform.createAdminInvite(tenantId, input);
|
|
216
|
+
}
|
|
206
217
|
/** 启停授权:active ↔ revoked。 */
|
|
207
218
|
async toggleGrant(grantId, status) {
|
|
208
219
|
return this.platform.toggleGrant(grantId, status);
|
package/dist-cjs/index.d.ts
CHANGED
|
@@ -51,8 +51,8 @@ export declare class TenantAppAuthProvider implements AuthProvider {
|
|
|
51
51
|
}
|
|
52
52
|
export declare function createChatHubNodeClient(options: CreateChatHubNodeClientOptions): ChatHubClient;
|
|
53
53
|
export declare function createChatHubNodeRuntime(options: CreateChatHubNodeRuntimeOptions): ChatHubAppRuntime;
|
|
54
|
-
import { PlatformApi, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult } from '@appthen/sdk-core';
|
|
55
|
-
export { PlatformApi, type PlatformLazySubject, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformNotifySelector, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult, } from '@appthen/sdk-core';
|
|
54
|
+
import { PlatformApi, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformReissueClaimTokenResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult } from '@appthen/sdk-core';
|
|
55
|
+
export { PlatformApi, type PlatformLazySubject, type PlatformLoginIdentifierInput, type PlatformNotifyInput, type PlatformNotifyRequest, type PlatformNotifyResult, type PlatformNotifySelector, type PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformReissueClaimTokenResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult, } from '@appthen/sdk-core';
|
|
56
56
|
export interface CreateAppThenSdkOptions {
|
|
57
57
|
baseUrl: string;
|
|
58
58
|
accessKey: string;
|
|
@@ -75,6 +75,11 @@ export declare class PlatformTenantClient {
|
|
|
75
75
|
* 收件人 selector(标签圈人)或 receive(单点声明,如微信客服消息迁移)二选一。
|
|
76
76
|
*/
|
|
77
77
|
notify(request: PlatformNotifyRequest, notify: PlatformNotifyInput): Promise<PlatformNotifyResult>;
|
|
78
|
+
/**
|
|
79
|
+
* 重发认领凭证(**旧 token 立即失效**):租户 7 天内未认领时的补救动作。
|
|
80
|
+
* 仅 `pending` 租户可重发;已认领 → 409 `TENANT_ALREADY_CLAIMED`。
|
|
81
|
+
*/
|
|
82
|
+
reissueClaimToken(): Promise<PlatformReissueClaimTokenResult>;
|
|
78
83
|
}
|
|
79
84
|
export declare class AppThenPlatformSdk {
|
|
80
85
|
private readonly http;
|
|
@@ -86,6 +91,8 @@ export declare class AppThenPlatformSdk {
|
|
|
86
91
|
provisionTenant(input: PlatformProvisionTenantInput): Promise<PlatformProvisionTenantResult>;
|
|
87
92
|
/** 对账:externalCorrelationId → tenantId + grants。未命中抛 CORRELATION_MISMATCH。 */
|
|
88
93
|
resolveTenant(externalCorrelationId: string): Promise<PlatformResolveTenantResult>;
|
|
94
|
+
/** 为已开通的租户生成或复用管理员邀请链接。 */
|
|
95
|
+
createAdminInvite(tenantId: string, input: Parameters<PlatformApi['createAdminInvite']>[1]): ReturnType<PlatformApi['createAdminInvite']>;
|
|
89
96
|
/** 启停授权:active ↔ revoked。 */
|
|
90
97
|
toggleGrant(grantId: string, status: 'active' | 'revoked'): Promise<Record<string, unknown>>;
|
|
91
98
|
/**
|
package/dist-cjs/index.js
CHANGED
|
@@ -210,6 +210,13 @@ class PlatformTenantClient {
|
|
|
210
210
|
async notify(request, notify) {
|
|
211
211
|
return this.platform.notify(this.tenantId, request, notify);
|
|
212
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* 重发认领凭证(**旧 token 立即失效**):租户 7 天内未认领时的补救动作。
|
|
215
|
+
* 仅 `pending` 租户可重发;已认领 → 409 `TENANT_ALREADY_CLAIMED`。
|
|
216
|
+
*/
|
|
217
|
+
async reissueClaimToken() {
|
|
218
|
+
return this.platform.reissueClaimToken(this.tenantId);
|
|
219
|
+
}
|
|
213
220
|
}
|
|
214
221
|
exports.PlatformTenantClient = PlatformTenantClient;
|
|
215
222
|
class AppThenPlatformSdk {
|
|
@@ -229,6 +236,10 @@ class AppThenPlatformSdk {
|
|
|
229
236
|
async resolveTenant(externalCorrelationId) {
|
|
230
237
|
return this.platform.resolveTenant(externalCorrelationId);
|
|
231
238
|
}
|
|
239
|
+
/** 为已开通的租户生成或复用管理员邀请链接。 */
|
|
240
|
+
async createAdminInvite(tenantId, input) {
|
|
241
|
+
return this.platform.createAdminInvite(tenantId, input);
|
|
242
|
+
}
|
|
232
243
|
/** 启停授权:active ↔ revoked。 */
|
|
233
244
|
async toggleGrant(grantId, status) {
|
|
234
245
|
return this.platform.toggleGrant(grantId, status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appthen/sdk-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "AppThen Conversation Hub SDK - Node.js server adapter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"skills"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@appthen/sdk-core": "0.0.
|
|
23
|
+
"@appthen/sdk-core": "0.0.4"
|
|
24
24
|
},
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"license": "UNLICENSED",
|