@appthen/sdk-node 0.0.0 → 0.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.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 PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult } from '@appthen/sdk-core';
55
- export { PlatformApi, 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 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';
56
56
  export interface CreateAppThenSdkOptions {
57
57
  baseUrl: string;
58
58
  accessKey: string;
@@ -70,11 +70,18 @@ export declare class PlatformTenantClient {
70
70
  constructor(platform: PlatformApi, tenantId: string);
71
71
  /** 幂等代同步成员:重复推送只产生一个 Subject,可安全重试。 */
72
72
  syncSubject(input: PlatformSyncSubjectInput): Promise<PlatformSyncSubjectResult>;
73
+ /**
74
+ * 按标签/条件圈人并直接触达(声明式):sender 按声明 lazily create-or-get;
75
+ * 收件人 selector(标签圈人)或 receive(单点声明,如微信客服消息迁移)二选一。
76
+ */
77
+ notify(request: PlatformNotifyRequest, notify: PlatformNotifyInput): Promise<PlatformNotifyResult>;
73
78
  }
74
79
  export declare class AppThenPlatformSdk {
75
80
  private readonly http;
76
81
  readonly platform: PlatformApi;
77
82
  constructor(platform: PlatformApi, http: NodeFetchHttpAdapter);
83
+ /** 获取某个被授权租户的操作客户端(per-tenant,调用自动携带 targetTenantId)。 */
84
+ platformTenant(tenantId: string): PlatformTenantClient;
78
85
  /** 代开通租户(目标租户尚不存在,故在 sdk 根上而非 tenant client)。 */
79
86
  provisionTenant(input: PlatformProvisionTenantInput): Promise<PlatformProvisionTenantResult>;
80
87
  /** 对账:externalCorrelationId → tenantId + grants。未命中抛 CORRELATION_MISMATCH。 */
package/dist/index.js CHANGED
@@ -178,12 +178,23 @@ export class PlatformTenantClient {
178
178
  async syncSubject(input) {
179
179
  return this.platform.syncSubject(this.tenantId, input);
180
180
  }
181
+ /**
182
+ * 按标签/条件圈人并直接触达(声明式):sender 按声明 lazily create-or-get;
183
+ * 收件人 selector(标签圈人)或 receive(单点声明,如微信客服消息迁移)二选一。
184
+ */
185
+ async notify(request, notify) {
186
+ return this.platform.notify(this.tenantId, request, notify);
187
+ }
181
188
  }
182
189
  export class AppThenPlatformSdk {
183
190
  constructor(platform, http) {
184
191
  this.http = http;
185
192
  this.platform = platform;
186
193
  }
194
+ /** 获取某个被授权租户的操作客户端(per-tenant,调用自动携带 targetTenantId)。 */
195
+ platformTenant(tenantId) {
196
+ return new PlatformTenantClient(this.platform, tenantId);
197
+ }
187
198
  /** 代开通租户(目标租户尚不存在,故在 sdk 根上而非 tenant client)。 */
188
199
  async provisionTenant(input) {
189
200
  return this.platform.provisionTenant(input);
@@ -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 PlatformProvisionTenantInput, type PlatformProvisionTenantResult, type PlatformResolveTenantResult, type PlatformSyncSubjectInput, type PlatformSyncSubjectResult } from '@appthen/sdk-core';
55
- export { PlatformApi, 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 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';
56
56
  export interface CreateAppThenSdkOptions {
57
57
  baseUrl: string;
58
58
  accessKey: string;
@@ -70,11 +70,18 @@ export declare class PlatformTenantClient {
70
70
  constructor(platform: PlatformApi, tenantId: string);
71
71
  /** 幂等代同步成员:重复推送只产生一个 Subject,可安全重试。 */
72
72
  syncSubject(input: PlatformSyncSubjectInput): Promise<PlatformSyncSubjectResult>;
73
+ /**
74
+ * 按标签/条件圈人并直接触达(声明式):sender 按声明 lazily create-or-get;
75
+ * 收件人 selector(标签圈人)或 receive(单点声明,如微信客服消息迁移)二选一。
76
+ */
77
+ notify(request: PlatformNotifyRequest, notify: PlatformNotifyInput): Promise<PlatformNotifyResult>;
73
78
  }
74
79
  export declare class AppThenPlatformSdk {
75
80
  private readonly http;
76
81
  readonly platform: PlatformApi;
77
82
  constructor(platform: PlatformApi, http: NodeFetchHttpAdapter);
83
+ /** 获取某个被授权租户的操作客户端(per-tenant,调用自动携带 targetTenantId)。 */
84
+ platformTenant(tenantId: string): PlatformTenantClient;
78
85
  /** 代开通租户(目标租户尚不存在,故在 sdk 根上而非 tenant client)。 */
79
86
  provisionTenant(input: PlatformProvisionTenantInput): Promise<PlatformProvisionTenantResult>;
80
87
  /** 对账:externalCorrelationId → tenantId + grants。未命中抛 CORRELATION_MISMATCH。 */
package/dist-cjs/index.js CHANGED
@@ -203,6 +203,13 @@ class PlatformTenantClient {
203
203
  async syncSubject(input) {
204
204
  return this.platform.syncSubject(this.tenantId, input);
205
205
  }
206
+ /**
207
+ * 按标签/条件圈人并直接触达(声明式):sender 按声明 lazily create-or-get;
208
+ * 收件人 selector(标签圈人)或 receive(单点声明,如微信客服消息迁移)二选一。
209
+ */
210
+ async notify(request, notify) {
211
+ return this.platform.notify(this.tenantId, request, notify);
212
+ }
206
213
  }
207
214
  exports.PlatformTenantClient = PlatformTenantClient;
208
215
  class AppThenPlatformSdk {
@@ -210,6 +217,10 @@ class AppThenPlatformSdk {
210
217
  this.http = http;
211
218
  this.platform = platform;
212
219
  }
220
+ /** 获取某个被授权租户的操作客户端(per-tenant,调用自动携带 targetTenantId)。 */
221
+ platformTenant(tenantId) {
222
+ return new PlatformTenantClient(this.platform, tenantId);
223
+ }
213
224
  /** 代开通租户(目标租户尚不存在,故在 sdk 根上而非 tenant client)。 */
214
225
  async provisionTenant(input) {
215
226
  return this.platform.provisionTenant(input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appthen/sdk-node",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "AppThen Conversation Hub SDK - Node.js server adapter",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "dist-cjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@appthen/sdk-core": "0.0.0"
22
+ "@appthen/sdk-core": "0.0.1"
23
23
  },
24
24
  "sideEffects": false,
25
25
  "license": "UNLICENSED",