@byted-apaas/server-sdk-node 1.1.23 → 1.1.24

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 (131) hide show
  1. package/application/application.d.ts +33 -0
  2. package/application/application.js +2 -0
  3. package/application/function/function.d.ts +14 -0
  4. package/application/function/function.js +20 -0
  5. package/application/impl/common.d.ts +2 -0
  6. package/application/impl/common.js +52 -0
  7. package/application/impl/impl.d.ts +19 -0
  8. package/application/impl/impl.js +45 -0
  9. package/common/structs.d.ts +15 -0
  10. package/common/structs.js +21 -0
  11. package/constants/constants.d.ts +13 -0
  12. package/constants/constants.js +18 -0
  13. package/context/context.d.ts +44 -0
  14. package/context/context.js +25 -0
  15. package/context/db/db.d.ts +110 -0
  16. package/context/db/db.js +2 -0
  17. package/context/db/impl/IObject.d.ts +303 -0
  18. package/context/db/impl/IObject.js +5 -0
  19. package/context/db/impl/IObjectV3.d.ts +239 -0
  20. package/context/db/impl/IObjectV3.js +5 -0
  21. package/context/db/impl/db.d.ts +62 -0
  22. package/context/db/impl/db.js +84 -0
  23. package/context/db/impl/dbV3.d.ts +35 -0
  24. package/context/db/impl/dbV3.js +50 -0
  25. package/context/db/impl/object.d.ts +123 -0
  26. package/context/db/impl/object.js +1008 -0
  27. package/context/db/impl/oql/ioql.d.ts +14 -0
  28. package/context/db/impl/oql/ioql.js +4 -0
  29. package/context/db/impl/oql/oql.d.ts +14 -0
  30. package/context/db/impl/oql/oql.js +39 -0
  31. package/context/db/impl/order.d.ts +9 -0
  32. package/context/db/impl/order.js +15 -0
  33. package/context/db/impl/propertiesStore.d.ts +8 -0
  34. package/context/db/impl/propertiesStore.js +29 -0
  35. package/context/db/impl/queryBuilder.d.ts +33 -0
  36. package/context/db/impl/queryBuilder.js +72 -0
  37. package/context/db/impl/transaction/index.d.ts +25 -0
  38. package/context/db/impl/transaction/index.js +300 -0
  39. package/context/db/impl/transaction/operation.d.ts +27 -0
  40. package/context/db/impl/transaction/operation.js +69 -0
  41. package/context/db/impl/transaction.d.ts +70 -0
  42. package/context/db/impl/transaction.js +4 -0
  43. package/context/globalConfig/globalConfig.d.ts +7 -0
  44. package/context/globalConfig/globalConfig.js +16 -0
  45. package/context/integration/IIntegration.d.ts +30 -0
  46. package/context/integration/IIntegration.js +4 -0
  47. package/context/integration/impl/integration.d.ts +16 -0
  48. package/context/integration/impl/integration.js +62 -0
  49. package/context/metadata/components/common.d.ts +6 -0
  50. package/context/metadata/components/common.js +17 -0
  51. package/context/metadata/components/components.d.ts +12 -0
  52. package/context/metadata/components/components.js +19 -0
  53. package/context/metadata/components/desktop/list.d.ts +16 -0
  54. package/context/metadata/components/desktop/list.js +402 -0
  55. package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
  56. package/context/metadata/components/desktop/recordDetail.js +53 -0
  57. package/context/metadata/components/mobile/list.d.ts +24 -0
  58. package/context/metadata/components/mobile/list.js +145 -0
  59. package/context/metadata/metadata.d.ts +63 -0
  60. package/context/metadata/metadata.js +125 -0
  61. package/context/metadata/objects/fields.d.ts +158 -0
  62. package/context/metadata/objects/fields.js +369 -0
  63. package/context/metadata/objects/fields.util.d.ts +52 -0
  64. package/context/metadata/objects/fields.util.js +420 -0
  65. package/context/metadata/objects/fieldsV3.d.ts +159 -0
  66. package/context/metadata/objects/fieldsV3.js +369 -0
  67. package/context/metadata/objects/objects.d.ts +11 -0
  68. package/context/metadata/objects/objects.js +20 -0
  69. package/context/metadata/types/common.d.ts +11 -0
  70. package/context/metadata/types/common.js +33 -0
  71. package/context/metadata/types/components.d.ts +90 -0
  72. package/context/metadata/types/components.js +4 -0
  73. package/context/metadata/types/objects.d.ts +246 -0
  74. package/context/metadata/types/objects.js +4 -0
  75. package/context/metadata/types/objectsV3.d.ts +128 -0
  76. package/context/metadata/types/objectsV3.js +4 -0
  77. package/context/msg/msg.d.ts +38 -0
  78. package/context/msg/msg.js +35 -0
  79. package/context/resources/IResources.d.ts +68 -0
  80. package/context/resources/IResources.js +2 -0
  81. package/context/resources/impl/resources.d.ts +42 -0
  82. package/context/resources/impl/resources.js +161 -0
  83. package/context/tasks/tasks.d.ts +33 -0
  84. package/context/tasks/tasks.js +139 -0
  85. package/data/index.d.ts +27 -0
  86. package/data/index.js +4 -0
  87. package/global/application/flow/flow.d.ts +99 -0
  88. package/global/application/flow/flow.js +8 -0
  89. package/global/application/flow/impl/flow.d.ts +20 -0
  90. package/global/application/flow/impl/flow.js +56 -0
  91. package/global/application/globalVar/globalVar.d.ts +7 -0
  92. package/global/application/globalVar/globalVar.js +2 -0
  93. package/global/global.d.ts +70 -0
  94. package/global/global.js +3 -0
  95. package/hooks/api.d.ts +65 -0
  96. package/hooks/api.js +347 -0
  97. package/hooks/hooks.d.ts +1 -0
  98. package/hooks/hooks.js +107 -0
  99. package/kunlun/kunlun.d.ts +55 -0
  100. package/kunlun/kunlun.js +58 -0
  101. package/kunlun/operator/IOperator.d.ts +158 -0
  102. package/kunlun/operator/IOperator.js +4 -0
  103. package/kunlun/operator/impl/expression.d.ts +75 -0
  104. package/kunlun/operator/impl/expression.js +96 -0
  105. package/kunlun/operator/impl/logic.d.ts +68 -0
  106. package/kunlun/operator/impl/logic.js +573 -0
  107. package/kunlun/operator/impl/logicV2.d.ts +59 -0
  108. package/kunlun/operator/impl/logicV2.js +197 -0
  109. package/kunlun/operator/impl/operator.d.ts +179 -0
  110. package/kunlun/operator/impl/operator.js +222 -0
  111. package/kunlun/operator/impl/operatorV2.d.ts +180 -0
  112. package/kunlun/operator/impl/operatorV2.js +216 -0
  113. package/lib/core.d.ts +4 -0
  114. package/lib/core.js +19 -0
  115. package/package.json +1 -1
  116. package/request/common.d.ts +13 -0
  117. package/request/common.js +88 -0
  118. package/request/constants.d.ts +12 -0
  119. package/request/constants.js +29 -0
  120. package/request/faasinfra.d.ts +8 -0
  121. package/request/faasinfra.js +146 -0
  122. package/request/interface.d.ts +121 -0
  123. package/request/interface.js +30 -0
  124. package/request/openapi.d.ts +84 -0
  125. package/request/openapi.js +1529 -0
  126. package/request/structs.d.ts +99 -0
  127. package/request/structs.js +15 -0
  128. package/types/types.d.ts +79 -0
  129. package/types/types.js +4 -0
  130. package/version/version.d.ts +2 -0
  131. package/version/version.js +8 -0
