@hedia/types 2.1.49-alpha.0 → 2.1.49-alpha.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../types/activity/activity.ts"],"names":[],"mappings":";;;AAAA,IAAiB,QAAQ,CAyExB;AAzED,WAAiB,QAAQ;IAiDxB,IAAiB,KAAK,CAuBrB;IAvBD,WAAiB,KAAK;QACrB,sHAAsH;QACtH,IAAY,0BAIX;QAJD,WAAY,0BAA0B;YACrC,mDAAqB,CAAA;YACrB,uDAAyB,CAAA;YACzB,2DAA6B,CAAA;QAC9B,CAAC,EAJW,0BAA0B,GAA1B,gCAA0B,KAA1B,gCAA0B,QAIrC;QAED,8EAA8E;QAC9E,IAAY,iBAIX;QAJD,WAAY,iBAAiB;YAC5B,oCAAe,CAAA;YACf,0CAAqB,CAAA;YACrB,kCAAa,CAAA;QACd,CAAC,EAJW,iBAAiB,GAAjB,uBAAiB,KAAjB,uBAAiB,QAI5B;QAED,iFAAiF;QACjF,IAAY,YAMX;QAND,WAAY,YAAY;YACvB,2BAAW,CAAA;YACX,6BAAa,CAAA;YACb,mCAAmB,CAAA;YACnB,6BAAa,CAAA;YACb,+BAAe,CAAA;QAChB,CAAC,EANW,YAAY,GAAZ,kBAAY,KAAZ,kBAAY,QAMvB;IACF,CAAC,EAvBgB,KAAK,GAAL,cAAK,KAAL,cAAK,QAuBrB;AACF,CAAC,EAzEgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAyExB"}
1
+ {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../types/activity/activity.ts"],"names":[],"mappings":";;;AAAA,IAAiB,QAAQ,CA2ExB;AA3ED,WAAiB,QAAQ;IAmDxB,IAAiB,KAAK,CAuBrB;IAvBD,WAAiB,KAAK;QACrB,sHAAsH;QACtH,IAAY,0BAIX;QAJD,WAAY,0BAA0B;YACrC,mDAAqB,CAAA;YACrB,uDAAyB,CAAA;YACzB,2DAA6B,CAAA;QAC9B,CAAC,EAJW,0BAA0B,GAA1B,gCAA0B,KAA1B,gCAA0B,QAIrC;QAED,8EAA8E;QAC9E,IAAY,iBAIX;QAJD,WAAY,iBAAiB;YAC5B,oCAAe,CAAA;YACf,0CAAqB,CAAA;YACrB,kCAAa,CAAA;QACd,CAAC,EAJW,iBAAiB,GAAjB,uBAAiB,KAAjB,uBAAiB,QAI5B;QAED,iFAAiF;QACjF,IAAY,YAMX;QAND,WAAY,YAAY;YACvB,2BAAW,CAAA;YACX,6BAAa,CAAA;YACb,mCAAmB,CAAA;YACnB,6BAAa,CAAA;YACb,+BAAe,CAAA;QAChB,CAAC,EANW,YAAY,GAAZ,kBAAY,KAAZ,kBAAY,QAMvB;IACF,CAAC,EAvBgB,KAAK,GAAL,cAAK,KAAL,cAAK,QAuBrB;AACF,CAAC,EA3EgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA2ExB"}
@@ -5,24 +5,25 @@ export declare namespace LogbookService {
5
5
  oldUUID: string;
6
6
  newUUID: string;
7
7
  }
8
- export interface ILogbookSyncRequest {
9
- lastSyncTimestamp: string;
8
+ interface ICursor {
9
+ created?: ICreatedCursor;
10
+ deleted?: string;
11
+ }
12
+ interface ICreatedCursor {
13
+ cursor: string;
14
+ hasMore: boolean;
15
+ }
16
+ export interface ILogbookServiceRequest {
17
+ cursor?: ICursor;
10
18
  created: Array<Logbook.Types.ILogbookEntry>;
11
19
  edited: Array<IEditedUUID>;
12
20
  deleted: Array<string>;
13
21
  }
14
- export interface ILogbookSyncResponse {
15
- lastSyncTimestamp: string;
22
+ export interface ILogbookServiceResponse {
23
+ cursor?: ICursor;
16
24
  created: Array<Logbook.Types.ILogbookEntry>;
17
25
  deleted: Array<string>;
18
26
  }
19
- export interface ILogbookGetRequest {
20
- cursor?: string;
21
- }
22
- export interface ILogbookGetResponse {
23
- cursor?: string;
24
- logbooks: Array<Logbook.Types.ILogbookEntry>;
25
- }
26
27
  export {};
27
28
  }
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "2.1.49-alpha.0",
3
+ "version": "2.1.49-alpha.2",
4
4
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -8,15 +8,20 @@
8
8
  "url": "git+ssh://git@github.com:hedia-team/hedia-types.git"
9
9
  },
10
10
  "scripts": {
11
- "tsc": "tsc --build",
12
11
  "clean": "tsc --build --clean",
13
- "postpublish": "npm run clean"
12
+ "lint": "tslint --project .",
13
+ "postpublish": "npm run clean",
14
+ "prettier": "prettier --check \"types/**/*.{ts,tsx}\"",
15
+ "tsc": "tsc --build"
14
16
  },
15
17
  "keywords": [],
16
18
  "author": "Hedia",
17
19
  "license": "ISC",
18
20
  "homepage": "https://github.com/hedia-team/hedia-types#readme",
19
21
  "devDependencies": {
22
+ "prettier": "^2.4.1",
23
+ "tslint": "^6.1.3",
24
+ "tslint-config-prettier": "^1.18.0",
20
25
  "typescript": "4.1.5"
21
26
  }
22
27
  }
package/tslint.json ADDED
@@ -0,0 +1,181 @@
1
+ {
2
+ "defaultSeverity": "error",
3
+ "extends": ["tslint:recommended", "tslint-config-prettier"],
4
+ "rules": {
5
+ "adjacent-overload-signatures": true,
6
+ "align": true,
7
+ "array-type": [true, "generic"],
8
+ "arrow-parens": true,
9
+ "arrow-return-shorthand": true,
10
+ "await-promise": [true, "Bluebird"],
11
+ "ban": false,
12
+ "ban-comma-operator": true,
13
+ "ban-types": false,
14
+ "binary-expression-operand-order": true,
15
+ "callable-types": true,
16
+ "class-name": true,
17
+ "comment-format": true,
18
+ "completed-docs": false,
19
+ "curly": true,
20
+ "cyclomatic-complexity": false,
21
+ "deprecation": false,
22
+ "encoding": true,
23
+ "eofline": true,
24
+ "file-header": false,
25
+ "file-name-casing": [false, "pascal-case"],
26
+ "forin": true,
27
+ "import-blacklist": false,
28
+ "import-spacing": true,
29
+ "indent": [true, "tabs", 4],
30
+ "interface-name": true,
31
+ "interface-over-type-literal": true,
32
+ "jsdoc-format": false,
33
+ "label-position": true,
34
+ "linebreak-style": [true, "LF"],
35
+ "match-default-export-name": true,
36
+ "max-classes-per-file": false,
37
+ "max-file-line-count": false,
38
+ "max-line-length": [true, { "limit": 120, "ignore-pattern": "// |^(\\s*)\\* |^(\\s*)\\/*" }],
39
+ "member-access": true,
40
+ "member-ordering": [
41
+ true,
42
+ {
43
+ "order": [
44
+ "public-static-field",
45
+ "protected-static-field",
46
+ "private-static-field",
47
+ "public-instance-field",
48
+ "protected-instance-field",
49
+ "private-instance-field",
50
+ "public-constructor",
51
+ "protected-constructor",
52
+ "private-constructor",
53
+ "public-instance-method",
54
+ "protected-instance-method",
55
+ "private-instance-method",
56
+ "public-static-method",
57
+ "protected-static-method",
58
+ "private-static-method"
59
+ ]
60
+ }
61
+ ],
62
+ "new-parens": true,
63
+ "newline-before-return": false,
64
+ "newline-per-chained-call": false,
65
+ "no-angle-bracket-type-assertion": false,
66
+ "no-any": true,
67
+ "no-arg": true,
68
+ "no-bitwise": false,
69
+ "no-boolean-literal-compare": true,
70
+ "no-conditional-assignment": false,
71
+ "no-consecutive-blank-lines": true,
72
+ "no-console": [true, "log"],
73
+ "no-construct": true,
74
+ "no-debugger": false,
75
+ "no-default-export": false,
76
+ "no-duplicate-imports": true,
77
+ "no-duplicate-super": true,
78
+ "no-duplicate-switch-case": true,
79
+ "no-duplicate-variable": true,
80
+ "no-dynamic-delete": false,
81
+ "no-empty": true,
82
+ "no-empty-interface": true,
83
+ "no-eval": true,
84
+ "no-floating-promises": true,
85
+ "no-for-in-array": true,
86
+ "no-implicit-dependencies": false,
87
+ "no-import-side-effect": true,
88
+ "no-inferrable-types": false,
89
+ "no-inferred-empty-object-type": true,
90
+ "no-internal-module": true,
91
+ "no-invalid-template-strings": true,
92
+ "no-invalid-this": true,
93
+ "no-irregular-whitespace": true,
94
+ "no-magic-numbers": false,
95
+ "no-mergeable-namespace": true,
96
+ "no-misused-new": true,
97
+ "no-namespace": false,
98
+ "no-non-null-assertion": false,
99
+ "no-null-keyword": false,
100
+ "no-object-literal-type-assertion": true,
101
+ "no-parameter-properties": true,
102
+ "no-parameter-reassignment": true,
103
+ "no-redundant-jsdoc": true,
104
+ "no-reference": true,
105
+ "no-reference-import": true,
106
+ "no-require-imports": false,
107
+ "no-return-await": false,
108
+ "no-shadowed-variable": true,
109
+ "no-sparse-arrays": true,
110
+ "no-string-literal": true,
111
+ "no-string-throw": true,
112
+ "no-submodule-imports": false,
113
+ "no-switch-case-fall-through": true,
114
+ "no-this-assignment": true,
115
+ "no-trailing-whitespace": true,
116
+ "no-unbound-method": false,
117
+ "no-unnecessary-callback-wrapper": true,
118
+ "no-unnecessary-class": false,
119
+ "no-unnecessary-initializer": true,
120
+ "no-unnecessary-qualifier": true,
121
+ "no-unnecessary-type-assertion": true,
122
+ "no-unsafe-any": false,
123
+ "no-unsafe-finally": true,
124
+ "no-unused-expression": true,
125
+ "no-use-before-declare": false,
126
+ "no-var-keyword": true,
127
+ "no-var-requires": false,
128
+ "no-void-expression": false,
129
+ "number-literal-format": false,
130
+ "object-literal-key-quotes": [true, "as-needed"],
131
+ "object-literal-shorthand": true,
132
+ "object-literal-sort-keys": false,
133
+ "one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace"],
134
+ "one-variable-per-declaration": true,
135
+ "only-arrow-functions": false,
136
+ "ordered-imports": true,
137
+ "prefer-conditional-expression": true,
138
+ "prefer-const": true,
139
+ "prefer-for-of": false,
140
+ "prefer-function-over-method": false,
141
+ "prefer-method-signature": true,
142
+ "prefer-object-spread": false,
143
+ "prefer-readonly": true,
144
+ "prefer-switch": false,
145
+ "prefer-template": true,
146
+ "prefer-while": true,
147
+ "promise-function-async": true,
148
+ "quotemark": [true, "double" ,"backtick"],
149
+ "radix": true,
150
+ "restrict-plus-operands": true,
151
+ "return-undefined": true,
152
+ "semicolon": [true, "always", "ignore-bound-class-methods"],
153
+ "space-before-function-paren": [true, { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
154
+ "space-within-parens": [true, { "type": "number", "min": 0, "max": 0 }],
155
+ "strict-boolean-expressions": false,
156
+ "strict-type-predicates": false,
157
+ "switch-default": true,
158
+ "switch-final-break": false,
159
+ "trailing-comma": [true, { "multiline": "always", "singleline": "never", "esSpecCompliant": true }],
160
+ "triple-equals": [true, "allow-undefined-check"],
161
+ "type-literal-delimiter": true,
162
+ "typedef": true,
163
+ "typedef-whitespace": true,
164
+ "unified-signatures": true,
165
+ "use-default-type-parameter": true,
166
+ "use-isnan": true,
167
+ "variable-name": [true, "require-const-for-all-caps", "ban-keywords"],
168
+ "whitespace": [
169
+ true,
170
+ "check-decl",
171
+ "check-branch",
172
+ "check-operator",
173
+ "check-module",
174
+ "check-separator",
175
+ "check-rest-spread",
176
+ "check-type",
177
+ "check-typecast",
178
+ "check-type-operator"
179
+ ]
180
+ }
181
+ }
@@ -31,9 +31,11 @@ export namespace Activity {
31
31
  [key in ActivityIntensityKeys]: ActivityReductionSettingsIntervals<key, "hard", "fromFortysix">;
32
32
  };
33
33
 
34
+ // tslint:disable-next-line: interface-over-type-literal
34
35
  type ActivityPostReduction = {
35
36
  post: { [key in ActivityReductionKeys]: number };
36
37
  };
38
+ // tslint:disable-next-line: interface-over-type-literal
37
39
  type ActivityTarget = {
38
40
  target: number;
39
41
  };
@@ -7,26 +7,27 @@ export namespace LogbookService {
7
7
  newUUID: string;
8
8
  }
9
9
 
10
- export interface ILogbookSyncRequest {
11
- lastSyncTimestamp: string;
10
+ interface ICursor {
11
+ created?: ICreatedCursor;
12
+ deleted?: string;
13
+ }
14
+
15
+ interface ICreatedCursor {
16
+ cursor: string;
17
+ hasMore: boolean;
18
+ }
19
+
20
+ export interface ILogbookServiceRequest {
21
+ cursor?: ICursor;
12
22
  created: Array<Logbook.Types.ILogbookEntry>;
13
23
  edited: Array<IEditedUUID>;
14
24
  deleted: Array<string>;
15
25
  }
16
26
 
17
- export interface ILogbookSyncResponse {
18
- lastSyncTimestamp: string;
27
+ export interface ILogbookServiceResponse {
28
+ cursor?: ICursor;
19
29
  created: Array<Logbook.Types.ILogbookEntry>;
20
30
  deleted: Array<string>;
21
31
  }
22
-
23
- export interface ILogbookGetRequest {
24
- cursor?: string;
25
- }
26
-
27
- export interface ILogbookGetResponse {
28
- cursor?: string;
29
- logbooks: Array<Logbook.Types.ILogbookEntry>;
30
- }
31
32
  }
32
33
  }