@ones-open/node-sdk 0.0.4-15682.67 → 0.0.4-16644.216
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.cjs +85 -18
- package/dist/index.js +85 -18
- package/dist/types/packages/node/index.d.ts +2 -0
- package/dist/types/packages/node/index.d.ts.map +1 -1
- package/dist/types/packages/node/oauth/index.d.ts +4 -0
- package/dist/types/packages/node/oauth/index.d.ts.map +1 -0
- package/dist/types/packages/node/oauth/types.d.ts +28 -0
- package/dist/types/packages/node/oauth/types.d.ts.map +1 -0
- package/dist/types/packages/node/storage/entity/entity/types.d.ts +20 -20
- package/dist/types/packages/node/storage/entity/error/consts.d.ts +29 -29
- package/dist/types/packages/node/storage/entity/index.d.ts +1 -1
- package/dist/types/packages/node/storage/entity/query/types.d.ts +52 -52
- package/dist/types/packages/node/storage/entity/result/types.d.ts +12 -12
- package/dist/types/packages/node/storage/entity/sort/consts.d.ts +3 -3
- package/dist/types/packages/node/storage/entity/types.d.ts +29 -29
- package/dist/types/packages/node/storage/entity/where/index.d.ts +1 -1
- package/dist/types/packages/node/storage/object/error/consts.d.ts +4 -4
- package/dist/types/packages/node/storage/object/error/index.d.ts +4 -4
- package/dist/types/packages/node/storage/object/index.d.ts +1 -1
- package/dist/types/packages/node/storage/object/result/types.d.ts +3 -3
- package/dist/types/packages/node/storage/object/types.d.ts +17 -17
- package/dist/types/packages/strict/env/index.d.ts +10 -4
- package/dist/types/packages/strict/env/index.d.ts.map +1 -1
- package/dist/types/packages/strict/result/types.d.ts +6 -6
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const lodashEs = require("lodash-es");
|
|
3
|
+
const node_crypto = require("node:crypto");
|
|
5
4
|
const Fetch = require("axios");
|
|
5
|
+
const lodashEs = require("lodash-es");
|
|
6
6
|
const _sortInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/sort");
|
|
7
7
|
const getONESHostedBaseUrl = () => {
|
|
8
8
|
return process.env.ONES_HOSTED_BASE_URL;
|
|
@@ -10,10 +10,79 @@ const getONESHostedBaseUrl = () => {
|
|
|
10
10
|
const getONESHostedAppID = () => {
|
|
11
11
|
return process.env.ONES_HOSTED_APP_ID;
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const getONESHostedToken = () => {
|
|
14
|
+
return process.env.ONES_HOSTED_TOKEN;
|
|
15
|
+
};
|
|
16
|
+
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
14
17
|
__proto__: null,
|
|
15
18
|
getONESHostedAppID,
|
|
16
|
-
getONESHostedBaseUrl
|
|
19
|
+
getONESHostedBaseUrl,
|
|
20
|
+
getONESHostedToken
|
|
21
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
22
|
+
const ASSERTION_TTL_SECONDS = 24 * 60 * 60;
|
|
23
|
+
const ASSERTION_JTI_LENGTH = 16;
|
|
24
|
+
const TOKEN_GRANT_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
|
25
|
+
const fetch$2 = Fetch.create();
|
|
26
|
+
const buildJWTAssertion = (installationInfo, userID) => {
|
|
27
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
28
|
+
const header = {
|
|
29
|
+
alg: "HS256",
|
|
30
|
+
typ: "JWT"
|
|
31
|
+
};
|
|
32
|
+
const payload = {
|
|
33
|
+
uid: userID,
|
|
34
|
+
rsh: "",
|
|
35
|
+
iss: installationInfo.installation_id,
|
|
36
|
+
sub: installationInfo.installation_id,
|
|
37
|
+
aud: "oauth",
|
|
38
|
+
exp: now + ASSERTION_TTL_SECONDS,
|
|
39
|
+
iat: now,
|
|
40
|
+
jti: node_crypto.randomUUID().replace(/-/g, "").slice(0, ASSERTION_JTI_LENGTH)
|
|
41
|
+
};
|
|
42
|
+
const encodedHeader = Buffer.from(JSON.stringify(header)).toString("base64url");
|
|
43
|
+
const encodedPayload = Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
44
|
+
const signingInput = `${encodedHeader}.${encodedPayload}`;
|
|
45
|
+
const signKey = Buffer.from(installationInfo.shared_secret, "base64");
|
|
46
|
+
const signature = node_crypto.createHmac("sha256", signKey).update(signingInput).digest("base64url");
|
|
47
|
+
return `${signingInput}.${signature}`;
|
|
48
|
+
};
|
|
49
|
+
const getAccessTokenByInstallationInfo = async function(installationInfo) {
|
|
50
|
+
let userID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
51
|
+
const assertion = buildJWTAssertion(installationInfo, userID);
|
|
52
|
+
const tokenURL = new URL("/oauth2/token", installationInfo.ones_base_url);
|
|
53
|
+
const formData = new URLSearchParams();
|
|
54
|
+
formData.set("grant_type", TOKEN_GRANT_TYPE);
|
|
55
|
+
formData.set("client_id", installationInfo.installation_id);
|
|
56
|
+
formData.set("assertion", assertion);
|
|
57
|
+
try {
|
|
58
|
+
const response = await fetch$2.post(tokenURL.toString(), formData.toString(), {
|
|
59
|
+
headers: {
|
|
60
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const token = response.data;
|
|
64
|
+
if (!token.access_token) {
|
|
65
|
+
throw new Error("failed to get access token: empty access_token in response");
|
|
66
|
+
}
|
|
67
|
+
return token.access_token;
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (error instanceof Fetch.AxiosError) {
|
|
70
|
+
var _error$response, _error$response$statu, _error$response2, _error$response3;
|
|
71
|
+
const status = (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status;
|
|
72
|
+
const statusText = (_error$response$statu = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.statusText) !== null && _error$response$statu !== void 0 ? _error$response$statu : "";
|
|
73
|
+
const data = (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data;
|
|
74
|
+
const responseText = typeof data === "string" ? data : JSON.stringify(data);
|
|
75
|
+
throw new Error(`failed to get access token: ${status !== null && status !== void 0 ? status : "unknown"} ${statusText}, response: ${responseText}`);
|
|
76
|
+
}
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const oauth = {
|
|
81
|
+
getAccessTokenByInstallationInfo
|
|
82
|
+
};
|
|
83
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
84
|
+
__proto__: null,
|
|
85
|
+
oauth
|
|
17
86
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
18
87
|
var EntityWhereConditionEnum = /* @__PURE__ */ ((EntityWhereConditionEnum2) => {
|
|
19
88
|
EntityWhereConditionEnum2["beginsWith"] = "beginsWith";
|
|
@@ -116,7 +185,7 @@ const createErrorResult = (code, message, error) => {
|
|
|
116
185
|
};
|
|
117
186
|
const fetch$1 = Fetch.create();
|
|
118
187
|
const buildAuthHeaders$1 = () => {
|
|
119
|
-
const token =
|
|
188
|
+
const token = getONESHostedToken();
|
|
120
189
|
if (token) {
|
|
121
190
|
return {
|
|
122
191
|
Authorization: `Bearer ${token}`
|
|
@@ -195,12 +264,12 @@ const defaultEntityQueryIndex = defaultEntityQuery.index;
|
|
|
195
264
|
const defaultEntityQueryWhere = defaultEntityQuery.where;
|
|
196
265
|
class EntityQueryClass {
|
|
197
266
|
constructor(name) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
267
|
+
this._name = "";
|
|
268
|
+
this._cursor = [defaultEntityQueryCursor];
|
|
269
|
+
this._limit = [defaultEntityQueryLimit];
|
|
270
|
+
this._sort = [defaultEntityQuerySort];
|
|
271
|
+
this._index = [defaultEntityQueryIndex];
|
|
272
|
+
this._where = [defaultEntityQueryWhere];
|
|
204
273
|
this._name = name;
|
|
205
274
|
}
|
|
206
275
|
cursor(cursor) {
|
|
@@ -294,7 +363,7 @@ class EntityQueryClass {
|
|
|
294
363
|
}
|
|
295
364
|
class EntityClass {
|
|
296
365
|
constructor(name) {
|
|
297
|
-
|
|
366
|
+
this._name = "";
|
|
298
367
|
this._name = name;
|
|
299
368
|
}
|
|
300
369
|
async get(key) {
|
|
@@ -400,11 +469,8 @@ var ObjectErrorCode = /* @__PURE__ */ ((ObjectErrorCode2) => {
|
|
|
400
469
|
return ObjectErrorCode2;
|
|
401
470
|
})(ObjectErrorCode || {});
|
|
402
471
|
class ObjectError {
|
|
403
|
-
/**
|
|
404
|
-
* @description 错误载荷
|
|
405
|
-
*/
|
|
406
472
|
constructor(result) {
|
|
407
|
-
|
|
473
|
+
this.err_msg = "";
|
|
408
474
|
this.code = result.code;
|
|
409
475
|
this.err_msg = result.err_msg;
|
|
410
476
|
this.err_values = result.err_values;
|
|
@@ -412,7 +478,7 @@ class ObjectError {
|
|
|
412
478
|
}
|
|
413
479
|
const fetch = Fetch.create();
|
|
414
480
|
const buildAuthHeaders = () => {
|
|
415
|
-
const token =
|
|
481
|
+
const token = getONESHostedToken();
|
|
416
482
|
if (token) {
|
|
417
483
|
return {
|
|
418
484
|
Authorization: `Bearer ${token}`
|
|
@@ -552,5 +618,6 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
552
618
|
object
|
|
553
619
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
554
620
|
exports.ErrorCode = ErrorCode;
|
|
555
|
-
exports.env = index$
|
|
621
|
+
exports.env = index$2;
|
|
622
|
+
exports.oauth = index$1;
|
|
556
623
|
exports.storage = index;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isNull, isUndefined, isSymbol, set } from "lodash-es";
|
|
1
|
+
import { randomUUID, createHmac } from "node:crypto";
|
|
3
2
|
import Fetch, { AxiosError } from "axios";
|
|
3
|
+
import { isNull, isUndefined, isSymbol, set } from "lodash-es";
|
|
4
4
|
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
|
5
5
|
const getONESHostedBaseUrl = () => {
|
|
6
6
|
return process.env.ONES_HOSTED_BASE_URL;
|
|
@@ -8,10 +8,79 @@ const getONESHostedBaseUrl = () => {
|
|
|
8
8
|
const getONESHostedAppID = () => {
|
|
9
9
|
return process.env.ONES_HOSTED_APP_ID;
|
|
10
10
|
};
|
|
11
|
-
const
|
|
11
|
+
const getONESHostedToken = () => {
|
|
12
|
+
return process.env.ONES_HOSTED_TOKEN;
|
|
13
|
+
};
|
|
14
|
+
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
15
|
__proto__: null,
|
|
13
16
|
getONESHostedAppID,
|
|
14
|
-
getONESHostedBaseUrl
|
|
17
|
+
getONESHostedBaseUrl,
|
|
18
|
+
getONESHostedToken
|
|
19
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
20
|
+
const ASSERTION_TTL_SECONDS = 24 * 60 * 60;
|
|
21
|
+
const ASSERTION_JTI_LENGTH = 16;
|
|
22
|
+
const TOKEN_GRANT_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
|
23
|
+
const fetch$2 = Fetch.create();
|
|
24
|
+
const buildJWTAssertion = (installationInfo, userID) => {
|
|
25
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
26
|
+
const header = {
|
|
27
|
+
alg: "HS256",
|
|
28
|
+
typ: "JWT"
|
|
29
|
+
};
|
|
30
|
+
const payload = {
|
|
31
|
+
uid: userID,
|
|
32
|
+
rsh: "",
|
|
33
|
+
iss: installationInfo.installation_id,
|
|
34
|
+
sub: installationInfo.installation_id,
|
|
35
|
+
aud: "oauth",
|
|
36
|
+
exp: now + ASSERTION_TTL_SECONDS,
|
|
37
|
+
iat: now,
|
|
38
|
+
jti: randomUUID().replace(/-/g, "").slice(0, ASSERTION_JTI_LENGTH)
|
|
39
|
+
};
|
|
40
|
+
const encodedHeader = Buffer.from(JSON.stringify(header)).toString("base64url");
|
|
41
|
+
const encodedPayload = Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
42
|
+
const signingInput = `${encodedHeader}.${encodedPayload}`;
|
|
43
|
+
const signKey = Buffer.from(installationInfo.shared_secret, "base64");
|
|
44
|
+
const signature = createHmac("sha256", signKey).update(signingInput).digest("base64url");
|
|
45
|
+
return `${signingInput}.${signature}`;
|
|
46
|
+
};
|
|
47
|
+
const getAccessTokenByInstallationInfo = async function(installationInfo) {
|
|
48
|
+
let userID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
49
|
+
const assertion = buildJWTAssertion(installationInfo, userID);
|
|
50
|
+
const tokenURL = new URL("/oauth2/token", installationInfo.ones_base_url);
|
|
51
|
+
const formData = new URLSearchParams();
|
|
52
|
+
formData.set("grant_type", TOKEN_GRANT_TYPE);
|
|
53
|
+
formData.set("client_id", installationInfo.installation_id);
|
|
54
|
+
formData.set("assertion", assertion);
|
|
55
|
+
try {
|
|
56
|
+
const response = await fetch$2.post(tokenURL.toString(), formData.toString(), {
|
|
57
|
+
headers: {
|
|
58
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const token = response.data;
|
|
62
|
+
if (!token.access_token) {
|
|
63
|
+
throw new Error("failed to get access token: empty access_token in response");
|
|
64
|
+
}
|
|
65
|
+
return token.access_token;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (error instanceof AxiosError) {
|
|
68
|
+
var _error$response, _error$response$statu, _error$response2, _error$response3;
|
|
69
|
+
const status = (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status;
|
|
70
|
+
const statusText = (_error$response$statu = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.statusText) !== null && _error$response$statu !== void 0 ? _error$response$statu : "";
|
|
71
|
+
const data = (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data;
|
|
72
|
+
const responseText = typeof data === "string" ? data : JSON.stringify(data);
|
|
73
|
+
throw new Error(`failed to get access token: ${status !== null && status !== void 0 ? status : "unknown"} ${statusText}, response: ${responseText}`);
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const oauth = {
|
|
79
|
+
getAccessTokenByInstallationInfo
|
|
80
|
+
};
|
|
81
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
82
|
+
__proto__: null,
|
|
83
|
+
oauth
|
|
15
84
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
85
|
var EntityWhereConditionEnum = /* @__PURE__ */ ((EntityWhereConditionEnum2) => {
|
|
17
86
|
EntityWhereConditionEnum2["beginsWith"] = "beginsWith";
|
|
@@ -114,7 +183,7 @@ const createErrorResult = (code, message, error) => {
|
|
|
114
183
|
};
|
|
115
184
|
const fetch$1 = Fetch.create();
|
|
116
185
|
const buildAuthHeaders$1 = () => {
|
|
117
|
-
const token =
|
|
186
|
+
const token = getONESHostedToken();
|
|
118
187
|
if (token) {
|
|
119
188
|
return {
|
|
120
189
|
Authorization: `Bearer ${token}`
|
|
@@ -193,12 +262,12 @@ const defaultEntityQueryIndex = defaultEntityQuery.index;
|
|
|
193
262
|
const defaultEntityQueryWhere = defaultEntityQuery.where;
|
|
194
263
|
class EntityQueryClass {
|
|
195
264
|
constructor(name) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
265
|
+
this._name = "";
|
|
266
|
+
this._cursor = [defaultEntityQueryCursor];
|
|
267
|
+
this._limit = [defaultEntityQueryLimit];
|
|
268
|
+
this._sort = [defaultEntityQuerySort];
|
|
269
|
+
this._index = [defaultEntityQueryIndex];
|
|
270
|
+
this._where = [defaultEntityQueryWhere];
|
|
202
271
|
this._name = name;
|
|
203
272
|
}
|
|
204
273
|
cursor(cursor) {
|
|
@@ -292,7 +361,7 @@ class EntityQueryClass {
|
|
|
292
361
|
}
|
|
293
362
|
class EntityClass {
|
|
294
363
|
constructor(name) {
|
|
295
|
-
|
|
364
|
+
this._name = "";
|
|
296
365
|
this._name = name;
|
|
297
366
|
}
|
|
298
367
|
async get(key) {
|
|
@@ -398,11 +467,8 @@ var ObjectErrorCode = /* @__PURE__ */ ((ObjectErrorCode2) => {
|
|
|
398
467
|
return ObjectErrorCode2;
|
|
399
468
|
})(ObjectErrorCode || {});
|
|
400
469
|
class ObjectError {
|
|
401
|
-
/**
|
|
402
|
-
* @description 错误载荷
|
|
403
|
-
*/
|
|
404
470
|
constructor(result) {
|
|
405
|
-
|
|
471
|
+
this.err_msg = "";
|
|
406
472
|
this.code = result.code;
|
|
407
473
|
this.err_msg = result.err_msg;
|
|
408
474
|
this.err_values = result.err_values;
|
|
@@ -410,7 +476,7 @@ class ObjectError {
|
|
|
410
476
|
}
|
|
411
477
|
const fetch = Fetch.create();
|
|
412
478
|
const buildAuthHeaders = () => {
|
|
413
|
-
const token =
|
|
479
|
+
const token = getONESHostedToken();
|
|
414
480
|
if (token) {
|
|
415
481
|
return {
|
|
416
482
|
Authorization: `Bearer ${token}`
|
|
@@ -551,6 +617,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
551
617
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
552
618
|
export {
|
|
553
619
|
ErrorCode,
|
|
554
|
-
index$
|
|
620
|
+
index$2 as env,
|
|
621
|
+
index$1 as oauth,
|
|
555
622
|
index as storage
|
|
556
623
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * as env from '../../packages/strict/env';
|
|
2
|
+
export * as oauth from './oauth';
|
|
2
3
|
export * as storage from './storage';
|
|
3
4
|
export { ErrorCode } from '../../packages/strict/error';
|
|
4
5
|
export type { Entity, EntityBatchSetItem, EntityQuery, EntityListResultData, EntityError, ObjectError, ObjectStoreUploadResult, ObjectStoreDownloadResult, } from './storage';
|
|
6
|
+
export type { InstallationInfo, OAuthClient } from './oauth';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packages/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAA;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,YAAY,EACV,MAAM,EACN,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packages/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAA;AAC5C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,YAAY,EACV,MAAM,EACN,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/node/oauth/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE5D,mBAAmB,SAAS,CAAA;AA2F5B,eAAO,MAAM,KAAK,EAAE,WAEnB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Installation callback data used for token exchange
|
|
3
|
+
*/
|
|
4
|
+
export interface InstallationInfo {
|
|
5
|
+
/**
|
|
6
|
+
* @description Installation ID of the app
|
|
7
|
+
*/
|
|
8
|
+
installation_id: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description Base64 encoded installation shared secret
|
|
11
|
+
*/
|
|
12
|
+
shared_secret: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description ONES base URL of the installation
|
|
15
|
+
*/
|
|
16
|
+
ones_base_url: string;
|
|
17
|
+
}
|
|
18
|
+
export interface OAuthClient {
|
|
19
|
+
/**
|
|
20
|
+
* @description Exchange installation info for an OAuth access token
|
|
21
|
+
* @param installationInfo Installation callback data
|
|
22
|
+
* @param userID User ID in the installation organization.
|
|
23
|
+
* Empty string means requesting token as the app itself.
|
|
24
|
+
* @returns Access token
|
|
25
|
+
*/
|
|
26
|
+
getAccessTokenByInstallationInfo(installationInfo: InstallationInfo, userID?: string): Promise<string>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/packages/node/oauth/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,gCAAgC,CAC9B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAAA;CACnB"}
|
|
@@ -7,55 +7,55 @@ export type BaseIndexesStructValue = null | StringOrNumberOrBoolean[] | [StringO
|
|
|
7
7
|
export type BaseIndexesStruct<IndexesStruct> = SetFieldType<IndexesStruct, keyof IndexesStruct, BaseIndexesStructValue>;
|
|
8
8
|
export type UnionIndexesStruct<IndexesStruct> = BaseIndexesStruct<IndexesStruct> | EmptyObject | null;
|
|
9
9
|
/**
|
|
10
|
-
* @description
|
|
11
|
-
* @typedef EntityStruct
|
|
12
|
-
* @typedef IndexesStruct
|
|
10
|
+
* @description Entity operation object
|
|
11
|
+
* @typedef EntityStruct Entity data structure
|
|
12
|
+
* @typedef IndexesStruct Entity index structure
|
|
13
13
|
*/
|
|
14
14
|
export interface Entity<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends UnionIndexesStruct<IndexesStruct>> {
|
|
15
15
|
/**
|
|
16
|
-
* @description
|
|
17
|
-
* @param key
|
|
18
|
-
* @returns
|
|
16
|
+
* @description Get one entity record
|
|
17
|
+
* @param key Entity data key
|
|
18
|
+
* @returns Entity data value
|
|
19
19
|
*/
|
|
20
20
|
get<Key extends string>(key: NotEmptyString<Key>): Promise<EntityStruct | undefined>;
|
|
21
21
|
/**
|
|
22
|
-
* @description
|
|
23
|
-
* @param key
|
|
24
|
-
* @param value
|
|
22
|
+
* @description Create or update one entity record
|
|
23
|
+
* @param key Entity data key
|
|
24
|
+
* @param value Entity data value
|
|
25
25
|
*/
|
|
26
26
|
set<Key extends string>(key: NotEmptyString<Key>, value: Partial<EntityStruct>): Promise<void>;
|
|
27
27
|
/**
|
|
28
|
-
* @description
|
|
29
|
-
* @param key
|
|
28
|
+
* @description Delete one entity record
|
|
29
|
+
* @param key Entity data key
|
|
30
30
|
*/
|
|
31
31
|
delete<Key extends string>(key: NotEmptyString<Key>): Promise<void>;
|
|
32
32
|
/**
|
|
33
|
-
* @description
|
|
33
|
+
* @description Create entity query object
|
|
34
34
|
* @returns EntityQuery
|
|
35
35
|
*/
|
|
36
36
|
query(): IfNull<IndexesStruct, BaseEntityQuery<EntityStruct, EmptyObject>, IfEmptyObject<IndexesStruct, InputIndexEntityQuery<EntityStruct, EmptyObject>, InferIndexEntityQuery<EntityStruct, Exclude<IndexesStruct, EmptyObject | null>>>>;
|
|
37
37
|
/**
|
|
38
|
-
* @description
|
|
39
|
-
* @param items
|
|
38
|
+
* @description Batch create or update entity data
|
|
39
|
+
* @param items Array of items
|
|
40
40
|
*/
|
|
41
41
|
batchSet<Items extends EntityBatchSetItem<EntityStruct>[]>(items: NotEmptyArray<Items>): Promise<void>;
|
|
42
42
|
/**
|
|
43
|
-
* @description
|
|
44
|
-
* @param keys
|
|
43
|
+
* @description Batch delete entity data
|
|
44
|
+
* @param keys Array of entity data keys
|
|
45
45
|
*/
|
|
46
46
|
batchDelete<Keys extends string[]>(keys: NotEmptyArray<Keys>): Promise<void>;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* @description
|
|
50
|
-
* @typedef EntityStruct
|
|
49
|
+
* @description Item for batch create or update entity data
|
|
50
|
+
* @typedef EntityStruct Entity data structure
|
|
51
51
|
*/
|
|
52
52
|
export interface EntityBatchSetItem<EntityStruct extends BaseEntityStruct<EntityStruct>> {
|
|
53
53
|
/**
|
|
54
|
-
* @description
|
|
54
|
+
* @description Entity data key
|
|
55
55
|
*/
|
|
56
56
|
key: string;
|
|
57
57
|
/**
|
|
58
|
-
* @description
|
|
58
|
+
* @description Entity data value
|
|
59
59
|
*/
|
|
60
60
|
value: Partial<EntityStruct>;
|
|
61
61
|
}
|
|
@@ -1,126 +1,126 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @enum EntityErrorCode
|
|
3
|
-
* @description
|
|
3
|
+
* @description Entity error code enum
|
|
4
4
|
*/
|
|
5
5
|
export declare enum EntityErrorCode {
|
|
6
6
|
/**
|
|
7
|
-
* @description
|
|
7
|
+
* @description Entity name is empty / contains invalid characters / exceeds max length
|
|
8
8
|
* @satisfies /^[_a-z0-9]{1,32}$/
|
|
9
9
|
*/
|
|
10
10
|
EntityNameInvalid = "EntityNameInvalid",
|
|
11
11
|
/**
|
|
12
|
-
* @description
|
|
12
|
+
* @description Entity name does not exist (not defined in config)
|
|
13
13
|
*/
|
|
14
14
|
EntityNotFound = "EntityNotFound",
|
|
15
15
|
/**
|
|
16
|
-
* @description
|
|
16
|
+
* @description Entity data cannot be empty
|
|
17
17
|
*/
|
|
18
18
|
EntityDataEmpty = "EntityDataEmpty",
|
|
19
19
|
/**
|
|
20
|
-
* @description
|
|
20
|
+
* @description Too many entity data items
|
|
21
21
|
* @satisfies maximum 100 items
|
|
22
22
|
*/
|
|
23
23
|
EntityDataBatchLimit = "EntityDataBatchLimit",
|
|
24
24
|
/**
|
|
25
|
-
* @description key
|
|
25
|
+
* @description key is empty / contains invalid characters / exceeds max length
|
|
26
26
|
* @satisfies /^[_a-z0-9]{1,64}$/
|
|
27
27
|
*/
|
|
28
28
|
EntityDataKeyInvalid = "EntityDataKeyInvalid",
|
|
29
29
|
/**
|
|
30
|
-
* @description key
|
|
30
|
+
* @description Duplicate key
|
|
31
31
|
*/
|
|
32
32
|
EntityDataKeyDuplicate = "EntityDataKeyDuplicate",
|
|
33
33
|
/**
|
|
34
|
-
* @description
|
|
34
|
+
* @description Attribute name is empty / contains invalid characters / exceeds max length
|
|
35
35
|
* @satisfies /^[_a-z0-9]{1,64}$/
|
|
36
36
|
*/
|
|
37
37
|
EntityDataValueAttrInvalid = "EntityDataValueAttrInvalid",
|
|
38
38
|
/**
|
|
39
|
-
* @description
|
|
39
|
+
* @description Attribute name does not exist (not defined in config)
|
|
40
40
|
*/
|
|
41
41
|
EntityDataValueAttrNotFound = "EntityDataValueAttrNotFound",
|
|
42
42
|
/**
|
|
43
|
-
* @description
|
|
43
|
+
* @description Value cannot be empty
|
|
44
44
|
*/
|
|
45
45
|
EntityDataValueEmpty = "EntityDataValueEmpty",
|
|
46
46
|
/**
|
|
47
|
-
* @description
|
|
47
|
+
* @description Invalid value
|
|
48
48
|
*/
|
|
49
49
|
EntityDataValueInvalid = "EntityDataValueInvalid",
|
|
50
50
|
/**
|
|
51
|
-
* @description string
|
|
51
|
+
* @description Value of string attribute exceeds max length
|
|
52
52
|
*/
|
|
53
53
|
EntityDataStringValueTooLong = "EntityDataStringValueTooLong",
|
|
54
54
|
/**
|
|
55
|
-
* @description text
|
|
55
|
+
* @description Value of text attribute exceeds max length
|
|
56
56
|
* @satisfies maximum 32768 characters
|
|
57
57
|
*/
|
|
58
58
|
EntityDataTextValueTooLong = "EntityDataTextValueTooLong",
|
|
59
59
|
/**
|
|
60
|
-
* @description
|
|
60
|
+
* @description Missing required attribute
|
|
61
61
|
*/
|
|
62
62
|
EntityDataAttrRequired = "EntityDataAttrRequired",
|
|
63
63
|
/**
|
|
64
|
-
* @description
|
|
64
|
+
* @description Attribute value type does not match definition
|
|
65
65
|
*/
|
|
66
66
|
EntityDataValueTypeInvalid = "EntityDataValueTypeInvalid",
|
|
67
67
|
/**
|
|
68
|
-
* @description
|
|
68
|
+
* @description Index cannot be empty
|
|
69
69
|
*/
|
|
70
70
|
EntityDataIndexEmpty = "EntityDataIndexEmpty",
|
|
71
71
|
/**
|
|
72
|
-
* @description
|
|
72
|
+
* @description Index is empty / contains invalid characters / exceeds max length
|
|
73
73
|
* @satisfies /^[_a-z0-9]{1,64}$/
|
|
74
74
|
*/
|
|
75
75
|
EntityDataIndexNameInvalid = "EntityDataIndexNameInvalid",
|
|
76
76
|
/**
|
|
77
|
-
* @description
|
|
77
|
+
* @description Index does not exist (not defined in config)
|
|
78
78
|
*/
|
|
79
79
|
EntityDataIndexNotFound = "EntityDataIndexNotFound",
|
|
80
80
|
/**
|
|
81
|
-
* @description
|
|
81
|
+
* @description Attribute value in custom index is empty or invalid
|
|
82
82
|
*/
|
|
83
83
|
EntityDataPartitionValueInvalid = "EntityDataPartitionValueInvalid",
|
|
84
84
|
/**
|
|
85
|
-
* @description
|
|
85
|
+
* @description Attribute value type in custom index does not match definition
|
|
86
86
|
*/
|
|
87
87
|
EntityDataPartitionValueTypeInvalid = "EntityDataPartitionValueTypeInvalid",
|
|
88
88
|
/**
|
|
89
|
-
* @description
|
|
89
|
+
* @description Attribute value in custom index exceeds max length
|
|
90
90
|
*/
|
|
91
91
|
EntityDataPartitionValueTooLong = "EntityDataPartitionValueTooLong",
|
|
92
92
|
/**
|
|
93
|
-
* @description
|
|
93
|
+
* @description Unique constraint violation
|
|
94
94
|
*/
|
|
95
95
|
EntityDataUniqueConstraintFailed = "EntityDataUniqueConstraintFailed",
|
|
96
96
|
/**
|
|
97
|
-
* @description
|
|
97
|
+
* @description Attribute value type in entity query condition clause does not match
|
|
98
98
|
*/
|
|
99
99
|
EntityDataWhereConditionValueTypeInvalid = "EntityDataWhereConditionValueTypeInvalid",
|
|
100
100
|
/**
|
|
101
|
-
* @description
|
|
101
|
+
* @description Attribute value in entity query condition clause exceeds max length
|
|
102
102
|
*/
|
|
103
103
|
EntityDataWhereConditionValueTooLong = "EntityDataWhereConditionValueTooLong",
|
|
104
104
|
/**
|
|
105
|
-
* @description
|
|
105
|
+
* @description Entity query cursor value is invalid
|
|
106
106
|
*/
|
|
107
107
|
EntityDataPageCursorInvalid = "EntityDataPageCursorInvalid",
|
|
108
108
|
/**
|
|
109
|
-
* @description
|
|
109
|
+
* @description Entity query sort value is invalid
|
|
110
110
|
* @satisfies EntitySortEnum
|
|
111
111
|
*/
|
|
112
112
|
EntityDataSortValueInvalid = "EntityDataSortValueInvalid",
|
|
113
113
|
/**
|
|
114
|
-
* @description
|
|
114
|
+
* @description Entity query page limit value is invalid
|
|
115
115
|
* @satisfies [1, 1000]
|
|
116
116
|
*/
|
|
117
117
|
EntityDataPageLimitNotInRange = "EntityDataPageLimitNotInRange",
|
|
118
118
|
/**
|
|
119
|
-
* @description
|
|
119
|
+
* @description Entity operation or query timeout
|
|
120
120
|
*/
|
|
121
121
|
EntityDataAPITimeOut = "EntityDataAPITimeOut",
|
|
122
122
|
/**
|
|
123
|
-
* @description JSON
|
|
123
|
+
* @description JSON serialization failed
|
|
124
124
|
*/
|
|
125
125
|
MalformedJSON = "Malformed.JSON"
|
|
126
126
|
}
|
|
@@ -7,147 +7,147 @@ import type { BaseEntityStruct, BaseIndexesStruct, BaseIndexesStructValue } from
|
|
|
7
7
|
import type { defaultEntityQueryCursor, defaultEntityQueryLimit, defaultEntityQuerySort, defaultEntityQueryIndex, defaultEntityQueryWhere } from './consts';
|
|
8
8
|
export type LimitNumber = IntClosedRange<1, 998> | 999 | 1000;
|
|
9
9
|
/**
|
|
10
|
-
* @description
|
|
11
|
-
* @typedef EntityStruct
|
|
12
|
-
* @typedef IndexesStruct
|
|
10
|
+
* @description Entity query object
|
|
11
|
+
* @typedef EntityStruct Entity data structure
|
|
12
|
+
* @typedef IndexesStruct Entity index structure
|
|
13
13
|
*/
|
|
14
14
|
export interface BaseEntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> {
|
|
15
15
|
/**
|
|
16
|
-
* @description
|
|
17
|
-
* @param cursor
|
|
16
|
+
* @description Set entity query cursor
|
|
17
|
+
* @param cursor Cursor
|
|
18
18
|
* @returns EntityQuery
|
|
19
19
|
*/
|
|
20
20
|
cursor(cursor: string | typeof defaultEntityQueryCursor): BaseEntityQuery<EntityStruct, IndexesStruct>;
|
|
21
21
|
/**
|
|
22
|
-
* @description
|
|
22
|
+
* @description Set entity query limit
|
|
23
23
|
* @satisfies [1, 1000]
|
|
24
|
-
* @param limit
|
|
24
|
+
* @param limit Limit
|
|
25
25
|
* @returns EntityQuery
|
|
26
26
|
*/
|
|
27
27
|
limit(limit: LimitNumber | typeof defaultEntityQueryLimit): BaseEntityQuery<EntityStruct, IndexesStruct>;
|
|
28
28
|
/**
|
|
29
|
-
* @description
|
|
30
|
-
* @param sort
|
|
29
|
+
* @description Set entity query sort order
|
|
30
|
+
* @param sort Sort order
|
|
31
31
|
* @returns EntityQuery
|
|
32
32
|
*/
|
|
33
33
|
sort(sort: EntitySortEnum | typeof defaultEntityQuerySort): BaseEntityQuery<EntityStruct, IndexesStruct>;
|
|
34
34
|
/**
|
|
35
|
-
* @description
|
|
36
|
-
* @returns
|
|
35
|
+
* @description Get one entity record
|
|
36
|
+
* @returns Entity data value
|
|
37
37
|
*/
|
|
38
38
|
getOne(): Promise<EntityResultData<EntityStruct> | undefined>;
|
|
39
39
|
/**
|
|
40
|
-
* @description
|
|
41
|
-
* @returns
|
|
40
|
+
* @description Get entity data array
|
|
41
|
+
* @returns Entity data paginated query result object
|
|
42
42
|
*/
|
|
43
43
|
getMany(): Promise<EntityListResultData<EntityStruct>>;
|
|
44
44
|
/**
|
|
45
|
-
* @description
|
|
46
|
-
* @returns
|
|
45
|
+
* @description Get total count of entity data
|
|
46
|
+
* @returns Total count
|
|
47
47
|
*/
|
|
48
48
|
count(): Promise<number>;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* @description
|
|
52
|
-
* @typedef EntityStruct
|
|
53
|
-
* @typedef IndexesStruct
|
|
51
|
+
* @description Entity query object
|
|
52
|
+
* @typedef EntityStruct Entity data structure
|
|
53
|
+
* @typedef IndexesStruct Entity index structure
|
|
54
54
|
*/
|
|
55
55
|
export interface InferIndexEntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> extends BaseEntityQuery<EntityStruct, IndexesStruct> {
|
|
56
56
|
cursor: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['cursor'], InferIndexEntityQuery<EntityStruct, IndexesStruct>>;
|
|
57
57
|
limit: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['limit'], InferIndexEntityQuery<EntityStruct, IndexesStruct>>;
|
|
58
58
|
sort: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['sort'], InferIndexEntityQuery<EntityStruct, IndexesStruct>>;
|
|
59
59
|
/**
|
|
60
|
-
* @description
|
|
61
|
-
* @param index
|
|
62
|
-
* @param partitions
|
|
60
|
+
* @description Set entity query index
|
|
61
|
+
* @param index Index
|
|
62
|
+
* @param partitions Partition attribute values of the index
|
|
63
63
|
* @returns EntityQuery
|
|
64
64
|
*/
|
|
65
65
|
index<IndexKey extends keyof ConditionalExcept<IndexesStruct, null>>(index: IndexKey, partitions: IndexesStruct[IndexKey]): InferWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
66
66
|
/**
|
|
67
|
-
* @description
|
|
68
|
-
* @param index
|
|
67
|
+
* @description Set entity query index
|
|
68
|
+
* @param index Index
|
|
69
69
|
* @returns EntityQuery
|
|
70
70
|
*/
|
|
71
71
|
index<IndexKey extends keyof ConditionalPick<IndexesStruct, null>>(index: IndexKey): InferWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
72
72
|
/**
|
|
73
|
-
* @description
|
|
74
|
-
* @param index
|
|
73
|
+
* @description Set entity query index
|
|
74
|
+
* @param index Index
|
|
75
75
|
* @returns EntityQuery
|
|
76
76
|
*/
|
|
77
77
|
index(index: typeof defaultEntityQueryIndex): InferWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* @description
|
|
81
|
-
* @typedef EntityStruct
|
|
82
|
-
* @typedef IndexesStruct
|
|
80
|
+
* @description Entity query object
|
|
81
|
+
* @typedef EntityStruct Entity data structure
|
|
82
|
+
* @typedef IndexesStruct Entity index structure
|
|
83
83
|
*/
|
|
84
84
|
export interface InputIndexEntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> extends BaseEntityQuery<EntityStruct, IndexesStruct> {
|
|
85
85
|
cursor: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['cursor'], InputIndexEntityQuery<EntityStruct, IndexesStruct>>;
|
|
86
86
|
limit: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['limit'], InputIndexEntityQuery<EntityStruct, IndexesStruct>>;
|
|
87
87
|
sort: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['sort'], InputIndexEntityQuery<EntityStruct, IndexesStruct>>;
|
|
88
88
|
/**
|
|
89
|
-
* @description
|
|
90
|
-
* @typedef Partitions
|
|
91
|
-
* @param index
|
|
92
|
-
* @param partitions
|
|
89
|
+
* @description Set entity query index
|
|
90
|
+
* @typedef Partitions Partition attribute value type of index
|
|
91
|
+
* @param index Index
|
|
92
|
+
* @param partitions Partition attribute values of the index
|
|
93
93
|
* @returns EntityQuery
|
|
94
94
|
*/
|
|
95
95
|
index<Partitions extends BaseIndexesStructValue>(index: string, partitions: Partitions): InputWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
96
96
|
/**
|
|
97
|
-
* @description
|
|
98
|
-
* @param index
|
|
97
|
+
* @description Set entity query index
|
|
98
|
+
* @param index Index
|
|
99
99
|
* @returns EntityQuery
|
|
100
100
|
*/
|
|
101
101
|
index(index: string): InputWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
102
102
|
/**
|
|
103
|
-
* @description
|
|
104
|
-
* @param index
|
|
103
|
+
* @description Set entity query index
|
|
104
|
+
* @param index Index
|
|
105
105
|
* @returns EntityQuery
|
|
106
106
|
*/
|
|
107
107
|
index(index: typeof defaultEntityQueryIndex): InputWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* @description
|
|
111
|
-
* @typedef EntityStruct
|
|
112
|
-
* @typedef IndexesStruct
|
|
110
|
+
* @description Entity query object
|
|
111
|
+
* @typedef EntityStruct Entity data structure
|
|
112
|
+
* @typedef IndexesStruct Entity index structure
|
|
113
113
|
*/
|
|
114
114
|
export interface InferWhereEntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> extends InferIndexEntityQuery<EntityStruct, IndexesStruct> {
|
|
115
115
|
cursor: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['cursor'], InferWhereEntityQuery<EntityStruct, IndexesStruct>>;
|
|
116
116
|
limit: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['limit'], InferWhereEntityQuery<EntityStruct, IndexesStruct>>;
|
|
117
117
|
sort: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['sort'], InferWhereEntityQuery<EntityStruct, IndexesStruct>>;
|
|
118
118
|
/**
|
|
119
|
-
* @description
|
|
120
|
-
* @param condition
|
|
119
|
+
* @description Set entity query condition
|
|
120
|
+
* @param condition Condition
|
|
121
121
|
* @returns EntityQuery
|
|
122
122
|
*/
|
|
123
123
|
where(condition: EntityWhereCondition | typeof defaultEntityQueryWhere): InferWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* @description
|
|
127
|
-
* @typedef EntityStruct
|
|
128
|
-
* @typedef IndexesStruct
|
|
126
|
+
* @description Entity query object
|
|
127
|
+
* @typedef EntityStruct Entity data structure
|
|
128
|
+
* @typedef IndexesStruct Entity index structure
|
|
129
129
|
*/
|
|
130
130
|
export interface InputWhereEntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> extends InputIndexEntityQuery<EntityStruct, IndexesStruct> {
|
|
131
131
|
cursor: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['cursor'], InputWhereEntityQuery<EntityStruct, IndexesStruct>>;
|
|
132
132
|
limit: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['limit'], InputWhereEntityQuery<EntityStruct, IndexesStruct>>;
|
|
133
133
|
sort: SetReturnType<BaseEntityQuery<EntityStruct, IndexesStruct>['sort'], InputWhereEntityQuery<EntityStruct, IndexesStruct>>;
|
|
134
134
|
/**
|
|
135
|
-
* @description
|
|
136
|
-
* @param condition
|
|
135
|
+
* @description Set entity query condition
|
|
136
|
+
* @param condition Condition
|
|
137
137
|
* @returns EntityQuery
|
|
138
138
|
*/
|
|
139
139
|
where(condition: EntityWhereCondition | typeof defaultEntityQueryWhere): InputWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
-
* @description
|
|
143
|
-
* @typedef EntityStruct
|
|
144
|
-
* @typedef IndexesStruct
|
|
142
|
+
* @description Entity query object
|
|
143
|
+
* @typedef EntityStruct Entity data structure
|
|
144
|
+
* @typedef IndexesStruct Entity index structure
|
|
145
145
|
*/
|
|
146
146
|
export type UnionEntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> = BaseEntityQuery<EntityStruct, IndexesStruct> | InferIndexEntityQuery<EntityStruct, IndexesStruct> | InputIndexEntityQuery<EntityStruct, IndexesStruct> | InferWhereEntityQuery<EntityStruct, IndexesStruct> | InputWhereEntityQuery<EntityStruct, IndexesStruct>;
|
|
147
147
|
/**
|
|
148
|
-
* @description
|
|
149
|
-
* @typedef EntityStruct
|
|
150
|
-
* @typedef IndexesStruct
|
|
148
|
+
* @description Entity query object
|
|
149
|
+
* @typedef EntityStruct Entity data structure
|
|
150
|
+
* @typedef IndexesStruct Entity index structure
|
|
151
151
|
*/
|
|
152
152
|
export type EntityQuery<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>> = UnionToIntersection<UnionEntityQuery<EntityStruct, IndexesStruct>>;
|
|
153
153
|
export interface DefaultEntityQuery {
|
|
@@ -6,48 +6,48 @@ export type EntityCountResult = EntityResult<{
|
|
|
6
6
|
}>;
|
|
7
7
|
export type EntityListResult<EntityStruct> = EntityResult<EntityListResultData<EntityStruct>>;
|
|
8
8
|
/**
|
|
9
|
-
* @description
|
|
10
|
-
* @typedef EntityStruct
|
|
9
|
+
* @description Entity data query result object
|
|
10
|
+
* @typedef EntityStruct Entity data structure
|
|
11
11
|
*/
|
|
12
12
|
export interface EntityResultData<EntityStruct> {
|
|
13
13
|
/**
|
|
14
|
-
* @description
|
|
14
|
+
* @description Data key
|
|
15
15
|
*/
|
|
16
16
|
key: string;
|
|
17
17
|
/**
|
|
18
|
-
* @description
|
|
18
|
+
* @description Data value
|
|
19
19
|
*/
|
|
20
20
|
value: EntityStruct;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* @description
|
|
24
|
-
* @typedef EntityStruct
|
|
23
|
+
* @description Entity data paginated query result object
|
|
24
|
+
* @typedef EntityStruct Entity data structure
|
|
25
25
|
*/
|
|
26
26
|
export interface EntityListResultData<EntityStruct> {
|
|
27
27
|
/**
|
|
28
|
-
* @description
|
|
28
|
+
* @description Pagination info
|
|
29
29
|
*/
|
|
30
30
|
page_info: {
|
|
31
31
|
/**
|
|
32
|
-
* @description
|
|
32
|
+
* @description Total count of current page
|
|
33
33
|
*/
|
|
34
34
|
count: number;
|
|
35
35
|
/**
|
|
36
|
-
* @description
|
|
36
|
+
* @description Whether there is more data
|
|
37
37
|
*/
|
|
38
38
|
has_more: boolean;
|
|
39
39
|
/**
|
|
40
|
-
* @description
|
|
40
|
+
* @description Cursor at end of current page
|
|
41
41
|
*/
|
|
42
42
|
end_cursor: string;
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* @description
|
|
45
|
+
* @description Paginated data array
|
|
46
46
|
*/
|
|
47
47
|
data: EntityResultData<EntityStruct>[];
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* @description
|
|
50
|
+
* @description Entity query or operation error object
|
|
51
51
|
*/
|
|
52
52
|
export type EntityError = ErrorResult<never, EntityErrorCode>;
|
|
53
53
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @enum EntitySortEnum
|
|
3
|
-
* @description
|
|
3
|
+
* @description Entity sort order enum
|
|
4
4
|
*/
|
|
5
5
|
export declare enum EntitySortEnum {
|
|
6
6
|
/**
|
|
7
|
-
* @description
|
|
7
|
+
* @description Ascending
|
|
8
8
|
*/
|
|
9
9
|
ASC = "ASC",
|
|
10
10
|
/**
|
|
11
|
-
* @description
|
|
11
|
+
* @description Descending
|
|
12
12
|
*/
|
|
13
13
|
DESC = "DESC"
|
|
14
14
|
}
|
|
@@ -6,40 +6,40 @@ import type { Entity, BaseEntityStruct, BaseIndexesStruct } from './entity';
|
|
|
6
6
|
import type { defaultEntityQueryCursor, defaultEntityQueryIndex, defaultEntityQueryLimit, defaultEntityQuerySort, defaultEntityQueryWhere } from './query';
|
|
7
7
|
export interface EntityStatic {
|
|
8
8
|
/**
|
|
9
|
-
* @description
|
|
9
|
+
* @description Entity sort order enum
|
|
10
10
|
*/
|
|
11
11
|
Sort: typeof EntitySortEnum;
|
|
12
12
|
/**
|
|
13
|
-
* @description
|
|
13
|
+
* @description Entity error code enum
|
|
14
14
|
*/
|
|
15
15
|
EntityErrorCode: typeof EntityErrorCode;
|
|
16
16
|
/**
|
|
17
|
-
* @description
|
|
17
|
+
* @description Entity query condition method enum
|
|
18
18
|
*/
|
|
19
19
|
WhereConditions: typeof WhereConditions;
|
|
20
20
|
/**
|
|
21
|
-
* @description
|
|
21
|
+
* @description Default entity query cursor
|
|
22
22
|
*/
|
|
23
23
|
defaultEntityQueryCursor: typeof defaultEntityQueryCursor;
|
|
24
24
|
/**
|
|
25
|
-
* @description
|
|
25
|
+
* @description Default entity query index
|
|
26
26
|
*/
|
|
27
27
|
defaultEntityQueryIndex: typeof defaultEntityQueryIndex;
|
|
28
28
|
/**
|
|
29
|
-
* @description
|
|
29
|
+
* @description Default entity query limit
|
|
30
30
|
*/
|
|
31
31
|
defaultEntityQueryLimit: typeof defaultEntityQueryLimit;
|
|
32
32
|
/**
|
|
33
|
-
* @description
|
|
33
|
+
* @description Default entity query sort
|
|
34
34
|
*/
|
|
35
35
|
defaultEntityQuerySort: typeof defaultEntityQuerySort;
|
|
36
36
|
/**
|
|
37
|
-
* @description
|
|
37
|
+
* @description Default entity query condition
|
|
38
38
|
*/
|
|
39
39
|
defaultEntityQueryWhere: typeof defaultEntityQueryWhere;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* @description
|
|
42
|
+
* @description Auto-generated at compile time
|
|
43
43
|
* @example
|
|
44
44
|
* declare global {
|
|
45
45
|
* var ONESEntities: {
|
|
@@ -61,19 +61,19 @@ type PluginEntities = FindGlobalType<'ONESEntities'>;
|
|
|
61
61
|
export interface BaseEntityFactory {
|
|
62
62
|
/**
|
|
63
63
|
* @function EntityFactory
|
|
64
|
-
* @description
|
|
65
|
-
* @typedef EntityStruct
|
|
66
|
-
* @typedef IndexesStruct
|
|
67
|
-
* @param entityName
|
|
64
|
+
* @description Create entity operation object
|
|
65
|
+
* @typedef EntityStruct Entity data structure
|
|
66
|
+
* @typedef IndexesStruct Entity index structure
|
|
67
|
+
* @param entityName Entity name
|
|
68
68
|
* @returns Entity
|
|
69
69
|
*/
|
|
70
70
|
<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>>(entityName: string): Entity<EntityStruct, IndexesStruct>;
|
|
71
71
|
/**
|
|
72
72
|
* @function EntityFactory
|
|
73
|
-
* @description
|
|
74
|
-
* @typedef EntityStruct
|
|
75
|
-
* @typedef IndexesStruct
|
|
76
|
-
* @param entityName
|
|
73
|
+
* @description Create entity operation object
|
|
74
|
+
* @typedef EntityStruct Entity data structure
|
|
75
|
+
* @typedef IndexesStruct Entity index structure
|
|
76
|
+
* @param entityName Entity name
|
|
77
77
|
* @returns Entity
|
|
78
78
|
*/
|
|
79
79
|
<EntityStruct extends BaseEntityStruct<EntityStruct>>(entityName: string): Entity<EntityStruct, EmptyObject>;
|
|
@@ -81,28 +81,28 @@ export interface BaseEntityFactory {
|
|
|
81
81
|
export interface PluginEntityFactory {
|
|
82
82
|
/**
|
|
83
83
|
* @function EntityFactory
|
|
84
|
-
* @description
|
|
85
|
-
* @typedef EntityStruct
|
|
86
|
-
* @typedef IndexesStruct
|
|
87
|
-
* @param entityName
|
|
84
|
+
* @description Create entity operation object
|
|
85
|
+
* @typedef EntityStruct Entity data structure
|
|
86
|
+
* @typedef IndexesStruct Entity index structure
|
|
87
|
+
* @param entityName Entity name
|
|
88
88
|
* @returns Entity
|
|
89
89
|
*/
|
|
90
90
|
<EntityName extends keyof PluginEntities>(entityName: EntityName): Entity<Get<PluginEntities, Exclude<EntityName, number | symbol>>['attributes'], Get<PluginEntities, Exclude<EntityName, number | symbol>>['indexes']>;
|
|
91
91
|
/**
|
|
92
92
|
* @function EntityFactory
|
|
93
|
-
* @description
|
|
94
|
-
* @typedef EntityStruct
|
|
95
|
-
* @typedef IndexesStruct
|
|
96
|
-
* @param entityName
|
|
93
|
+
* @description Create entity operation object
|
|
94
|
+
* @typedef EntityStruct Entity data structure
|
|
95
|
+
* @typedef IndexesStruct Entity index structure
|
|
96
|
+
* @param entityName Entity name
|
|
97
97
|
* @returns Entity
|
|
98
98
|
*/
|
|
99
99
|
<EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>>(entityName: string): Entity<EntityStruct, IndexesStruct>;
|
|
100
100
|
/**
|
|
101
101
|
* @function EntityFactory
|
|
102
|
-
* @description
|
|
103
|
-
* @typedef EntityStruct
|
|
104
|
-
* @typedef IndexesStruct
|
|
105
|
-
* @param entityName
|
|
102
|
+
* @description Create entity operation object
|
|
103
|
+
* @typedef EntityStruct Entity data structure
|
|
104
|
+
* @typedef IndexesStruct Entity index structure
|
|
105
|
+
* @param entityName Entity name
|
|
106
106
|
* @returns Entity
|
|
107
107
|
*/
|
|
108
108
|
<EntityStruct extends BaseEntityStruct<EntityStruct>>(entityName: string): Entity<EntityStruct, EmptyObject>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @enum ObjectErrorCode
|
|
3
|
-
* @description
|
|
3
|
+
* @description Object storage error code enum
|
|
4
4
|
*/
|
|
5
5
|
export declare enum ObjectErrorCode {
|
|
6
6
|
/**
|
|
7
|
-
* @description
|
|
7
|
+
* @description Object storage key is empty / contains invalid characters / exceeds max length
|
|
8
8
|
* @satisfies /^[0-9a-zA-Z!_.*'()-]{1,128}$/
|
|
9
9
|
*/
|
|
10
10
|
ObjectKeyInvalid = "ObjectKeyInvalid",
|
|
11
11
|
/**
|
|
12
|
-
* @description
|
|
12
|
+
* @description Object storage key does not exist
|
|
13
13
|
*/
|
|
14
14
|
ObjectKeyNotfound = "ObjectKeyNotfound",
|
|
15
15
|
/**
|
|
16
|
-
* @description
|
|
16
|
+
* @description Request timeout
|
|
17
17
|
*/
|
|
18
18
|
RequestTimeOut = "RequestTimeOut"
|
|
19
19
|
}
|
|
@@ -2,19 +2,19 @@ import type { ObjectErrorResult } from './types';
|
|
|
2
2
|
export * from './consts';
|
|
3
3
|
export * from './types';
|
|
4
4
|
/**
|
|
5
|
-
* @description
|
|
5
|
+
* @description Object storage operation error object
|
|
6
6
|
*/
|
|
7
7
|
export declare class ObjectError implements ObjectErrorResult {
|
|
8
8
|
/**
|
|
9
|
-
* @description
|
|
9
|
+
* @description Error code enum
|
|
10
10
|
*/
|
|
11
11
|
code: import("../../..").ErrorCode | import("./consts").ObjectErrorCode;
|
|
12
12
|
/**
|
|
13
|
-
* @description
|
|
13
|
+
* @description Error message
|
|
14
14
|
*/
|
|
15
15
|
err_msg: string;
|
|
16
16
|
/**
|
|
17
|
-
* @description
|
|
17
|
+
* @description Error payload
|
|
18
18
|
*/
|
|
19
19
|
err_values: Record<string, any> | undefined;
|
|
20
20
|
constructor(result: ObjectErrorResult);
|
|
@@ -15,15 +15,15 @@ export type ObjectDownloadResult = ObjectResult<{
|
|
|
15
15
|
}>;
|
|
16
16
|
export type ObjectDeleteResult = ObjectResult<never>;
|
|
17
17
|
/**
|
|
18
|
-
* @description
|
|
18
|
+
* @description Result object for object metadata
|
|
19
19
|
*/
|
|
20
20
|
export interface ObjectMetadataResultData {
|
|
21
21
|
/**
|
|
22
|
-
* @description
|
|
22
|
+
* @description Object storage key
|
|
23
23
|
*/
|
|
24
24
|
object_key: string;
|
|
25
25
|
/**
|
|
26
|
-
* @description
|
|
26
|
+
* @description File size in bytes
|
|
27
27
|
*/
|
|
28
28
|
size: number;
|
|
29
29
|
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import type { ObjectError, ObjectErrorCode } from './error';
|
|
2
2
|
import type { ObjectResultDataFields, ObjectMetadataResultData } from './result';
|
|
3
3
|
/**
|
|
4
|
-
* @description
|
|
4
|
+
* @description Operation object for getting upload info
|
|
5
5
|
*/
|
|
6
6
|
export interface ObjectStoreUploadResult {
|
|
7
7
|
/**
|
|
8
|
-
* @description
|
|
8
|
+
* @description Get upload URL (must be requested from plugin backend)
|
|
9
9
|
*/
|
|
10
10
|
getUrl(): string;
|
|
11
11
|
/**
|
|
12
|
-
* @description
|
|
12
|
+
* @description Get upload URL (suitable for browser requests)
|
|
13
13
|
*/
|
|
14
14
|
getWebUrl(): string;
|
|
15
15
|
/**
|
|
16
|
-
* @description
|
|
16
|
+
* @description Get FormData parameters for the request
|
|
17
17
|
*/
|
|
18
18
|
getFields(): ObjectResultDataFields;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* @description
|
|
21
|
+
* @description Operation object for getting download info
|
|
22
22
|
*/
|
|
23
23
|
export interface ObjectStoreDownloadResult {
|
|
24
24
|
/**
|
|
25
|
-
* @description
|
|
25
|
+
* @description Get download URL (must be requested from plugin backend)
|
|
26
26
|
*/
|
|
27
27
|
getUrl(): string;
|
|
28
28
|
/**
|
|
29
|
-
* @description
|
|
29
|
+
* @description Get download URL (suitable for browser requests)
|
|
30
30
|
*/
|
|
31
31
|
getWebUrl(): string;
|
|
32
32
|
}
|
|
33
33
|
export interface ObjectStore {
|
|
34
34
|
/**
|
|
35
|
-
* @description
|
|
35
|
+
* @description Object storage operation error object
|
|
36
36
|
*/
|
|
37
37
|
ObjectError: typeof ObjectError;
|
|
38
38
|
/**
|
|
39
|
-
* @description
|
|
39
|
+
* @description Object storage error code enum
|
|
40
40
|
*/
|
|
41
41
|
ObjectErrorCode: typeof ObjectErrorCode;
|
|
42
42
|
/**
|
|
43
|
-
* @description
|
|
44
|
-
* @param key
|
|
43
|
+
* @description Upload an object
|
|
44
|
+
* @param key Object storage key
|
|
45
45
|
* @returns ObjectStoreUploadResult
|
|
46
46
|
*/
|
|
47
47
|
upload(key: string): Promise<ObjectStoreUploadResult | ObjectError>;
|
|
48
48
|
/**
|
|
49
|
-
* @description
|
|
50
|
-
* @param key
|
|
49
|
+
* @description Download an object
|
|
50
|
+
* @param key Object storage key
|
|
51
51
|
* @returns ObjectStoreDownloadResult
|
|
52
52
|
*/
|
|
53
53
|
download(key: string): Promise<ObjectStoreDownloadResult | ObjectError>;
|
|
54
54
|
/**
|
|
55
|
-
* @description
|
|
56
|
-
* @param key
|
|
55
|
+
* @description Delete an object
|
|
56
|
+
* @param key Object storage key
|
|
57
57
|
*/
|
|
58
58
|
delete(key: string): Promise<void | ObjectError>;
|
|
59
59
|
/**
|
|
60
|
-
* @description
|
|
61
|
-
* @param key
|
|
60
|
+
* @description Get metadata of an object
|
|
61
|
+
* @param key Object storage key
|
|
62
62
|
* @returns ObjectMetadataResultData
|
|
63
63
|
*/
|
|
64
64
|
metadata(key: string): Promise<ObjectMetadataResultData | ObjectError>;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @description
|
|
2
|
+
* @description Get the open platform base URL
|
|
3
3
|
* @alias getONESHostedBaseUrl
|
|
4
|
-
* @returns
|
|
4
|
+
* @returns ONES_HOSTED_BASE_URL
|
|
5
5
|
*/
|
|
6
6
|
export declare const getONESHostedBaseUrl: () => string | undefined;
|
|
7
7
|
/**
|
|
8
|
-
* @description
|
|
8
|
+
* @description Get the app instance ID
|
|
9
9
|
* @alias getONESHostedAppID
|
|
10
|
-
* @returns
|
|
10
|
+
* @returns ONES_HOSTED_APP_ID
|
|
11
11
|
*/
|
|
12
12
|
export declare const getONESHostedAppID: () => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* @description Get the app hosted token
|
|
15
|
+
* @alias getONESHostedToken
|
|
16
|
+
* @returns ONES_HOSTED_TOKEN
|
|
17
|
+
*/
|
|
18
|
+
export declare const getONESHostedToken: () => string | undefined;
|
|
13
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/env/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0BAEhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0BAE9B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/env/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0BAEhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0BAE9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0BAE9B,CAAA"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { ErrorCode } from '../../../packages/strict/error';
|
|
2
2
|
export interface SuccessResult<Data> {
|
|
3
3
|
/**
|
|
4
|
-
* @description
|
|
4
|
+
* @description Request succeeded
|
|
5
5
|
*/
|
|
6
6
|
code: 'OK';
|
|
7
7
|
/**
|
|
8
|
-
* @description
|
|
8
|
+
* @description Response body
|
|
9
9
|
*/
|
|
10
10
|
data?: Data;
|
|
11
11
|
}
|
|
12
12
|
export interface ErrorResult<Data, Code> {
|
|
13
13
|
/**
|
|
14
|
-
* @description
|
|
14
|
+
* @description Error code enum
|
|
15
15
|
*/
|
|
16
16
|
code: Code | ErrorCode;
|
|
17
17
|
/**
|
|
18
|
-
* @description
|
|
18
|
+
* @description Response body
|
|
19
19
|
*/
|
|
20
20
|
data?: Data;
|
|
21
21
|
/**
|
|
22
|
-
* @description
|
|
22
|
+
* @description Error message
|
|
23
23
|
*/
|
|
24
24
|
err_msg: string;
|
|
25
25
|
/**
|
|
26
|
-
* @description
|
|
26
|
+
* @description Error payload
|
|
27
27
|
*/
|
|
28
28
|
err_values?: Record<string, any>;
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ones-open/node-sdk",
|
|
3
|
-
"version": "0.0.4-
|
|
3
|
+
"version": "0.0.4-16644.216+5b8986c9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/types/index.d.ts",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/lodash-es": "^4.17.12"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5b8986c971f7a93045070b6cede500665522199a"
|
|
54
54
|
}
|