@@ -0,0 +1,33 @@
1
+ import { _IOpenSDKResources } from '../context/resources/IResources';
2
+ import { ITool, IToolsExtra } from '@byted-apaas/server-common-node/kunlun/tool/Itool';
3
+ import { AppCredential } from '@byted-apaas/server-common-node/credential/credential';
4
+ import { IDBSync } from '../context/db/db';
5
+ import { IFunction } from './function/function';
6
+ import { PlatformEnvType } from '@byted-apaas/server-common-node/constants/constants';
7
+ import { _IIntegration } from '../context/integration/IIntegration';
8
+ /**
9
+ * IApplication 为 OpenSDK 能力的核心接口
10
+ * - data: 元数据相关能力
11
+ * - resource: 资源相关能力
12
+ * - tools: 工具相关能力
13
+ */
14
+ export interface IApplication {
15
+ data: IDBSync;
16
+ resources: _IOpenSDKResources;
17
+ tools: ITool & IToolsExtra;
18
+ integration: _IIntegration;
19
+ cloudfunction(funcName: string): IFunction;
20
+ env(platformEnvType: PlatformEnvType): IApplication;
21
+ localDebugMode(): IApplication;
22
+ setLaneName(laneName: string): IApplication;
23
+ }
24
+ export type AppMode = 'openSDK' | 'faasSDK';
25
+ export type DataVersion = 'v1' | 'v2' | 'v3';
26
+ export interface AppCtx {
27
+ mode?: AppMode;
28
+ env?: PlatformEnvType;
29
+ credential?: AppCredential;
30
+ debugType?: '0' | '2';
31
+ x_tt_env?: string;
32
+ dataVersion?: DataVersion;
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { AppCtx } from '../application';
2
+ export interface IFunction {
3
+ /**
4
+ * 调用函数
5
+ * @param params 函数入参
6
+ */
7
+ invoke(params: Record<string, any>): Promise<any>;
8
+ }
9
+ export declare class Function implements IFunction {
10
+ appCtx: AppCtx;
11
+ apiName: string;
12
+ constructor(appCtx: AppCtx, apiName: string);
13
+ invoke(params: Record<string, any>): Promise<any>;
14
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Function = void 0;
4
+ const interface_1 = require("../../request/interface");
5
+ const common_1 = require("../impl/common");
6
+ class Function {
7
+ constructor(appCtx, apiName) {
8
+ this.appCtx = appCtx;
9
+ this.apiName = apiName;
10
+ }
11
+ async invoke(params) {
12
+ return await (0, common_1.runCtxForOpenSDK)(this.appCtx, async () => {
13
+ return await (0, interface_1.GetInstance)().invokeFuncWithAuth({
14
+ APIName: this.apiName,
15
+ isInvokeByAPIName: true
16
+ }, params);
17
+ });
18
+ }
19
+ }
20
+ exports.Function = Function;
@@ -0,0 +1,2 @@
1
+ import { AppCtx } from '../application';
2
+ export declare function runCtxForOpenSDK(appCtx: AppCtx, promise: Function): Promise<any>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCtxForOpenSDK = void 0;
4
+ const utils = require("@byted-apaas/server-common-node/utils/utils");
5
+ const nodeClsCtx = require("@byted-apaas/server-common-node/utils/nodeClsCtx");
6
+ const exceptions_1 = require("@byted-apaas/server-common-node/utils/exceptions");
7
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
8
+ const crypto = require('crypto'); //nolint:byted_s_ts_no_require_imports
9
+ async function runCtxForOpenSDK(appCtx, promise) {
10
+ if (appCtx && appCtx.mode === 'openSDK') {
11
+ if (!appCtx.credential) {
12
+ throw new exceptions_1.InvalidParamError(`credential is empty for openSDK`);
13
+ }
14
+ return nodeClsCtx.getReqCtx().run(async () => {
15
+ utils.setModeForOpenSDK(appCtx.mode);
16
+ utils.setCredential(appCtx.credential);
17
+ utils.setDebugType(appCtx.debugType);
18
+ switch (appCtx.env) {
19
+ // @ts-ignore
20
+ case 'developmentboe':
21
+ utils.setEnv('development');
22
+ utils.setBoe('boe');
23
+ break;
24
+ // @ts-ignore
25
+ case 'stagingboe':
26
+ utils.setEnv('staging');
27
+ utils.setBoe('boe');
28
+ break;
29
+ case 'staging':
30
+ utils.setEnv('staging');
31
+ break;
32
+ case 'gray':
33
+ utils.setEnv('gray');
34
+ break;
35
+ case 'online':
36
+ utils.setEnv('online');
37
+ break;
38
+ default:
39
+ throw new exceptions_1.InvalidParamError(`platformEnvType is invalid for ${appCtx.env}`);
40
+ }
41
+ utils.setInvokeFuncName('openSDK');
42
+ utils.setTenant(await appCtx.credential.getTenantInfo());
43
+ utils.setXTTEnvOnlyDebug(appCtx.x_tt_env);
44
+ if (!utils.getLogID()) {
45
+ utils.setLogID(crypto.randomBytes(16).toString('hex'));
46
+ }
47
+ return await promise();
48
+ });
49
+ }
50
+ return await promise();
51
+ }
52
+ exports.runCtxForOpenSDK = runCtxForOpenSDK;
@@ -0,0 +1,19 @@
1
+ import { ITool, IToolsExtra } from '@byted-apaas/server-common-node/kunlun/tool/Itool';
2
+ import { IFunction } from '../function/function';
3
+ import { IApplication } from '../application';
4
+ import { _IOpenSDKResources } from '../../context/resources/IResources';
5
+ import { IDBSync } from '../../context/db/db';
6
+ import { PlatformEnvType } from '@byted-apaas/server-common-node/constants/constants';
7
+ import { _IIntegration } from '../../context/integration/IIntegration';
8
+ export declare class Application implements IApplication {
9
+ private appCtx;
10
+ data: IDBSync;
11
+ resources: _IOpenSDKResources;
12
+ tools: ITool & IToolsExtra;
13
+ integration: _IIntegration;
14
+ constructor(clientID: string, clientSecret: string);
15
+ cloudfunction(funcName: string): IFunction;
16
+ env(platformEnvType: PlatformEnvType): IApplication;
17
+ localDebugMode(): IApplication;
18
+ setLaneName(laneName: string): IApplication;
19
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Application = void 0;
4
+ const credential_1 = require("@byted-apaas/server-common-node/credential/credential");
5
+ const db_1 = require("../../context/db/impl/db");
6
+ const tool_1 = require("@byted-apaas/server-common-node/kunlun/tool/impl/tool");
7
+ const function_1 = require("../function/function");
8
+ const common_1 = require("../../request/common");
9
+ const resources_1 = require("../../context/resources/impl/resources");
10
+ const constants_1 = require("@byted-apaas/server-common-node/constants/constants");
11
+ const integration_1 = require("../../context/integration/impl/integration");
12
+ class Application {
13
+ constructor(clientID, clientSecret) {
14
+ this.appCtx = {
15
+ mode: 'openSDK',
16
+ credential: new credential_1.AppCredential(clientID, clientSecret),
17
+ debugType: constants_1.DefaultDebugType ? constants_1.DefaultDebugType : '2',
18
+ env: 'online',
19
+ };
20
+ this.data = new db_1.ApplicationDB(this.appCtx);
21
+ this.resources = new resources_1._OpenSDKResources(this.appCtx);
22
+ this.integration = new integration_1._OpenSDKIntegration(this.appCtx);
23
+ this.tools = new tool_1.Tool();
24
+ this.tools.getTenantInfo = async () => {
25
+ return await (0, common_1.getTenantInfo)(this.appCtx);
26
+ };
27
+ }
28
+ cloudfunction(funcName) {
29
+ return new function_1.Function(this.appCtx, funcName);
30
+ }
31
+ env(platformEnvType) {
32
+ this.appCtx.env = platformEnvType;
33
+ return this;
34
+ }
35
+ // 设置本地调试模式
36
+ localDebugMode() {
37
+ this.appCtx.debugType = '2';
38
+ return this;
39
+ }
40
+ setLaneName(laneName) {
41
+ this.appCtx.x_tt_env = laneName;
42
+ return this;
43
+ }
44
+ }
45
+ exports.Application = Application;
@@ -0,0 +1,15 @@
1
+ export interface BatchResult {
2
+ code: string;
3
+ msg: string;
4
+ data?: BatchResultData[];
5
+ hasError?: () => boolean;
6
+ }
7
+ export interface BatchResultData {
8
+ success: boolean;
9
+ _id: number | string;
10
+ errors?: BatchResultDataError[];
11
+ }
12
+ export interface BatchResultDataError {
13
+ code: string;
14
+ }
15
+ export declare function NewBatchResult(recordIDs: number[] | string[], errMap: Record<number | string, string>): BatchResult;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NewBatchResult = void 0;
4
+ function NewBatchResult(recordIDs, errMap) {
5
+ const result = { code: "", msg: "success", data: [] };
6
+ let hasError = false;
7
+ recordIDs.forEach((id) => {
8
+ const d = { _id: id, success: true };
9
+ if (errMap && errMap[id]) {
10
+ hasError = true;
11
+ d.success = false;
12
+ d.errors = [{ code: errMap[id] }];
13
+ }
14
+ result.data.push(d);
15
+ });
16
+ result.hasError = () => {
17
+ return hasError;
18
+ };
19
+ return result;
20
+ }
21
+ exports.NewBatchResult = NewBatchResult;
@@ -0,0 +1,13 @@
1
+ export declare const notifyModel: {
2
+ key: string;
3
+ };
4
+ export declare const httpHeaderKeys: {
5
+ statusCode: string;
6
+ location: string;
7
+ };
8
+ export declare const httpStatusCodes: {
9
+ redirect: number;
10
+ };
11
+ export declare const triggerType: {
12
+ defaultTrigger: string;
13
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // Copyright 2022 ByteDance Ltd. and/or its affiliates
3
+ // SPDX-License-Identifier: MIT
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.triggerType = exports.httpStatusCodes = exports.httpHeaderKeys = exports.notifyModel = void 0;
6
+ exports.notifyModel = {
7
+ key: 'ee.kunlun.cloudfunction.faas_buildin',
8
+ };
9
+ exports.httpHeaderKeys = {
10
+ statusCode: 'X-Kunlun-Status-Code',
11
+ location: 'Location',
12
+ };
13
+ exports.httpStatusCodes = {
14
+ redirect: 302,
15
+ };
16
+ exports.triggerType = {
17
+ defaultTrigger: 'default-trigger',
18
+ };
@@ -0,0 +1,44 @@
1
+ import { _Resources } from './resources/impl/resources';
2
+ import { Tasks } from './tasks/tasks';
3
+ import { Message } from './msg/msg';
4
+ import { IDBGetter } from './db/db';
5
+ import { Context as CommonContext } from '@byted-apaas/server-common-node';
6
+ import { IMetaData } from './metadata/metadata';
7
+ import { _IIntegration } from './integration/IIntegration';
8
+ export declare class Context<T, mt, cf, gv> extends CommonContext implements IContext<T, mt, cf, gv> {
9
+ /**
10
+ * 操作数据库中的记录数据
11
+ */
12
+ db: IDBGetter<T, mt>;
13
+ /**
14
+ * 元数据读写
15
+ */
16
+ metadata: IMetaData<mt>;
17
+ /**
18
+ * 静态资源类操作
19
+ */
20
+ resources: _Resources;
21
+ /**
22
+ * 全局函数
23
+ * @param funcName 函数名
24
+ */
25
+ function(funcName: cf): {
26
+ invoke: (params: any) => Promise<any>;
27
+ };
28
+ /**
29
+ * 任务操作
30
+ */
31
+ tasks: Tasks<cf>;
32
+ /**
33
+ * 向消息中心推送及更新消息
34
+ */
35
+ msg: Message;
36
+ /**
37
+ * 根据 apiName 获取对应的全局变量
38
+ * @param apiName 全局变量的 API Name
39
+ */
40
+ getVar<Key extends keyof gv>(apiName: Key): Promise<gv[Key]>;
41
+ integration: _IIntegration;
42
+ }
43
+ export interface IContext<T, mt, cf, gv> {
44
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // Copyright 2022 ByteDance Ltd. and/or its affiliates
3
+ // SPDX-License-Identifier: MIT
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Context = void 0;
6
+ const server_common_node_1 = require("@byted-apaas/server-common-node");
7
+ class Context extends server_common_node_1.Context {
8
+ /**
9
+ * 全局函数
10
+ * @param funcName 函数名
11
+ */
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ function(funcName) {
14
+ return null;
15
+ }
16
+ /**
17
+ * 根据 apiName 获取对应的全局变量
18
+ * @param apiName 全局变量的 API Name
19
+ */
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
+ async getVar(apiName) {
22
+ return null;
23
+ }
24
+ }
25
+ exports.Context = Context;
@@ -0,0 +1,110 @@
1
+ import { _IKAllEndpoint, _IKSyncEndpoint, _IKQuery } from './impl/IObject';
2
+ import { ITransactionGetter } from './impl/transaction';
3
+ import { IOql } from './impl/oql/ioql';
4
+ import { _IKAllEndpointV3, _IKQueryV3 } from './impl/IObjectV3';
5
+ /**
6
+ * IDBGetter 是声明 DB interface 的顶级入口
7
+ */
8
+ export type IDBGetter<T, mt> = T extends {
9
+ 'objectApiName': string;
10
+ } ? IDB<T, mt> & IDBWithCurrentObject<{}, mt> : IDB<{}, mt>;
11
+ /**
12
+ * IDB 经由 IDBGetter 返回,是 DB 的基础接口结构
13
+ */
14
+ export interface IDB<T, mt> {
15
+ /**
16
+ * 操作指定对象的记录数据
17
+ * @param objectApiName 指定对象的 ApiName
18
+ * @example
19
+ * ```
20
+ * application.data.object('_user').where({
21
+ * gender: 'male'
22
+ * }).find()
23
+ * ```
24
+ */
25
+ object<T extends keyof mt>(objectApiName: T): _IKAllEndpoint<mt[T]> & _IKQuery<mt[T]>;
26
+ /**
27
+ * 创建一个新的空事务
28
+ * @example
29
+ * ```
30
+ * let tx = application.data.newTransaction();
31
+ * let user = tx.object('_user').registerCreate({
32
+ * _name: new application.constants.type.Multilingual({ zh: '用户1', en: 'user1' }),
33
+ * });
34
+ * let contract = tx.object('contract').registerCreate({
35
+ * _name: new application.constants.type.Multilingual({ zh: '用户1的合同', en: 'user1's contract' }),
36
+ * user: {id: user._id}
37
+ * });
38
+ * await tx.commit();
39
+ * ```
40
+ */
41
+ newTransaction(): ITransactionGetter<T, mt>;
42
+ /**
43
+ * OQL 操作
44
+ * @param oql OQL 语句
45
+ * @example
46
+ * ```
47
+ * let users = await application.data.oql('select _email from _user').execute();
48
+ * ```
49
+ */
50
+ oql(oql: string): IOql;
51
+ /**
52
+ * OQL 操作
53
+ * @param oql OQL 语句
54
+ * @param nameArgs 用于替换 OQL 语句中的占位符
55
+ * @example
56
+ * ```
57
+ * let employees = await application.data.oql('select _email from _user where _type = $user_type',{
58
+ * 'user_type': '_employee',
59
+ * }).execute();
60
+ * ```
61
+ */
62
+ oql(oql: string, nameArgs: Record<string, any>): IOql;
63
+ }
64
+ /**
65
+ * IDB3 经由 IDBGetter 返回,是 DBV3 的基础接口结构
66
+ */
67
+ export interface IDBV3<T, mt> {
68
+ /**
69
+ * 操作指定对象的记录数据
70
+ * @param objectApiName 指定对象的 ApiName
71
+ * @example
72
+ * ```
73
+ * application.data.object('_user').where({
74
+ * gender: 'male'
75
+ * }).find()
76
+ * ```
77
+ */
78
+ object: <T extends keyof mt>(objectApiName: T) => _IKAllEndpointV3<mt[T]> & _IKQueryV3<mt[T]>;
79
+ /**
80
+ * 创建一个新的空事务
81
+ * @example
82
+ * ```
83
+ * let tx = application.data.newTransaction();
84
+ * let user = tx.object('_user').registerCreate({
85
+ * _name: new application.constants.type.Multilingual({ zh: '用户1', en: 'user1' }),
86
+ * });
87
+ * let contract = tx.object('contract').registerCreate({
88
+ * _name: new application.constants.type.Multilingual({ zh: '用户1的合同', en: 'user1's contract' }),
89
+ * user: {id: user._id}
90
+ * });
91
+ * await tx.commit();
92
+ * ```
93
+ */
94
+ newTransaction(): ITransactionGetter<T, mt>;
95
+ }
96
+ /**
97
+ * IDBWithCurrentObject 经由 IDBGetter 返回,是 DB 的动态增加的接口结构
98
+ */
99
+ export interface IDBWithCurrentObject<T, mt> {
100
+ }
101
+ /**
102
+ * IDBSync 仅包含同步调用接口,当前应用场景为 OpenSDK
103
+ */
104
+ export interface IDBSync<mt = Record<string, never>> {
105
+ /**
106
+ * 操作指定对象的记录数据
107
+ * @param objectApiName 指定对象的 ApiName
108
+ */
109
+ object(objectApiName: string): _IKSyncEndpoint<mt> & _IKQuery<mt>;
110
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });