@ones-open/node-sdk 0.0.1 → 0.0.3

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 (82) hide show
  1. package/LICENSE +201 -0
  2. package/dist/index.cjs +538 -2
  3. package/dist/index.js +538 -2
  4. package/dist/types/index.d.ts +1 -1
  5. package/dist/types/index.d.ts.map +1 -1
  6. package/dist/types/packages/node/index.d.ts +5 -0
  7. package/dist/types/packages/node/index.d.ts.map +1 -0
  8. package/dist/types/packages/node/storage/entity/entity/index.d.ts +13 -0
  9. package/dist/types/packages/node/storage/entity/entity/index.d.ts.map +1 -0
  10. package/dist/types/packages/node/storage/entity/entity/types.d.ts +68 -0
  11. package/dist/types/packages/node/storage/entity/entity/types.d.ts.map +1 -0
  12. package/dist/types/packages/node/storage/entity/error/consts.d.ts +127 -0
  13. package/dist/types/packages/node/storage/entity/error/consts.d.ts.map +1 -0
  14. package/dist/types/packages/node/storage/entity/error/index.d.ts +2 -0
  15. package/dist/types/packages/node/storage/entity/error/index.d.ts.map +1 -0
  16. package/dist/types/packages/node/storage/entity/fetch/index.d.ts +7 -0
  17. package/dist/types/packages/node/storage/entity/fetch/index.d.ts.map +1 -0
  18. package/dist/types/packages/node/storage/entity/fetch/types.d.ts +50 -0
  19. package/dist/types/packages/node/storage/entity/fetch/types.d.ts.map +1 -0
  20. package/dist/types/packages/node/storage/entity/index.d.ts +23 -0
  21. package/dist/types/packages/node/storage/entity/index.d.ts.map +1 -0
  22. package/dist/types/packages/node/storage/entity/query/consts.d.ts +6 -0
  23. package/dist/types/packages/node/storage/entity/query/consts.d.ts.map +1 -0
  24. package/dist/types/packages/node/storage/entity/query/index.d.ts +27 -0
  25. package/dist/types/packages/node/storage/entity/query/index.d.ts.map +1 -0
  26. package/dist/types/packages/node/storage/entity/query/types.d.ts +174 -0
  27. package/dist/types/packages/node/storage/entity/query/types.d.ts.map +1 -0
  28. package/dist/types/packages/node/storage/entity/result/index.d.ts +2 -0
  29. package/dist/types/packages/node/storage/entity/result/index.d.ts.map +1 -0
  30. package/dist/types/packages/node/storage/entity/result/types.d.ts +53 -0
  31. package/dist/types/packages/node/storage/entity/result/types.d.ts.map +1 -0
  32. package/dist/types/packages/node/storage/entity/sort/consts.d.ts +15 -0
  33. package/dist/types/packages/node/storage/entity/sort/consts.d.ts.map +1 -0
  34. package/dist/types/packages/node/storage/entity/sort/index.d.ts +2 -0
  35. package/dist/types/packages/node/storage/entity/sort/index.d.ts.map +1 -0
  36. package/dist/types/packages/node/storage/entity/static.d.ts +3 -0
  37. package/dist/types/packages/node/storage/entity/static.d.ts.map +1 -0
  38. package/dist/types/packages/node/storage/entity/types.d.ts +114 -0
  39. package/dist/types/packages/node/storage/entity/types.d.ts.map +1 -0
  40. package/dist/types/packages/node/storage/entity/where/consts.d.ts +11 -0
  41. package/dist/types/packages/node/storage/entity/where/consts.d.ts.map +1 -0
  42. package/dist/types/packages/node/storage/entity/where/index.d.ts +50 -0
  43. package/dist/types/packages/node/storage/entity/where/index.d.ts.map +1 -0
  44. package/dist/types/packages/node/storage/entity/where/types.d.ts +13 -0
  45. package/dist/types/packages/node/storage/entity/where/types.d.ts.map +1 -0
  46. package/dist/types/packages/node/storage/index.d.ts +5 -0
  47. package/dist/types/packages/node/storage/index.d.ts.map +1 -0
  48. package/dist/types/packages/node/storage/object/error/consts.d.ts +20 -0
  49. package/dist/types/packages/node/storage/object/error/consts.d.ts.map +1 -0
  50. package/dist/types/packages/node/storage/object/error/index.d.ts +22 -0
  51. package/dist/types/packages/node/storage/object/error/index.d.ts.map +1 -0
  52. package/dist/types/packages/node/storage/object/error/types.d.ts +4 -0
  53. package/dist/types/packages/node/storage/object/error/types.d.ts.map +1 -0
  54. package/dist/types/packages/node/storage/object/fetch/index.d.ts +7 -0
  55. package/dist/types/packages/node/storage/object/fetch/index.d.ts.map +1 -0
  56. package/dist/types/packages/node/storage/object/fetch/types.d.ts +34 -0
  57. package/dist/types/packages/node/storage/object/fetch/types.d.ts.map +1 -0
  58. package/dist/types/packages/node/storage/object/index.d.ts +17 -0
  59. package/dist/types/packages/node/storage/object/index.d.ts.map +1 -0
  60. package/dist/types/packages/node/storage/object/result/index.d.ts +2 -0
  61. package/dist/types/packages/node/storage/object/result/index.d.ts.map +1 -0
  62. package/dist/types/packages/node/storage/object/result/types.d.ts +31 -0
  63. package/dist/types/packages/node/storage/object/result/types.d.ts.map +1 -0
  64. package/dist/types/packages/node/storage/object/types.d.ts +66 -0
  65. package/dist/types/packages/node/storage/object/types.d.ts.map +1 -0
  66. package/dist/types/packages/strict/common/index.d.ts +2 -0
  67. package/dist/types/packages/strict/common/index.d.ts.map +1 -0
  68. package/dist/types/packages/strict/common/types.d.ts +6 -0
  69. package/dist/types/packages/strict/common/types.d.ts.map +1 -0
  70. package/dist/types/packages/strict/env/index.d.ts +35 -0
  71. package/dist/types/packages/strict/env/index.d.ts.map +1 -0
  72. package/dist/types/packages/strict/error/consts.d.ts +5 -0
  73. package/dist/types/packages/strict/error/consts.d.ts.map +1 -0
  74. package/dist/types/packages/strict/error/index.d.ts +2 -0
  75. package/dist/types/packages/strict/error/index.d.ts.map +1 -0
  76. package/dist/types/packages/strict/fetch/index.d.ts +4 -0
  77. package/dist/types/packages/strict/fetch/index.d.ts.map +1 -0
  78. package/dist/types/packages/strict/result/index.d.ts +8 -0
  79. package/dist/types/packages/strict/result/index.d.ts.map +1 -0
  80. package/dist/types/packages/strict/result/types.d.ts +31 -0
  81. package/dist/types/packages/strict/result/types.d.ts.map +1 -0
  82. package/package.json +12 -2
@@ -0,0 +1,114 @@
1
+ import type { FindGlobalType, EmptyObject, Get, IfNever } from 'type-fest';
2
+ import type { EntitySortEnum } from './sort';
3
+ import type { EntityErrorCode } from './error';
4
+ import type { WhereConditions } from './where';
5
+ import type { Entity, BaseEntityStruct, BaseIndexesStruct } from './entity';
6
+ import type { defaultEntityQueryCursor, defaultEntityQueryIndex, defaultEntityQueryLimit, defaultEntityQuerySort, defaultEntityQueryWhere } from './query';
7
+ export interface EntityStatic {
8
+ /**
9
+ * @description 实体排序枚举
10
+ */
11
+ Sort: typeof EntitySortEnum;
12
+ /**
13
+ * @description 实体错误码枚举
14
+ */
15
+ EntityErrorCode: typeof EntityErrorCode;
16
+ /**
17
+ * @description 实体查询条件方法枚举
18
+ */
19
+ WhereConditions: typeof WhereConditions;
20
+ /**
21
+ * @description 实体查询游标默认值
22
+ */
23
+ defaultEntityQueryCursor: typeof defaultEntityQueryCursor;
24
+ /**
25
+ * @description 实体查询索引默认值
26
+ */
27
+ defaultEntityQueryIndex: typeof defaultEntityQueryIndex;
28
+ /**
29
+ * @description 实体查询长度默认值
30
+ */
31
+ defaultEntityQueryLimit: typeof defaultEntityQueryLimit;
32
+ /**
33
+ * @description 实体查询排序默认值
34
+ */
35
+ defaultEntityQuerySort: typeof defaultEntityQuerySort;
36
+ /**
37
+ * @description 实体查询条件默认值
38
+ */
39
+ defaultEntityQueryWhere: typeof defaultEntityQueryWhere;
40
+ }
41
+ /**
42
+ * @description 编译时自动生成
43
+ * @example
44
+ * declare global {
45
+ * var ONESEntities: {
46
+ * entityName: {
47
+ * attributes: {
48
+ * number: number
49
+ * string: string
50
+ * boolean: boolean
51
+ * }
52
+ * indexes: {
53
+ * normal: null
54
+ * partitions: [number, string, boolean]
55
+ * }
56
+ * }
57
+ * }
58
+ * }
59
+ */
60
+ type PluginEntities = FindGlobalType<'ONESEntities'>;
61
+ export interface BaseEntityFactory {
62
+ /**
63
+ * @function EntityFactory
64
+ * @description 创建实体操作对象
65
+ * @typedef EntityStruct 实体数据结构体
66
+ * @typedef IndexesStruct 实体索引结构体
67
+ * @param entityName 实体名称
68
+ * @returns Entity
69
+ */
70
+ <EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>>(entityName: string): Entity<EntityStruct, IndexesStruct>;
71
+ /**
72
+ * @function EntityFactory
73
+ * @description 创建实体操作对象
74
+ * @typedef EntityStruct 实体数据结构体
75
+ * @typedef IndexesStruct 实体索引结构体
76
+ * @param entityName 实体名称
77
+ * @returns Entity
78
+ */
79
+ <EntityStruct extends BaseEntityStruct<EntityStruct>>(entityName: string): Entity<EntityStruct, EmptyObject>;
80
+ }
81
+ export interface PluginEntityFactory {
82
+ /**
83
+ * @function EntityFactory
84
+ * @description 创建实体操作对象
85
+ * @typedef EntityStruct 实体数据结构体
86
+ * @typedef IndexesStruct 实体索引结构体
87
+ * @param entityName 实体名称
88
+ * @returns Entity
89
+ */
90
+ <EntityName extends keyof PluginEntities>(entityName: EntityName): Entity<Get<PluginEntities, Exclude<EntityName, number | symbol>>['attributes'], Get<PluginEntities, Exclude<EntityName, number | symbol>>['indexes']>;
91
+ /**
92
+ * @function EntityFactory
93
+ * @description 创建实体操作对象
94
+ * @typedef EntityStruct 实体数据结构体
95
+ * @typedef IndexesStruct 实体索引结构体
96
+ * @param entityName 实体名称
97
+ * @returns Entity
98
+ */
99
+ <EntityStruct extends BaseEntityStruct<EntityStruct>, IndexesStruct extends BaseIndexesStruct<IndexesStruct>>(entityName: string): Entity<EntityStruct, IndexesStruct>;
100
+ /**
101
+ * @function EntityFactory
102
+ * @description 创建实体操作对象
103
+ * @typedef EntityStruct 实体数据结构体
104
+ * @typedef IndexesStruct 实体索引结构体
105
+ * @param entityName 实体名称
106
+ * @returns Entity
107
+ */
108
+ <EntityStruct extends BaseEntityStruct<EntityStruct>>(entityName: string): Entity<EntityStruct, EmptyObject>;
109
+ }
110
+ export type EntityFactory = IfNever<PluginEntities, BaseEntityFactory, PluginEntityFactory>;
111
+ export interface EntityDefault extends EntityFactory, EntityStatic {
112
+ }
113
+ export {};
114
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/packages/node/storage/entity/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC3E,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,OAAO,cAAc,CAAA;IAC3B;;OAEG;IACH,eAAe,EAAE,OAAO,eAAe,CAAA;IACvC;;OAEG;IACH,eAAe,EAAE,OAAO,eAAe,CAAA;IACvC;;OAEG;IACH,wBAAwB,EAAE,OAAO,wBAAwB,CAAA;IACzD;;OAEG;IACH,uBAAuB,EAAE,OAAO,uBAAuB,CAAA;IACvD;;OAEG;IACH,uBAAuB,EAAE,OAAO,uBAAuB,CAAA;IACvD;;OAEG;IACH,sBAAsB,EAAE,OAAO,sBAAsB,CAAA;IACrD;;OAEG;IACH,uBAAuB,EAAE,OAAO,uBAAuB,CAAA;CACxD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,KAAK,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,CAAA;AAEpD,MAAM,WAAW,iBAAiB;IAChC;;;;;;;OAOG;IACH,CACE,YAAY,SAAS,gBAAgB,CAAC,YAAY,CAAC,EACnD,aAAa,SAAS,iBAAiB,CAAC,aAAa,CAAC,EAEtD,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;IACtC;;;;;;;OAOG;IACH,CAAC,YAAY,SAAS,gBAAgB,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,CAAC,UAAU,SAAS,MAAM,cAAc,EACtC,UAAU,EAAE,UAAU,GACrB,MAAM,CACP,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,EACvE,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CACrE,CAAA;IACD;;;;;;;OAOG;IACH,CACE,YAAY,SAAS,gBAAgB,CAAC,YAAY,CAAC,EACnD,aAAa,SAAS,iBAAiB,CAAC,aAAa,CAAC,EAEtD,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;IACtC;;;;;;;OAOG;IACH,CAAC,YAAY,SAAS,gBAAgB,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;CACrC;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAA;AAE3F,MAAM,WAAW,aAAc,SAAQ,aAAa,EAAE,YAAY;CAAG"}
@@ -0,0 +1,11 @@
1
+ export declare enum EntityWhereConditionEnum {
2
+ beginsWith = "beginsWith",
3
+ between = "between",
4
+ equalTo = "equalTo",
5
+ greaterThan = "greaterThan",
6
+ lessThan = "lessThan",
7
+ greaterThanEqualTo = "greaterThanEqualTo",
8
+ lessThanEqualTo = "lessThanEqualTo",
9
+ containsAny = "containsAny"
10
+ }
11
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/entity/where/consts.ts"],"names":[],"mappings":"AACA,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;CAC5B"}
@@ -0,0 +1,50 @@
1
+ import type { EntityWhereConditionStringFunc, EntityWhereConditionStringOrNumberFunc, EntityWhereConditionStringOrNumberOrBooleanFunc, EntityWhereConditionBetweenFunc, EntityWhereConditionArgsFunc } from './types';
2
+ export * from './consts';
3
+ export * from './types';
4
+ /**
5
+ * @constant WhereConditions
6
+ * @description 实体查询条件方法枚举
7
+ */
8
+ export declare const WhereConditions: {
9
+ /**
10
+ * @description beginsWith
11
+ * @returns EntityWhereCondition
12
+ */
13
+ beginsWith: EntityWhereConditionStringFunc;
14
+ /**
15
+ * @description between
16
+ * @returns EntityWhereCondition
17
+ */
18
+ between: EntityWhereConditionBetweenFunc;
19
+ /**
20
+ * @description equalTo
21
+ * @returns EntityWhereCondition
22
+ */
23
+ equalTo: EntityWhereConditionStringOrNumberOrBooleanFunc;
24
+ /**
25
+ * @description greaterThan
26
+ * @returns EntityWhereCondition
27
+ */
28
+ greaterThan: EntityWhereConditionStringOrNumberFunc;
29
+ /**
30
+ * @description lessThan
31
+ * @returns EntityWhereCondition
32
+ */
33
+ lessThan: EntityWhereConditionStringOrNumberFunc;
34
+ /**
35
+ * @description greaterThanEqualTo
36
+ * @returns EntityWhereCondition
37
+ */
38
+ greaterThanEqualTo: EntityWhereConditionStringOrNumberFunc;
39
+ /**
40
+ * @description lessThanEqualTo
41
+ * @returns EntityWhereCondition
42
+ */
43
+ lessThanEqualTo: EntityWhereConditionStringOrNumberFunc;
44
+ /**
45
+ * @description containsAny
46
+ * @returns EntityWhereCondition
47
+ */
48
+ containsAny: EntityWhereConditionArgsFunc;
49
+ };
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/entity/where/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,8BAA8B,EAC9B,sCAAsC,EACtC,+CAA+C,EAC/C,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,SAAS,CAAA;AAEhB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B;;;OAGG;;IAMH;;;OAGG;;IAMH;;;OAGG;;IAMH;;;OAGG;;IAMH;;;OAGG;;IAMH;;;OAGG;;IAQH;;;OAGG;;IAMH;;;OAGG;;CAMJ,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { StringOrNumber, StringOrNumberOrBoolean } from '../../../../../packages/strict/common';
2
+ import type { EntityWhereConditionEnum } from './consts';
3
+ export type EntityWhereCondition = Partial<Record<EntityWhereConditionEnum, StringOrNumberOrBoolean[]>>;
4
+ export type EntityWhereConditionStringFunc = (value: string) => EntityWhereCondition;
5
+ export type EntityWhereConditionStringOrNumberFunc = (value: StringOrNumber) => EntityWhereCondition;
6
+ export type EntityWhereConditionStringOrNumberOrBooleanFunc = (value: StringOrNumberOrBoolean) => EntityWhereCondition;
7
+ export type EntityWhereConditionBetweenFunc = (min: StringOrNumber, max: StringOrNumber) => EntityWhereCondition;
8
+ export interface EntityWhereConditionArgsFunc {
9
+ (...args: number[]): EntityWhereCondition;
10
+ (...args: string[]): EntityWhereCondition;
11
+ (...args: boolean[]): EntityWhereCondition;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/entity/where/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AACvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAGxD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,MAAM,CAAC,wBAAwB,EAAE,uBAAuB,EAAE,CAAC,CAC5D,CAAA;AAGD,MAAM,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAA;AACpF,MAAM,MAAM,sCAAsC,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,oBAAoB,CAAA;AACpG,MAAM,MAAM,+CAA+C,GAAG,CAC5D,KAAK,EAAE,uBAAuB,KAC3B,oBAAoB,CAAA;AACzB,MAAM,MAAM,+BAA+B,GAAG,CAC5C,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,cAAc,KAChB,oBAAoB,CAAA;AACzB,MAAM,WAAW,4BAA4B;IAC3C,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAA;IACzC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAA;IACzC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAA;CAC3C"}
@@ -0,0 +1,5 @@
1
+ export { entity } from './entity';
2
+ export { object } from './object';
3
+ export type * from './entity';
4
+ export type * from './object';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/node/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,UAAU,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @enum ObjectErrorCode
3
+ * @description 对象存储错误码枚举
4
+ */
5
+ export declare enum ObjectErrorCode {
6
+ /**
7
+ * @description 对象存储 key 为空/包含非法字符/超出最大长度限制
8
+ * @satisfies /^[0-9a-zA-Z!_.*'()-]{1,128}$/
9
+ */
10
+ ObjectKeyInvalid = "ObjectKeyInvalid",
11
+ /**
12
+ * @description 对象存储 key 不存在
13
+ */
14
+ ObjectKeyNotfound = "ObjectKeyNotfound",
15
+ /**
16
+ * @description 请求超时
17
+ */
18
+ RequestTimeOut = "RequestTimeOut"
19
+ }
20
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/error/consts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB;;;OAGG;IACH,gBAAgB,qBAAqB;IACrC;;OAEG;IACH,iBAAiB,sBAAsB;IACvC;;OAEG;IACH,cAAc,mBAAmB;CAClC"}
@@ -0,0 +1,22 @@
1
+ import type { ObjectErrorResult } from './types';
2
+ export * from './consts';
3
+ export * from './types';
4
+ /**
5
+ * @description 对象存储操作错误对象
6
+ */
7
+ export declare class ObjectError implements ObjectErrorResult {
8
+ /**
9
+ * @description 错误码枚举
10
+ */
11
+ code: import("../../..").ErrorCode | import("./consts").ObjectErrorCode;
12
+ /**
13
+ * @description 错误文案
14
+ */
15
+ err_msg: string;
16
+ /**
17
+ * @description 错误载荷
18
+ */
19
+ err_values: Record<string, any> | undefined;
20
+ constructor(result: ObjectErrorResult);
21
+ }
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB;;GAEG;AACH,qBAAa,WAAY,YAAW,iBAAiB;IACnD;;OAEG;IACH,IAAI,oEAAA;IACJ;;OAEG;IACH,OAAO,SAAK;IACZ;;OAEG;IACH,UAAU,kCAAA;gBACE,MAAM,EAAE,iBAAiB;CAKtC"}
@@ -0,0 +1,4 @@
1
+ import type { ErrorResult } from '../../../../../packages/strict/result';
2
+ import type { ObjectErrorCode } from './consts';
3
+ export type ObjectErrorResult = ErrorResult<never, ObjectErrorCode>;
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ObjectFetchUploadCall, ObjectFetchDownloadCall, ObjectFetchDeleteCall, ObjectFetchMetadataCall } from './types';
2
+ export * from './types';
3
+ export declare const fetchUpload: ObjectFetchUploadCall;
4
+ export declare const fetchDownload: ObjectFetchDownloadCall;
5
+ export declare const fetchDelete: ObjectFetchDeleteCall;
6
+ export declare const fetchMetadata: ObjectFetchMetadataCall;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/fetch/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGV,qBAAqB,EAErB,uBAAuB,EAEvB,qBAAqB,EAErB,uBAAuB,EAExB,MAAM,SAAS,CAAA;AAEhB,cAAc,SAAS,CAAA;AAyCvB,eAAO,MAAM,WAAW,EAAE,qBAKzB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,uBAK3B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,qBAKzB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,uBAK3B,CAAA"}
@@ -0,0 +1,34 @@
1
+ import type { ErrorCode } from '../../../../../packages/strict/error';
2
+ import type { ErrorResult } from '../../../../../packages/strict/result';
3
+ import type { ObjectErrorResult } from '../../../../../packages/node/storage/object/error';
4
+ import type { ObjectUploadResult, ObjectDownloadResult, ObjectDeleteResult, ObjectMetadataResult } from '../../../../../packages/node/storage/object/result';
5
+ export interface ObjectFetchBaseParams {
6
+ instance_id: string;
7
+ }
8
+ export interface ObjectFetchCommonParams {
9
+ object_key: string;
10
+ }
11
+ export interface ObjectFetchUploadParams extends ObjectFetchCommonParams {
12
+ }
13
+ export interface ObjectFetchDownloadParams extends ObjectFetchCommonParams {
14
+ }
15
+ export interface ObjectFetchDeleteParams extends ObjectFetchCommonParams {
16
+ }
17
+ export interface ObjectFetchMetadataParams extends ObjectFetchCommonParams {
18
+ }
19
+ export interface ObjectFetchBaseCall {
20
+ <BaseParams, BaseResult>(path: string, params: BaseParams): Promise<BaseResult | ObjectErrorResult | ErrorResult<never, ErrorCode>>;
21
+ }
22
+ export interface ObjectFetchUploadCall {
23
+ (params: ObjectFetchUploadParams): Promise<ObjectUploadResult>;
24
+ }
25
+ export interface ObjectFetchDownloadCall {
26
+ (params: ObjectFetchDownloadParams): Promise<ObjectDownloadResult>;
27
+ }
28
+ export interface ObjectFetchDeleteCall {
29
+ (params: ObjectFetchDeleteParams): Promise<ObjectDeleteResult>;
30
+ }
31
+ export interface ObjectFetchMetadataCall {
32
+ (params: ObjectFetchMetadataParams): Promise<ObjectMetadataResult>;
33
+ }
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/fetch/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,uCAAuC,CAAA;AAE9C,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;CAAG;AAC3E,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;CAAG;AAC7E,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;CAAG;AAC3E,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;CAAG;AAE7E,MAAM,WAAW,mBAAmB;IAClC,CAAC,UAAU,EAAE,UAAU,EACrB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,UAAU,GAAG,iBAAiB,GAAG,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAA;CAC3E;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAC/D;AAED,MAAM,WAAW,uBAAuB;IACtC,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;CACnE;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAC/D;AAED,MAAM,WAAW,uBAAuB;IACtC,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;CACnE"}
@@ -0,0 +1,17 @@
1
+ import type { ObjectStore } from './types';
2
+ export type * from './error';
3
+ export type * from './fetch';
4
+ export type * from './result';
5
+ export type * from './types';
6
+ /**
7
+ * @constant object
8
+ * @description 对象存储
9
+ * @member ObjectError
10
+ * @member ObjectErrorCode
11
+ * @member upload
12
+ * @member download
13
+ * @member delete
14
+ * @member metadata
15
+ */
16
+ export declare const object: ObjectStore;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/packages/node/storage/object/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,mBAAmB,SAAS,CAAA;AAC5B,mBAAmB,SAAS,CAAA;AAC5B,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,SAAS,CAAA;AAE5B;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,WA6EpB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/result/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
@@ -0,0 +1,31 @@
1
+ import type { Result } from '../../../../../packages/strict/result';
2
+ import type { ObjectErrorCode } from '../../../../../packages/node/storage/object/error';
3
+ export type ObjectResult<Data> = Result<Data, ObjectErrorCode>;
4
+ export type ObjectResultDataFields = Record<string, string>;
5
+ export interface ObjectResultDataUrl {
6
+ internal: string;
7
+ outbound: string;
8
+ }
9
+ export type ObjectUploadResult = ObjectResult<{
10
+ fields: ObjectResultDataFields;
11
+ url: ObjectResultDataUrl;
12
+ }>;
13
+ export type ObjectDownloadResult = ObjectResult<{
14
+ url: ObjectResultDataUrl;
15
+ }>;
16
+ export type ObjectDeleteResult = ObjectResult<never>;
17
+ /**
18
+ * @description 对象的元信息的结果对象
19
+ */
20
+ export interface ObjectMetadataResultData {
21
+ /**
22
+ * @description 对象存储 key
23
+ */
24
+ object_key: string;
25
+ /**
26
+ * @description 文件大小,字节
27
+ */
28
+ size: number;
29
+ }
30
+ export type ObjectMetadataResult = ObjectResult<ObjectMetadataResultData>;
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/result/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAE3E,MAAM,MAAM,YAAY,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAA;AAE9D,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;IAC5C,MAAM,EAAE,sBAAsB,CAAA;IAC9B,GAAG,EAAE,mBAAmB,CAAA;CACzB,CAAC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC;IAC9C,GAAG,EAAE,mBAAmB,CAAA;CACzB,CAAC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,wBAAwB,CAAC,CAAA"}
@@ -0,0 +1,66 @@
1
+ import type { ObjectError, ObjectErrorCode } from './error';
2
+ import type { ObjectResultDataFields, ObjectMetadataResultData } from './result';
3
+ /**
4
+ * @description 获取上传信息的操作对象
5
+ */
6
+ export interface ObjectStoreUploadResult {
7
+ /**
8
+ * @description 获取上传地址(需要在插件后端请求)
9
+ */
10
+ getUrl(): string;
11
+ /**
12
+ * @description 获取上传地址(适合在浏览器中请求)
13
+ */
14
+ getWebUrl(): string;
15
+ /**
16
+ * @description 获取请求的 FormData 参数
17
+ */
18
+ getFields(): ObjectResultDataFields;
19
+ }
20
+ /**
21
+ * @description 获取下载信息的操作对象
22
+ */
23
+ export interface ObjectStoreDownloadResult {
24
+ /**
25
+ * @description 获取下载地址(需要在插件后端请求)
26
+ */
27
+ getUrl(): string;
28
+ /**
29
+ * @description 获取下载地址(适合在浏览器中请求)
30
+ */
31
+ getWebUrl(): string;
32
+ }
33
+ export interface ObjectStore {
34
+ /**
35
+ * @description 对象存储操作错误对象
36
+ */
37
+ ObjectError: typeof ObjectError;
38
+ /**
39
+ * @description 对象存储错误码枚举
40
+ */
41
+ ObjectErrorCode: typeof ObjectErrorCode;
42
+ /**
43
+ * @description 上传一个对象
44
+ * @param key 对象存储 key
45
+ * @returns ObjectStoreUploadResult
46
+ */
47
+ upload(key: string): Promise<ObjectStoreUploadResult | ObjectError>;
48
+ /**
49
+ * @description 下载一个对象
50
+ * @param key 对象存储 key
51
+ * @returns ObjectStoreDownloadResult
52
+ */
53
+ download(key: string): Promise<ObjectStoreDownloadResult | ObjectError>;
54
+ /**
55
+ * @description 删除一个对象
56
+ * @param key 对象存储 key
57
+ */
58
+ delete(key: string): Promise<void | ObjectError>;
59
+ /**
60
+ * @description 获取一个对象的元信息
61
+ * @param key 对象存储 key
62
+ * @returns ObjectMetadataResultData
63
+ */
64
+ metadata(key: string): Promise<ObjectMetadataResultData | ObjectError>;
65
+ }
66
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/packages/node/storage/object/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAEhF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,IAAI,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,IAAI,MAAM,CAAA;IACnB;;OAEG;IACH,SAAS,IAAI,sBAAsB,CAAA;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,IAAI,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,IAAI,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,WAAW,EAAE,OAAO,WAAW,CAAA;IAC/B;;OAEG;IACH,eAAe,EAAE,OAAO,eAAe,CAAA;IACvC;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,WAAW,CAAC,CAAA;IACnE;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,GAAG,WAAW,CAAC,CAAA;IACvE;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,CAAA;IAChD;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAA;CACvE"}
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { IsEqual } from 'type-fest';
2
+ export type StringOrNumber = string | number;
3
+ export type StringOrNumberOrBoolean = StringOrNumber | boolean;
4
+ export type NotEmptyString<Value extends string> = IsEqual<Value, ''> extends true ? never : Value;
5
+ export type NotEmptyArray<Value extends unknown[]> = Value extends never[] ? never : Value;
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAC5C,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,OAAO,CAAA;AAC9D,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,KAAK,CAAA;AAClG,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,OAAO,EAAE,IAAI,KAAK,SAAS,KAAK,EAAE,GAAG,KAAK,GAAG,KAAK,CAAA"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @description 获取开放平台 host
3
+ * @alias getPlatformApiHost
4
+ * @alias getPlatformAPIHost
5
+ * @returns platformApiHost
6
+ */
7
+ export declare const getPlatformApiHost: () => string;
8
+ /**
9
+ * @description 获取开放平台 host
10
+ * @alias getPlatformApiHost
11
+ * @alias getPlatformAPIHost
12
+ * @returns platformApiHost
13
+ */
14
+ export declare const getPlatformAPIHost: () => string;
15
+ /**
16
+ * @description 获取插件实例 ID
17
+ * @alias getInstanceId
18
+ * @returns instanceId
19
+ */
20
+ export declare const getInstanceId: () => string;
21
+ /**
22
+ * @description 获取插件 ID
23
+ * @alias getApplicationId
24
+ * @alias getAppId
25
+ * @returns applicationId
26
+ */
27
+ export declare const getApplicationId: () => string;
28
+ /**
29
+ * @description 获取插件 ID
30
+ * @alias getApplicationId
31
+ * @alias getAppId
32
+ * @returns applicationId
33
+ */
34
+ export declare const getAppId: () => string;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/env/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,cAE9B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,cAAqB,CAAA;AAEpD;;;;GAIG;AACH,eAAO,MAAM,aAAa,cAEzB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,cAE5B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,cAAmB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare enum ErrorCode {
2
+ ServerError = "ServerError",
3
+ UnknownError = "UnknownError"
4
+ }
5
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/error/consts.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export * from './consts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { default as Fetch } from 'axios';
2
+ export { AxiosError as FetchError } from 'axios';
3
+ export type { AxiosRequestConfig as FetchConfig, AxiosResponse as FetchResponse } from 'axios';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/fetch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,MAAM,OAAO,CAAA;AAChD,YAAY,EAAE,kBAAkB,IAAI,WAAW,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,OAAO,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { ErrorCode } from '../../../packages/strict/error';
2
+ import type { ErrorResult } from './types';
3
+ export * from './types';
4
+ export declare const createErrorResult: <Code = ErrorCode, Result = Partial<ErrorResult<never, Code>>>(code: Code, message: any, error?: Result | undefined) => Result & {
5
+ code: Code;
6
+ err_msg: string;
7
+ };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/result/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,cAAc,SAAS,CAAA;AAEvB,eAAO,MAAM,iBAAiB,sFAEnB,GAAG;;aAMC,MAAM;CAUpB,CAAA"}
@@ -0,0 +1,31 @@
1
+ import type { ErrorCode } from '../../../packages/strict/error';
2
+ export interface SuccessResult<Data> {
3
+ /**
4
+ * @description 请求成功
5
+ */
6
+ code: 'OK';
7
+ /**
8
+ * @description 请求响应体
9
+ */
10
+ data?: Data;
11
+ }
12
+ export interface ErrorResult<Data, Code> {
13
+ /**
14
+ * @description 错误码枚举
15
+ */
16
+ code: Code | ErrorCode;
17
+ /**
18
+ * @description 请求响应体
19
+ */
20
+ data?: Data;
21
+ /**
22
+ * @description 错误文案
23
+ */
24
+ err_msg: string;
25
+ /**
26
+ * @description 错误载荷
27
+ */
28
+ err_values?: Record<string, any>;
29
+ }
30
+ export type Result<Data, Code> = SuccessResult<Data> | ErrorResult<Data, Code>;
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/result/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,aAAa,CAAC,IAAI;IACjC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IACV;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AAED,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,IAAI;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACjC;AAED,MAAM,MAAM,MAAM,CAAC,IAAI,EAAE,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-open/node-sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -40,5 +40,15 @@
40
40
  "publishConfig": {
41
41
  "registry": "https://registry.npmjs.org",
42
42
  "access": "public"
43
- }
43
+ },
44
+ "dependencies": {
45
+ "@babel/runtime-corejs3": "~7.26.10",
46
+ "axios": "1.13.2",
47
+ "lodash-es": "^4.17.21",
48
+ "type-fest": "4.41.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/lodash-es": "^4.17.12"
52
+ },
53
+ "gitHead": "0db71cc49790a372abd7e85daa6c6b0cefe7b175"
44
54
  }