@kindgi/types 0.1.7 → 0.1.8-rc.0
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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/result.d.ts +6 -0
- package/dist/result.d.ts.map +1 -1
- package/dist/secret-scope.d.ts +16 -0
- package/dist/secret-scope.d.ts.map +1 -0
- package/dist/secret-scope.js +4 -0
- package/dist/secret-scope.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/result.ts +6 -0
- package/src/secret-scope.ts +14 -0
- package/src/version.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type * from './ids.js';
|
|
|
4
4
|
export type * from './live.js';
|
|
5
5
|
export type * from './refs.js';
|
|
6
6
|
export type * from './result.js';
|
|
7
|
+
export type * from './secret-scope.js';
|
|
7
8
|
export type * from './temporal.js';
|
|
8
9
|
export type * from './version.js';
|
|
9
10
|
export type * from './webhook.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,cAAc,CAAC;AAKlC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,cAAc,CAAC;AAKlC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAajC,uEAAuE;AACvE,qEAAqE;AACrE,+DAA+D;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,yEAAyE;AACzE,8DAA8D;AAC9D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/result.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* do not invent parallel Ok/Err representations.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
+
* ```ts excerpt
|
|
10
11
|
* function loadSchema(path: string): Result<Schema, SchemaLoadError> {
|
|
11
12
|
* try {
|
|
12
13
|
* return { kind: 'ok', value: parse(readFileSync(path)) };
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
*
|
|
18
19
|
* const r = loadSchema('./flow.schema.json');
|
|
19
20
|
* if (r.kind === 'ok') { use(r.value); } else { handle(r.error); }
|
|
21
|
+
* ```
|
|
20
22
|
*/
|
|
21
23
|
export type Result<T, E> = {
|
|
22
24
|
readonly kind: 'ok';
|
|
@@ -29,7 +31,9 @@ export type Result<T, E> = {
|
|
|
29
31
|
* Extract the success type from a Result.
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
34
|
+
* ```ts excerpt
|
|
32
35
|
* type Value = OkOf<Result<number, string>>; // number
|
|
36
|
+
* ```
|
|
33
37
|
*/
|
|
34
38
|
export type OkOf<R> = R extends {
|
|
35
39
|
readonly kind: 'ok';
|
|
@@ -39,7 +43,9 @@ export type OkOf<R> = R extends {
|
|
|
39
43
|
* Extract the error type from a Result.
|
|
40
44
|
*
|
|
41
45
|
* @example
|
|
46
|
+
* ```ts excerpt
|
|
42
47
|
* type Failure = ErrOf<Result<number, string>>; // string
|
|
48
|
+
* ```
|
|
43
49
|
*/
|
|
44
50
|
export type ErrOf<R> = R extends {
|
|
45
51
|
readonly kind: 'err';
|
package/dist/result.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC1C;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAE7F;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OrgId, ProjectId } from './ids.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where a secret an item names is read, as recorded on the item when it's
|
|
4
|
+
* registered: the item's tenant itself, one of its orgs, or one of its
|
|
5
|
+
* projects. The runtime reads the secret at that scope only.
|
|
6
|
+
*/
|
|
7
|
+
export type RecordedSecretScope = {
|
|
8
|
+
readonly kind: 'tenant';
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'org';
|
|
11
|
+
readonly orgId: OrgId;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'project';
|
|
14
|
+
readonly projectId: ProjectId;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=secret-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-scope.d.ts","sourceRoot":"","sources":["../src/secret-scope.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-scope.js","sourceRoot":"","sources":["../src/secret-scope.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -24,10 +24,12 @@ export type SchemaMajor = Brand<number, 'SchemaMajor'>;
|
|
|
24
24
|
* semver, so replays and audit trails always know which version was in force.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
|
+
* ```ts excerpt
|
|
27
28
|
* const flowRef: VersionedRef<FlowId> = {
|
|
28
29
|
* id: 'acme.contract-review' as FlowId,
|
|
29
30
|
* version: '1.2.3' as Semver,
|
|
30
31
|
* };
|
|
32
|
+
* ```
|
|
31
33
|
*/
|
|
32
34
|
export interface VersionedRef<Id extends string> {
|
|
33
35
|
readonly id: Id;
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY,CAAC,EAAE,SAAS,MAAM;IAC7C,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,UAAU,GAAG,eAAe,GAAG,QAAQ,CAAC;AAE/F,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kindgi/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8-rc.0",
|
|
4
4
|
"description": "Foundational TypeScript types shared across Kindgi. Branded IDs, timestamps, hashes, refs, Result, list filter / page shapes. Zero runtime dependencies; the only runtime export is the makeEnvName validator.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type * from './ids.js';
|
|
|
7
7
|
export type * from './live.js';
|
|
8
8
|
export type * from './refs.js';
|
|
9
9
|
export type * from './result.js';
|
|
10
|
+
export type * from './secret-scope.js';
|
|
10
11
|
export type * from './temporal.js';
|
|
11
12
|
export type * from './version.js';
|
|
12
13
|
export type * from './webhook.js';
|
package/src/result.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* do not invent parallel Ok/Err representations.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
+
* ```ts excerpt
|
|
13
14
|
* function loadSchema(path: string): Result<Schema, SchemaLoadError> {
|
|
14
15
|
* try {
|
|
15
16
|
* return { kind: 'ok', value: parse(readFileSync(path)) };
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
*
|
|
21
22
|
* const r = loadSchema('./flow.schema.json');
|
|
22
23
|
* if (r.kind === 'ok') { use(r.value); } else { handle(r.error); }
|
|
24
|
+
* ```
|
|
23
25
|
*/
|
|
24
26
|
export type Result<T, E> =
|
|
25
27
|
| { readonly kind: 'ok'; readonly value: T }
|
|
@@ -29,7 +31,9 @@ export type Result<T, E> =
|
|
|
29
31
|
* Extract the success type from a Result.
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
34
|
+
* ```ts excerpt
|
|
32
35
|
* type Value = OkOf<Result<number, string>>; // number
|
|
36
|
+
* ```
|
|
33
37
|
*/
|
|
34
38
|
export type OkOf<R> = R extends { readonly kind: 'ok'; readonly value: infer T } ? T : never;
|
|
35
39
|
|
|
@@ -37,6 +41,8 @@ export type OkOf<R> = R extends { readonly kind: 'ok'; readonly value: infer T }
|
|
|
37
41
|
* Extract the error type from a Result.
|
|
38
42
|
*
|
|
39
43
|
* @example
|
|
44
|
+
* ```ts excerpt
|
|
40
45
|
* type Failure = ErrOf<Result<number, string>>; // string
|
|
46
|
+
* ```
|
|
41
47
|
*/
|
|
42
48
|
export type ErrOf<R> = R extends { readonly kind: 'err'; readonly error: infer E } ? E : never;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { OrgId, ProjectId } from './ids.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a secret an item names is read, as recorded on the item when it's
|
|
8
|
+
* registered: the item's tenant itself, one of its orgs, or one of its
|
|
9
|
+
* projects. The runtime reads the secret at that scope only.
|
|
10
|
+
*/
|
|
11
|
+
export type RecordedSecretScope =
|
|
12
|
+
| { readonly kind: 'tenant' }
|
|
13
|
+
| { readonly kind: 'org'; readonly orgId: OrgId }
|
|
14
|
+
| { readonly kind: 'project'; readonly projectId: ProjectId };
|
package/src/version.ts
CHANGED
|
@@ -30,10 +30,12 @@ export type SchemaMajor = Brand<number, 'SchemaMajor'>;
|
|
|
30
30
|
* semver, so replays and audit trails always know which version was in force.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
|
+
* ```ts excerpt
|
|
33
34
|
* const flowRef: VersionedRef<FlowId> = {
|
|
34
35
|
* id: 'acme.contract-review' as FlowId,
|
|
35
36
|
* version: '1.2.3' as Semver,
|
|
36
37
|
* };
|
|
38
|
+
* ```
|
|
37
39
|
*/
|
|
38
40
|
export interface VersionedRef<Id extends string> {
|
|
39
41
|
readonly id: Id;
|