@ankhorage/contracts 1.8.0 → 1.10.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/CHANGELOG.md +12 -0
- package/dist/data/diagnostics.d.ts +22 -0
- package/dist/data/diagnostics.d.ts.map +1 -0
- package/dist/data/diagnostics.js +2 -0
- package/dist/data/diagnostics.js.map +1 -0
- package/dist/data/endpoints.d.ts +18 -0
- package/dist/data/endpoints.d.ts.map +1 -0
- package/dist/data/endpoints.js +2 -0
- package/dist/data/endpoints.js.map +1 -0
- package/dist/data/ids.d.ts +7 -0
- package/dist/data/ids.d.ts.map +1 -0
- package/dist/data/ids.js +2 -0
- package/dist/data/ids.js.map +1 -0
- package/dist/data/index.d.ts +9 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +9 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/operations.d.ts +49 -0
- package/dist/data/operations.d.ts.map +1 -0
- package/dist/data/operations.js +2 -0
- package/dist/data/operations.js.map +1 -0
- package/dist/data/refs.d.ts +18 -0
- package/dist/data/refs.d.ts.map +1 -0
- package/dist/data/refs.js +2 -0
- package/dist/data/refs.js.map +1 -0
- package/dist/data/schemas.d.ts +34 -0
- package/dist/data/schemas.d.ts.map +1 -0
- package/dist/data/schemas.js +2 -0
- package/dist/data/schemas.js.map +1 -0
- package/dist/data/sources.d.ts +57 -0
- package/dist/data/sources.d.ts.map +1 -0
- package/dist/data/sources.js +2 -0
- package/dist/data/sources.js.map +1 -0
- package/dist/data/values.d.ts +5 -0
- package/dist/data/values.d.ts.map +1 -0
- package/dist/data/values.js +2 -0
- package/dist/data/values.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/ui.d.ts +72 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -0
- package/package.json +9 -1
- package/src/data/data.test.ts +305 -0
- package/src/data/diagnostics.ts +41 -0
- package/src/data/endpoints.ts +20 -0
- package/src/data/ids.ts +6 -0
- package/src/data/index.ts +8 -0
- package/src/data/operations.ts +66 -0
- package/src/data/refs.ts +21 -0
- package/src/data/schemas.ts +46 -0
- package/src/data/sources.ts +72 -0
- package/src/data/values.ts +11 -0
- package/src/index.ts +2 -0
- package/src/ui.test.ts +193 -0
- package/src/ui.ts +113 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/contracts
|
|
2
2
|
|
|
3
|
+
## 1.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d637fdc: Add provider-neutral UI component metadata contracts for component registries and extension package manifests.
|
|
8
|
+
|
|
9
|
+
## 1.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d1e08cc: Add provider-neutral data-source, endpoint, operation, schema, credential, adapter, and diagnostic contracts.
|
|
14
|
+
|
|
3
15
|
## 1.8.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DataSourceId, EndpointId, OperationId } from './ids';
|
|
2
|
+
export type DataDiagnosticSeverity = 'error' | 'info' | 'warning';
|
|
3
|
+
export type DataDiagnosticCode = 'ambiguous-server' | 'duplicate-operation-id' | 'invalid-config' | 'missing-adapter' | 'missing-credential' | 'missing-data-source' | 'missing-endpoint' | 'missing-operation' | 'missing-schema' | 'network-error' | 'parse-error' | 'unsupported-auth-scheme' | 'unsupported-schema' | (string & {});
|
|
4
|
+
export interface DataSourceDiagnostic {
|
|
5
|
+
readonly code: DataDiagnosticCode;
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly severity: DataDiagnosticSeverity;
|
|
8
|
+
readonly dataSourceId?: DataSourceId;
|
|
9
|
+
readonly endpointId?: EndpointId;
|
|
10
|
+
readonly operationId?: OperationId;
|
|
11
|
+
readonly path?: string;
|
|
12
|
+
readonly hint?: string;
|
|
13
|
+
}
|
|
14
|
+
export type DataSourceDiagnosticResult<TData> = {
|
|
15
|
+
readonly ok: true;
|
|
16
|
+
readonly data: TData;
|
|
17
|
+
readonly diagnostics?: readonly DataSourceDiagnostic[];
|
|
18
|
+
} | {
|
|
19
|
+
readonly ok: false;
|
|
20
|
+
readonly diagnostics: readonly DataSourceDiagnostic[];
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/data/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEnE,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,iBAAiB,GACjB,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,yBAAyB,GACzB,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,0BAA0B,CAAC,KAAK,IACxC;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACxD,GACD;IACE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/data/diagnostics.ts"],"names":[],"mappings":"","sourcesContent":["import type { DataSourceId, EndpointId, OperationId } from './ids';\n\nexport type DataDiagnosticSeverity = 'error' | 'info' | 'warning';\n\nexport type DataDiagnosticCode =\n | 'ambiguous-server'\n | 'duplicate-operation-id'\n | 'invalid-config'\n | 'missing-adapter'\n | 'missing-credential'\n | 'missing-data-source'\n | 'missing-endpoint'\n | 'missing-operation'\n | 'missing-schema'\n | 'network-error'\n | 'parse-error'\n | 'unsupported-auth-scheme'\n | 'unsupported-schema'\n | (string & {});\n\nexport interface DataSourceDiagnostic {\n readonly code: DataDiagnosticCode;\n readonly message: string;\n readonly severity: DataDiagnosticSeverity;\n readonly dataSourceId?: DataSourceId;\n readonly endpointId?: EndpointId;\n readonly operationId?: OperationId;\n readonly path?: string;\n readonly hint?: string;\n}\n\nexport type DataSourceDiagnosticResult<TData> =\n | {\n readonly ok: true;\n readonly data: TData;\n readonly diagnostics?: readonly DataSourceDiagnostic[];\n }\n | {\n readonly ok: false;\n readonly diagnostics: readonly DataSourceDiagnostic[];\n };\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EndpointId, OperationId } from './ids';
|
|
2
|
+
import type { DataOperationConfig } from './operations';
|
|
3
|
+
import type { CredentialRef } from './refs';
|
|
4
|
+
import type { DataContractValue } from './values';
|
|
5
|
+
export type DataEndpointKind = 'database' | 'graphql' | 'http' | (string & {});
|
|
6
|
+
export interface DataEndpointConfig {
|
|
7
|
+
readonly id: EndpointId;
|
|
8
|
+
readonly kind: DataEndpointKind;
|
|
9
|
+
readonly name?: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly baseUrl?: string;
|
|
12
|
+
readonly path?: string;
|
|
13
|
+
readonly credential?: CredentialRef;
|
|
14
|
+
readonly operations: Readonly<Record<OperationId, DataOperationConfig>>;
|
|
15
|
+
readonly metadata?: DataContractValue;
|
|
16
|
+
}
|
|
17
|
+
export type DataEndpointRegistry = Readonly<Record<EndpointId, DataEndpointConfig>>;
|
|
18
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/data/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/data/endpoints.ts"],"names":[],"mappings":"","sourcesContent":["import type { EndpointId, OperationId } from './ids';\nimport type { DataOperationConfig } from './operations';\nimport type { CredentialRef } from './refs';\nimport type { DataContractValue } from './values';\n\nexport type DataEndpointKind = 'database' | 'graphql' | 'http' | (string & {});\n\nexport interface DataEndpointConfig {\n readonly id: EndpointId;\n readonly kind: DataEndpointKind;\n readonly name?: string;\n readonly description?: string;\n readonly baseUrl?: string;\n readonly path?: string;\n readonly credential?: CredentialRef;\n readonly operations: Readonly<Record<OperationId, DataOperationConfig>>;\n readonly metadata?: DataContractValue;\n}\n\nexport type DataEndpointRegistry = Readonly<Record<EndpointId, DataEndpointConfig>>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/data/ids.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC"}
|
package/dist/data/ids.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/data/ids.ts"],"names":[],"mappings":"","sourcesContent":["export type DataSourceId = string;\nexport type EndpointId = string;\nexport type OperationId = string;\nexport type SchemaId = string;\nexport type CredentialId = string;\nexport type AdapterId = string;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './diagnostics';
|
|
2
|
+
export * from './endpoints';
|
|
3
|
+
export * from './ids';
|
|
4
|
+
export * from './operations';
|
|
5
|
+
export * from './refs';
|
|
6
|
+
export * from './schemas';
|
|
7
|
+
export * from './sources';
|
|
8
|
+
export * from './values';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './diagnostics';
|
|
2
|
+
export * from './endpoints';
|
|
3
|
+
export * from './ids';
|
|
4
|
+
export * from './operations';
|
|
5
|
+
export * from './refs';
|
|
6
|
+
export * from './schemas';
|
|
7
|
+
export * from './sources';
|
|
8
|
+
export * from './values';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC","sourcesContent":["export * from './diagnostics';\nexport * from './endpoints';\nexport * from './ids';\nexport * from './operations';\nexport * from './refs';\nexport * from './schemas';\nexport * from './sources';\nexport * from './values';\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EndpointId, OperationId } from './ids';
|
|
2
|
+
import type { CredentialRef } from './refs';
|
|
3
|
+
import type { DataSchemaSlot } from './schemas';
|
|
4
|
+
import type { DataContractValue } from './values';
|
|
5
|
+
export type DataOperationIntent = 'action' | 'create' | 'delete' | 'read' | 'update';
|
|
6
|
+
export type DataOperationMethod = 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | (string & {});
|
|
7
|
+
export type DataOperationProtocol = 'database' | 'graphql' | 'http' | (string & {});
|
|
8
|
+
export type DataOperationParameterLocation = 'body' | 'cookie' | 'header' | 'path' | 'query';
|
|
9
|
+
export interface DataOperationParameter extends DataSchemaSlot {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly location: DataOperationParameterLocation;
|
|
12
|
+
readonly required?: boolean;
|
|
13
|
+
readonly description?: string;
|
|
14
|
+
readonly default?: DataContractValue;
|
|
15
|
+
}
|
|
16
|
+
export interface DataOperationRequest extends DataSchemaSlot {
|
|
17
|
+
readonly parameters?: readonly DataOperationParameter[];
|
|
18
|
+
readonly contentType?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DataOperationResponse extends DataSchemaSlot {
|
|
21
|
+
readonly status?: number | string;
|
|
22
|
+
readonly contentType?: string;
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DataOperationPagination {
|
|
26
|
+
readonly kind: 'cursor' | 'limit-offset' | 'page' | 'unknown' | (string & {});
|
|
27
|
+
readonly cursorPath?: string;
|
|
28
|
+
readonly limitParameter?: string;
|
|
29
|
+
readonly offsetParameter?: string;
|
|
30
|
+
readonly pageParameter?: string;
|
|
31
|
+
readonly pageSizeParameter?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface DataOperationConfig {
|
|
34
|
+
readonly id: OperationId;
|
|
35
|
+
readonly endpointId?: EndpointId;
|
|
36
|
+
readonly name?: string;
|
|
37
|
+
readonly description?: string;
|
|
38
|
+
readonly protocol: DataOperationProtocol;
|
|
39
|
+
readonly intent: DataOperationIntent;
|
|
40
|
+
readonly method?: DataOperationMethod;
|
|
41
|
+
readonly path?: string;
|
|
42
|
+
readonly request?: DataOperationRequest;
|
|
43
|
+
readonly response?: DataOperationResponse;
|
|
44
|
+
readonly pagination?: DataOperationPagination;
|
|
45
|
+
readonly credential?: CredentialRef;
|
|
46
|
+
readonly metadata?: DataContractValue;
|
|
47
|
+
}
|
|
48
|
+
export type DataOperationRegistry = Readonly<Record<OperationId, DataOperationConfig>>;
|
|
49
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/data/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErF,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,KAAK,GACL,MAAM,GACN,SAAS,GACT,OAAO,GACP,MAAM,GACN,KAAK,GACL,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEpF,MAAM,MAAM,8BAA8B,GAAG,M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,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,uBAAuB,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/data/operations.ts"],"names":[],"mappings":"","sourcesContent":["import type { EndpointId, OperationId } from './ids';\nimport type { CredentialRef } from './refs';\nimport type { DataSchemaSlot } from './schemas';\nimport type { DataContractValue } from './values';\n\nexport type DataOperationIntent = 'action' | 'create' | 'delete' | 'read' | 'update';\n\nexport type DataOperationMethod =\n | 'DELETE'\n | 'GET'\n | 'HEAD'\n | 'OPTIONS'\n | 'PATCH'\n | 'POST'\n | 'PUT'\n | (string & {});\n\nexport type DataOperationProtocol = 'database' | 'graphql' | 'http' | (string & {});\n\nexport type DataOperationParameterLocation = 'body' | 'cookie' | 'header' | 'path' | 'query';\n\nexport interface DataOperationParameter extends DataSchemaSlot {\n readonly name: string;\n readonly location: DataOperationParameterLocation;\n readonly required?: boolean;\n readonly description?: string;\n readonly default?: DataContractValue;\n}\n\nexport interface DataOperationRequest extends DataSchemaSlot {\n readonly parameters?: readonly DataOperationParameter[];\n readonly contentType?: string;\n}\n\nexport interface DataOperationResponse extends DataSchemaSlot {\n readonly status?: number | string;\n readonly contentType?: string;\n readonly description?: string;\n}\n\nexport interface DataOperationPagination {\n readonly kind: 'cursor' | 'limit-offset' | 'page' | 'unknown' | (string & {});\n readonly cursorPath?: string;\n readonly limitParameter?: string;\n readonly offsetParameter?: string;\n readonly pageParameter?: string;\n readonly pageSizeParameter?: string;\n}\n\nexport interface DataOperationConfig {\n readonly id: OperationId;\n readonly endpointId?: EndpointId;\n readonly name?: string;\n readonly description?: string;\n readonly protocol: DataOperationProtocol;\n readonly intent: DataOperationIntent;\n readonly method?: DataOperationMethod;\n readonly path?: string;\n readonly request?: DataOperationRequest;\n readonly response?: DataOperationResponse;\n readonly pagination?: DataOperationPagination;\n readonly credential?: CredentialRef;\n readonly metadata?: DataContractValue;\n}\n\nexport type DataOperationRegistry = Readonly<Record<OperationId, DataOperationConfig>>;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AdapterId, CredentialId } from './ids';
|
|
2
|
+
import type { DataContractValue } from './values';
|
|
3
|
+
export type CredentialKind = 'apiKey' | 'basic' | 'bearer' | 'custom' | 'oauth2';
|
|
4
|
+
export interface CredentialRef {
|
|
5
|
+
readonly id: CredentialId;
|
|
6
|
+
readonly kind: CredentialKind | (string & {});
|
|
7
|
+
readonly label?: string;
|
|
8
|
+
readonly scope?: string;
|
|
9
|
+
}
|
|
10
|
+
export type AdapterKind = 'auth' | 'database' | 'storage' | 'transport' | (string & {});
|
|
11
|
+
export interface AdapterRef {
|
|
12
|
+
readonly id: AdapterId;
|
|
13
|
+
readonly kind: AdapterKind;
|
|
14
|
+
readonly packageName?: string;
|
|
15
|
+
readonly exportName?: string;
|
|
16
|
+
readonly config?: DataContractValue;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/data/refs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAExF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../src/data/refs.ts"],"names":[],"mappings":"","sourcesContent":["import type { AdapterId, CredentialId } from './ids';\nimport type { DataContractValue } from './values';\n\nexport type CredentialKind = 'apiKey' | 'basic' | 'bearer' | 'custom' | 'oauth2';\n\nexport interface CredentialRef {\n readonly id: CredentialId;\n readonly kind: CredentialKind | (string & {});\n readonly label?: string;\n readonly scope?: string;\n}\n\nexport type AdapterKind = 'auth' | 'database' | 'storage' | 'transport' | (string & {});\n\nexport interface AdapterRef {\n readonly id: AdapterId;\n readonly kind: AdapterKind;\n readonly packageName?: string;\n readonly exportName?: string;\n readonly config?: DataContractValue;\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SchemaId } from './ids';
|
|
2
|
+
import type { DataContractValue } from './values';
|
|
3
|
+
export type DataSchemaPrimitiveType = 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string';
|
|
4
|
+
export interface DataSchemaRef {
|
|
5
|
+
readonly id: SchemaId;
|
|
6
|
+
}
|
|
7
|
+
export interface DataSchemaProperty {
|
|
8
|
+
readonly description?: string;
|
|
9
|
+
readonly schema: DataSchema;
|
|
10
|
+
}
|
|
11
|
+
export interface DataSchema {
|
|
12
|
+
readonly type?: DataSchemaPrimitiveType | readonly DataSchemaPrimitiveType[];
|
|
13
|
+
readonly title?: string;
|
|
14
|
+
readonly description?: string;
|
|
15
|
+
readonly enum?: readonly DataContractValue[];
|
|
16
|
+
readonly const?: DataContractValue;
|
|
17
|
+
readonly default?: DataContractValue;
|
|
18
|
+
readonly format?: string;
|
|
19
|
+
readonly nullable?: boolean;
|
|
20
|
+
readonly required?: readonly string[];
|
|
21
|
+
readonly properties?: Readonly<Record<string, DataSchema>>;
|
|
22
|
+
readonly additionalProperties?: boolean | DataSchema;
|
|
23
|
+
readonly items?: DataSchema;
|
|
24
|
+
readonly allOf?: readonly DataSchema[];
|
|
25
|
+
readonly anyOf?: readonly DataSchema[];
|
|
26
|
+
readonly oneOf?: readonly DataSchema[];
|
|
27
|
+
readonly ref?: DataSchemaRef;
|
|
28
|
+
}
|
|
29
|
+
export type DataSchemaRegistry = Readonly<Record<SchemaId, DataSchema>>;
|
|
30
|
+
export interface DataSchemaSlot {
|
|
31
|
+
readonly schema?: DataSchema;
|
|
32
|
+
readonly schemaRef?: DataSchemaRef;
|
|
33
|
+
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oB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/data/schemas.ts"],"names":[],"mappings":"","sourcesContent":["import type { SchemaId } from './ids';\nimport type { DataContractValue } from './values';\n\nexport type DataSchemaPrimitiveType =\n | 'array'\n | 'boolean'\n | 'integer'\n | 'null'\n | 'number'\n | 'object'\n | 'string';\n\nexport interface DataSchemaRef {\n readonly id: SchemaId;\n}\n\nexport interface DataSchemaProperty {\n readonly description?: string;\n readonly schema: DataSchema;\n}\n\nexport interface DataSchema {\n readonly type?: DataSchemaPrimitiveType | readonly DataSchemaPrimitiveType[];\n readonly title?: string;\n readonly description?: string;\n readonly enum?: readonly DataContractValue[];\n readonly const?: DataContractValue;\n readonly default?: DataContractValue;\n readonly format?: string;\n readonly nullable?: boolean;\n readonly required?: readonly string[];\n readonly properties?: Readonly<Record<string, DataSchema>>;\n readonly additionalProperties?: boolean | DataSchema;\n readonly items?: DataSchema;\n readonly allOf?: readonly DataSchema[];\n readonly anyOf?: readonly DataSchema[];\n readonly oneOf?: readonly DataSchema[];\n readonly ref?: DataSchemaRef;\n}\n\nexport type DataSchemaRegistry = Readonly<Record<SchemaId, DataSchema>>;\n\nexport interface DataSchemaSlot {\n readonly schema?: DataSchema;\n readonly schemaRef?: DataSchemaRef;\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { DbCollectionDefinition } from '../db';
|
|
2
|
+
import type { DataEndpointRegistry } from './endpoints';
|
|
3
|
+
import type { DataSourceId } from './ids';
|
|
4
|
+
import type { AdapterRef, CredentialRef } from './refs';
|
|
5
|
+
import type { DataSchemaRegistry } from './schemas';
|
|
6
|
+
import type { DataContractValue } from './values';
|
|
7
|
+
export type DataSourceKind = 'database' | 'graphql' | 'managed-api' | 'openapi' | 'rest';
|
|
8
|
+
export interface DataSourceBaseConfig {
|
|
9
|
+
readonly id: DataSourceId;
|
|
10
|
+
readonly kind: DataSourceKind;
|
|
11
|
+
readonly name?: string;
|
|
12
|
+
readonly description?: string;
|
|
13
|
+
readonly credential?: CredentialRef;
|
|
14
|
+
readonly endpoints: DataEndpointRegistry;
|
|
15
|
+
readonly schemas?: DataSchemaRegistry;
|
|
16
|
+
readonly metadata?: DataContractValue;
|
|
17
|
+
}
|
|
18
|
+
export interface RestDataSourceConfig extends DataSourceBaseConfig {
|
|
19
|
+
readonly kind: 'rest';
|
|
20
|
+
readonly baseUrl: string;
|
|
21
|
+
}
|
|
22
|
+
export interface OpenApiImportRef {
|
|
23
|
+
readonly url?: string;
|
|
24
|
+
readonly documentId?: string;
|
|
25
|
+
readonly version?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface OpenApiDataSourceConfig extends DataSourceBaseConfig {
|
|
28
|
+
readonly kind: 'openapi';
|
|
29
|
+
readonly baseUrl?: string;
|
|
30
|
+
readonly import?: OpenApiImportRef;
|
|
31
|
+
}
|
|
32
|
+
export interface GraphQlDataSourceConfig extends DataSourceBaseConfig {
|
|
33
|
+
readonly kind: 'graphql';
|
|
34
|
+
readonly endpointUrl: string;
|
|
35
|
+
readonly introspection?: {
|
|
36
|
+
readonly enabled: boolean;
|
|
37
|
+
readonly schemaVersion?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface DatabaseDataSourceConfig extends DataSourceBaseConfig {
|
|
41
|
+
readonly kind: 'database';
|
|
42
|
+
readonly adapter: AdapterRef;
|
|
43
|
+
}
|
|
44
|
+
export interface ManagedApiResourceConfig {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly collection: DbCollectionDefinition;
|
|
47
|
+
readonly operations?: readonly ('create' | 'delete' | 'list' | 'read' | 'update')[];
|
|
48
|
+
readonly metadata?: DataContractValue;
|
|
49
|
+
}
|
|
50
|
+
export interface ManagedApiDataSourceConfig extends DataSourceBaseConfig {
|
|
51
|
+
readonly kind: 'managed-api';
|
|
52
|
+
readonly adapter: AdapterRef;
|
|
53
|
+
readonly resources: readonly ManagedApiResourceConfig[];
|
|
54
|
+
}
|
|
55
|
+
export type DataSourceConfig = DatabaseDataSourceConfig | GraphQlDataSourceConfig | ManagedApiDataSourceConfig | OpenApiDataSourceConfig | RestDataSourceConfig;
|
|
56
|
+
export type DataSourceRegistry = Readonly<Record<DataSourceId, DataSourceConfig>>;
|
|
57
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/data/sources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AA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C1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;CACH;AAED,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC;IACpF,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACzD;AAED,MAAM,MAAM,gBAAgB,GACxB,wBAAwB,GACxB,uBAAuB,GACvB,0BAA0B,GAC1B,uBAAuB,GACvB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../../src/data/sources.ts"],"names":[],"mappings":"","sourcesContent":["import type { DbCollectionDefinition } from '../db';\nimport type { DataEndpointRegistry } from './endpoints';\nimport type { DataSourceId } from './ids';\nimport type { AdapterRef, CredentialRef } from './refs';\nimport type { DataSchemaRegistry } from './schemas';\nimport type { DataContractValue } from './values';\n\nexport type DataSourceKind = 'database' | 'graphql' | 'managed-api' | 'openapi' | 'rest';\n\nexport interface DataSourceBaseConfig {\n readonly id: DataSourceId;\n readonly kind: DataSourceKind;\n readonly name?: string;\n readonly description?: string;\n readonly credential?: CredentialRef;\n readonly endpoints: DataEndpointRegistry;\n readonly schemas?: DataSchemaRegistry;\n readonly metadata?: DataContractValue;\n}\n\nexport interface RestDataSourceConfig extends DataSourceBaseConfig {\n readonly kind: 'rest';\n readonly baseUrl: string;\n}\n\nexport interface OpenApiImportRef {\n readonly url?: string;\n readonly documentId?: string;\n readonly version?: string;\n}\n\nexport interface OpenApiDataSourceConfig extends DataSourceBaseConfig {\n readonly kind: 'openapi';\n readonly baseUrl?: string;\n readonly import?: OpenApiImportRef;\n}\n\nexport interface GraphQlDataSourceConfig extends DataSourceBaseConfig {\n readonly kind: 'graphql';\n readonly endpointUrl: string;\n readonly introspection?: {\n readonly enabled: boolean;\n readonly schemaVersion?: string;\n };\n}\n\nexport interface DatabaseDataSourceConfig extends DataSourceBaseConfig {\n readonly kind: 'database';\n readonly adapter: AdapterRef;\n}\n\nexport interface ManagedApiResourceConfig {\n readonly name: string;\n readonly collection: DbCollectionDefinition;\n readonly operations?: readonly ('create' | 'delete' | 'list' | 'read' | 'update')[];\n readonly metadata?: DataContractValue;\n}\n\nexport interface ManagedApiDataSourceConfig extends DataSourceBaseConfig {\n readonly kind: 'managed-api';\n readonly adapter: AdapterRef;\n readonly resources: readonly ManagedApiResourceConfig[];\n}\n\nexport type DataSourceConfig =\n | DatabaseDataSourceConfig\n | GraphQlDataSourceConfig\n | ManagedApiDataSourceConfig\n | OpenApiDataSourceConfig\n | RestDataSourceConfig;\n\nexport type DataSourceRegistry = Readonly<Record<DataSourceId, DataSourceConfig>>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/data/values.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,iBAAiB,EAAE,GAC5B;IACE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAC3C,CAAC;AAEN,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/data/values.ts"],"names":[],"mappings":"","sourcesContent":["export type DataContractValue =\n | string\n | number\n | boolean\n | null\n | readonly DataContractValue[]\n | {\n readonly [key: string]: DataContractValue;\n };\n\nexport type DataPath = string;\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './db';\nexport * from './state';\nexport * from './storage';\nexport * from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './data';\nexport * from './db';\nexport * from './state';\nexport * from './storage';\nexport * from './types';\nexport * from './ui';\n"]}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ComponentEventDtoKind } from './types';
|
|
2
|
+
export type UiComponentCategory = 'component' | 'foundation' | 'layout' | 'pattern';
|
|
3
|
+
export type UiComponentPropType = 'action' | 'array' | 'boolean' | 'color' | 'enum' | 'imageAsset' | 'number' | 'radius' | 'shadow' | 'spacing' | 'string' | 'typographySize' | 'typographyWeight';
|
|
4
|
+
export type UiComponentPropValue = string | number | boolean | null | readonly UiComponentPropValue[] | {
|
|
5
|
+
readonly [key: string]: UiComponentPropValue;
|
|
6
|
+
};
|
|
7
|
+
export interface UiComponentPropArrayItemSchema {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly schema: UiComponentPropSchema;
|
|
10
|
+
}
|
|
11
|
+
export interface UiComponentPropSchema {
|
|
12
|
+
readonly type: UiComponentPropType;
|
|
13
|
+
readonly category: string;
|
|
14
|
+
readonly label?: string;
|
|
15
|
+
readonly enum?: readonly (number | string)[];
|
|
16
|
+
readonly default?: UiComponentPropValue;
|
|
17
|
+
readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];
|
|
18
|
+
}
|
|
19
|
+
export interface UiComponentBlueprintIcon {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly provider?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface UiComponentBlueprint {
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly icon?: UiComponentBlueprintIcon;
|
|
26
|
+
readonly defaultProps?: Readonly<Record<string, UiComponentPropValue>>;
|
|
27
|
+
}
|
|
28
|
+
export interface UiComponentI18nFieldMeta {
|
|
29
|
+
readonly keyProp: string;
|
|
30
|
+
readonly defaultTextProp: string;
|
|
31
|
+
}
|
|
32
|
+
export interface UiComponentI18nMeta {
|
|
33
|
+
readonly fields: readonly UiComponentI18nFieldMeta[];
|
|
34
|
+
}
|
|
35
|
+
export type UiComponentEventPayloadKind = ComponentEventDtoKind | (string & {});
|
|
36
|
+
export type UiComponentEventPayloadFieldType = 'boolean' | 'number' | 'object' | 'record' | 'string' | 'unknown';
|
|
37
|
+
export interface UiComponentEventPayloadFieldMeta {
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly type: UiComponentEventPayloadFieldType;
|
|
40
|
+
readonly label?: string;
|
|
41
|
+
readonly description?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface UiComponentEventMeta {
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly eventType: UiComponentEventPayloadKind;
|
|
46
|
+
readonly description?: string;
|
|
47
|
+
readonly payloadFields?: readonly UiComponentEventPayloadFieldMeta[];
|
|
48
|
+
}
|
|
49
|
+
export interface UiComponentSlotMeta {
|
|
50
|
+
readonly label?: string;
|
|
51
|
+
readonly allowedChildren?: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
export interface UiComponentMeta {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly category: UiComponentCategory;
|
|
56
|
+
readonly description?: string;
|
|
57
|
+
readonly directManifestNode: boolean;
|
|
58
|
+
readonly allowedChildren: readonly string[];
|
|
59
|
+
readonly blueprint?: UiComponentBlueprint;
|
|
60
|
+
readonly events?: Readonly<Record<string, UiComponentEventMeta>>;
|
|
61
|
+
readonly i18n?: UiComponentI18nMeta;
|
|
62
|
+
readonly slots?: Readonly<Record<string, UiComponentSlotMeta>>;
|
|
63
|
+
readonly note?: string;
|
|
64
|
+
readonly props: Readonly<Record<string, UiComponentPropSchema>>;
|
|
65
|
+
}
|
|
66
|
+
export type UiComponentMetaRegistry = Readonly<Record<string, UiComponentMeta>>;
|
|
67
|
+
export interface UiComponentPackageManifest {
|
|
68
|
+
readonly packageName: string;
|
|
69
|
+
readonly displayName?: string;
|
|
70
|
+
readonly components: UiComponentMetaRegistry;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpF,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,OAAO,GACP,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,gBAAgB,GAChB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,oBAAoB,EAAE,GAC/B;IACE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC9C,CAAC;AAEN,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC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,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C"}
|
package/dist/ui.js
ADDED
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentEventDtoKind } from './types';\n\nexport type UiComponentCategory = 'component' | 'foundation' | 'layout' | 'pattern';\n\nexport type UiComponentPropType =\n | 'action'\n | 'array'\n | 'boolean'\n | 'color'\n | 'enum'\n | 'imageAsset'\n | 'number'\n | 'radius'\n | 'shadow'\n | 'spacing'\n | 'string'\n | 'typographySize'\n | 'typographyWeight';\n\nexport type UiComponentPropValue =\n | string\n | number\n | boolean\n | null\n | readonly UiComponentPropValue[]\n | {\n readonly [key: string]: UiComponentPropValue;\n };\n\nexport interface UiComponentPropArrayItemSchema {\n readonly key: string;\n readonly schema: UiComponentPropSchema;\n}\n\nexport interface UiComponentPropSchema {\n readonly type: UiComponentPropType;\n readonly category: string;\n readonly label?: string;\n readonly enum?: readonly (number | string)[];\n readonly default?: UiComponentPropValue;\n readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];\n}\n\nexport interface UiComponentBlueprintIcon {\n readonly name: string;\n readonly provider?: string;\n}\n\nexport interface UiComponentBlueprint {\n readonly label: string;\n readonly icon?: UiComponentBlueprintIcon;\n readonly defaultProps?: Readonly<Record<string, UiComponentPropValue>>;\n}\n\nexport interface UiComponentI18nFieldMeta {\n readonly keyProp: string;\n readonly defaultTextProp: string;\n}\n\nexport interface UiComponentI18nMeta {\n readonly fields: readonly UiComponentI18nFieldMeta[];\n}\n\nexport type UiComponentEventPayloadKind = ComponentEventDtoKind | (string & {});\n\nexport type UiComponentEventPayloadFieldType =\n | 'boolean'\n | 'number'\n | 'object'\n | 'record'\n | 'string'\n | 'unknown';\n\nexport interface UiComponentEventPayloadFieldMeta {\n readonly path: string;\n readonly type: UiComponentEventPayloadFieldType;\n readonly label?: string;\n readonly description?: string;\n}\n\nexport interface UiComponentEventMeta {\n readonly label: string;\n readonly eventType: UiComponentEventPayloadKind;\n readonly description?: string;\n readonly payloadFields?: readonly UiComponentEventPayloadFieldMeta[];\n}\n\nexport interface UiComponentSlotMeta {\n readonly label?: string;\n readonly allowedChildren?: readonly string[];\n}\n\nexport interface UiComponentMeta {\n readonly name: string;\n readonly category: UiComponentCategory;\n readonly description?: string;\n readonly directManifestNode: boolean;\n readonly allowedChildren: readonly string[];\n readonly blueprint?: UiComponentBlueprint;\n readonly events?: Readonly<Record<string, UiComponentEventMeta>>;\n readonly i18n?: UiComponentI18nMeta;\n readonly slots?: Readonly<Record<string, UiComponentSlotMeta>>;\n readonly note?: string;\n readonly props: Readonly<Record<string, UiComponentPropSchema>>;\n}\n\nexport type UiComponentMetaRegistry = Readonly<Record<string, UiComponentMeta>>;\n\nexport interface UiComponentPackageManifest {\n readonly packageName: string;\n readonly displayName?: string;\n readonly components: UiComponentMetaRegistry;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@ankhorage/color-theory": "^0.0.7"
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"types": "./dist/bindings.d.ts",
|
|
26
26
|
"default": "./dist/bindings.js"
|
|
27
27
|
},
|
|
28
|
+
"./data": {
|
|
29
|
+
"types": "./dist/data/index.d.ts",
|
|
30
|
+
"default": "./dist/data/index.js"
|
|
31
|
+
},
|
|
28
32
|
"./db": {
|
|
29
33
|
"types": "./dist/db.d.ts",
|
|
30
34
|
"default": "./dist/db.js"
|
|
@@ -36,6 +40,10 @@
|
|
|
36
40
|
"./storage": {
|
|
37
41
|
"types": "./dist/storage.d.ts",
|
|
38
42
|
"default": "./dist/storage.js"
|
|
43
|
+
},
|
|
44
|
+
"./ui": {
|
|
45
|
+
"types": "./dist/ui.d.ts",
|
|
46
|
+
"default": "./dist/ui.js"
|
|
39
47
|
}
|
|
40
48
|
},
|
|
41
49
|
"description": "Serializable app, action, and theme config contracts for Ankhorage.",
|