@ones-open/node-sdk 0.0.4-17608.41 → 0.0.4-23321.129
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
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const _defineProperty = require("@babel/runtime-corejs3/helpers/defineProperty");
|
|
4
3
|
const lodashEs = require("lodash-es");
|
|
5
4
|
const Fetch = require("axios");
|
|
6
5
|
const _sortInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/sort");
|
|
@@ -10,10 +9,14 @@ const getONESHostedBaseUrl = () => {
|
|
|
10
9
|
const getONESHostedAppID = () => {
|
|
11
10
|
return process.env.ONES_HOSTED_APP_ID;
|
|
12
11
|
};
|
|
12
|
+
const getONESHostedToken = () => {
|
|
13
|
+
return process.env.ONES_HOSTED_TOKEN;
|
|
14
|
+
};
|
|
13
15
|
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
14
16
|
__proto__: null,
|
|
15
17
|
getONESHostedAppID,
|
|
16
|
-
getONESHostedBaseUrl
|
|
18
|
+
getONESHostedBaseUrl,
|
|
19
|
+
getONESHostedToken
|
|
17
20
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
18
21
|
var EntityWhereConditionEnum = /* @__PURE__ */ ((EntityWhereConditionEnum2) => {
|
|
19
22
|
EntityWhereConditionEnum2["beginsWith"] = "beginsWith";
|
|
@@ -116,7 +119,7 @@ const createErrorResult = (code, message, error) => {
|
|
|
116
119
|
};
|
|
117
120
|
const fetch$1 = Fetch.create();
|
|
118
121
|
const buildAuthHeaders$1 = () => {
|
|
119
|
-
const token =
|
|
122
|
+
const token = getONESHostedToken();
|
|
120
123
|
if (token) {
|
|
121
124
|
return {
|
|
122
125
|
Authorization: `Bearer ${token}`
|
|
@@ -195,12 +198,12 @@ const defaultEntityQueryIndex = defaultEntityQuery.index;
|
|
|
195
198
|
const defaultEntityQueryWhere = defaultEntityQuery.where;
|
|
196
199
|
class EntityQueryClass {
|
|
197
200
|
constructor(name) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
this._name = "";
|
|
202
|
+
this._cursor = [defaultEntityQueryCursor];
|
|
203
|
+
this._limit = [defaultEntityQueryLimit];
|
|
204
|
+
this._sort = [defaultEntityQuerySort];
|
|
205
|
+
this._index = [defaultEntityQueryIndex];
|
|
206
|
+
this._where = [defaultEntityQueryWhere];
|
|
204
207
|
this._name = name;
|
|
205
208
|
}
|
|
206
209
|
cursor(cursor) {
|
|
@@ -294,7 +297,7 @@ class EntityQueryClass {
|
|
|
294
297
|
}
|
|
295
298
|
class EntityClass {
|
|
296
299
|
constructor(name) {
|
|
297
|
-
|
|
300
|
+
this._name = "";
|
|
298
301
|
this._name = name;
|
|
299
302
|
}
|
|
300
303
|
async get(key) {
|
|
@@ -400,11 +403,8 @@ var ObjectErrorCode = /* @__PURE__ */ ((ObjectErrorCode2) => {
|
|
|
400
403
|
return ObjectErrorCode2;
|
|
401
404
|
})(ObjectErrorCode || {});
|
|
402
405
|
class ObjectError {
|
|
403
|
-
/**
|
|
404
|
-
* @description 错误载荷
|
|
405
|
-
*/
|
|
406
406
|
constructor(result) {
|
|
407
|
-
|
|
407
|
+
this.err_msg = "";
|
|
408
408
|
this.code = result.code;
|
|
409
409
|
this.err_msg = result.err_msg;
|
|
410
410
|
this.err_values = result.err_values;
|
|
@@ -412,7 +412,7 @@ class ObjectError {
|
|
|
412
412
|
}
|
|
413
413
|
const fetch = Fetch.create();
|
|
414
414
|
const buildAuthHeaders = () => {
|
|
415
|
-
const token =
|
|
415
|
+
const token = getONESHostedToken();
|
|
416
416
|
if (token) {
|
|
417
417
|
return {
|
|
418
418
|
Authorization: `Bearer ${token}`
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
1
|
import { isNull, isUndefined, isSymbol, set } from "lodash-es";
|
|
3
2
|
import Fetch, { AxiosError } from "axios";
|
|
4
3
|
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
|
@@ -8,10 +7,14 @@ const getONESHostedBaseUrl = () => {
|
|
|
8
7
|
const getONESHostedAppID = () => {
|
|
9
8
|
return process.env.ONES_HOSTED_APP_ID;
|
|
10
9
|
};
|
|
10
|
+
const getONESHostedToken = () => {
|
|
11
|
+
return process.env.ONES_HOSTED_TOKEN;
|
|
12
|
+
};
|
|
11
13
|
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
14
|
__proto__: null,
|
|
13
15
|
getONESHostedAppID,
|
|
14
|
-
getONESHostedBaseUrl
|
|
16
|
+
getONESHostedBaseUrl,
|
|
17
|
+
getONESHostedToken
|
|
15
18
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
19
|
var EntityWhereConditionEnum = /* @__PURE__ */ ((EntityWhereConditionEnum2) => {
|
|
17
20
|
EntityWhereConditionEnum2["beginsWith"] = "beginsWith";
|
|
@@ -114,7 +117,7 @@ const createErrorResult = (code, message, error) => {
|
|
|
114
117
|
};
|
|
115
118
|
const fetch$1 = Fetch.create();
|
|
116
119
|
const buildAuthHeaders$1 = () => {
|
|
117
|
-
const token =
|
|
120
|
+
const token = getONESHostedToken();
|
|
118
121
|
if (token) {
|
|
119
122
|
return {
|
|
120
123
|
Authorization: `Bearer ${token}`
|
|
@@ -193,12 +196,12 @@ const defaultEntityQueryIndex = defaultEntityQuery.index;
|
|
|
193
196
|
const defaultEntityQueryWhere = defaultEntityQuery.where;
|
|
194
197
|
class EntityQueryClass {
|
|
195
198
|
constructor(name) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
this._name = "";
|
|
200
|
+
this._cursor = [defaultEntityQueryCursor];
|
|
201
|
+
this._limit = [defaultEntityQueryLimit];
|
|
202
|
+
this._sort = [defaultEntityQuerySort];
|
|
203
|
+
this._index = [defaultEntityQueryIndex];
|
|
204
|
+
this._where = [defaultEntityQueryWhere];
|
|
202
205
|
this._name = name;
|
|
203
206
|
}
|
|
204
207
|
cursor(cursor) {
|
|
@@ -292,7 +295,7 @@ class EntityQueryClass {
|
|
|
292
295
|
}
|
|
293
296
|
class EntityClass {
|
|
294
297
|
constructor(name) {
|
|
295
|
-
|
|
298
|
+
this._name = "";
|
|
296
299
|
this._name = name;
|
|
297
300
|
}
|
|
298
301
|
async get(key) {
|
|
@@ -398,11 +401,8 @@ var ObjectErrorCode = /* @__PURE__ */ ((ObjectErrorCode2) => {
|
|
|
398
401
|
return ObjectErrorCode2;
|
|
399
402
|
})(ObjectErrorCode || {});
|
|
400
403
|
class ObjectError {
|
|
401
|
-
/**
|
|
402
|
-
* @description 错误载荷
|
|
403
|
-
*/
|
|
404
404
|
constructor(result) {
|
|
405
|
-
|
|
405
|
+
this.err_msg = "";
|
|
406
406
|
this.code = result.code;
|
|
407
407
|
this.err_msg = result.err_msg;
|
|
408
408
|
this.err_values = result.err_values;
|
|
@@ -410,7 +410,7 @@ class ObjectError {
|
|
|
410
410
|
}
|
|
411
411
|
const fetch = Fetch.create();
|
|
412
412
|
const buildAuthHeaders = () => {
|
|
413
|
-
const token =
|
|
413
|
+
const token = getONESHostedToken();
|
|
414
414
|
if (token) {
|
|
415
415
|
return {
|
|
416
416
|
Authorization: `Bearer ${token}`
|
|
@@ -10,4 +10,5 @@ export declare const getONESHostedBaseUrl: () => string | undefined;
|
|
|
10
10
|
* @returns onesHostedAppID
|
|
11
11
|
*/
|
|
12
12
|
export declare const getONESHostedAppID: () => string | undefined;
|
|
13
|
+
export declare const getONESHostedToken: () => string | undefined;
|
|
13
14
|
//# 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,eAAO,MAAM,kBAAkB,0BAE9B,CAAA"}
|
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-23321.129+659db280",
|
|
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": "659db280fe4f70c223c177fd5fea1ec49437e51d"
|
|
54
54
|
}
|