@omnia/fx-models 8.0.0-dev → 8.0.1-dev

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.
@@ -0,0 +1,24 @@
1
+ export type HttpMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
2
+ export type HttpCacheOptions = "no-cache" | "reload" | "force-cache" | "only-if-cached";
3
+ export type HttpCredentials = "include" | "omit" | "same-origin";
4
+ export interface HttpInterceptOptions {
5
+ beforeRequest?: (request: HttpConfig) => HttpConfig;
6
+ afterRequest?: <T>(response: HttpResponse<T>, request: HttpConfig) => HttpResponse<T>;
7
+ }
8
+ export interface HttpConfig {
9
+ baseUrl?: string;
10
+ headers?: {
11
+ [key: string]: string;
12
+ };
13
+ cache?: HttpCacheOptions;
14
+ interceptors?: HttpInterceptOptions;
15
+ abortable?: boolean;
16
+ credentials?: HttpCredentials;
17
+ executeOnWorker?: boolean;
18
+ }
19
+ export interface HttpResponse<TData> {
20
+ data?: TData;
21
+ status: Number;
22
+ statusText: String;
23
+ ok: Boolean;
24
+ }
@@ -1,4 +1,4 @@
1
- import { BringResponse } from "./Bring";
1
+ import { HttpResponse } from "./HttpCommon";
2
2
  import { Guid } from "./Guid";
3
3
  import { WorkerProxyFunction } from "./Workers";
4
4
  export declare const WorkerProxyFuncs: {
@@ -9,6 +9,6 @@ export declare const WorkerProxyFuncs: {
9
9
  httpRequest: WorkerProxyFunction<{
10
10
  url: string;
11
11
  reqInit: Omit<RequestInit, "window" | "signal">;
12
- }, Promise<BringResponse<any>>>;
12
+ }, Promise<HttpResponse<any>>>;
13
13
  };
14
14
  };
@@ -1,4 +1,4 @@
1
- import { DynamicState, GuidValue, StronglyTypedId } from "../..";
1
+ import { ActivityRenderer, ActivityRendererReference, DynamicState, GuidValue, StronglyTypedId } from "../..";
2
2
  import { ChannelId } from "./ActivityChannel";
3
3
  import { ActivitySenderId } from "./ActivitySender";
4
4
  export type ActivityId = StronglyTypedId<number, "ActivityId">;
@@ -8,9 +8,10 @@ export declare function ActivityTypeId(id: GuidValue): ActivityTypeId;
8
8
  export interface Activity<TRenderState = DynamicState> extends ActivityBase {
9
9
  id: ActivityId;
10
10
  state: TRenderState;
11
+ renderer: ActivityRenderer | ActivityRendererReference;
11
12
  senderId: ActivitySenderId;
12
13
  }
13
- export interface ActivityResponse extends ActivityBase {
14
+ export interface ActivityWithJson extends ActivityBase {
14
15
  id: ActivityId;
15
16
  senderId: ActivitySenderId;
16
17
  stateJson: string;
@@ -24,6 +25,10 @@ export interface ActivityBase {
24
25
  expires?: Date;
25
26
  createdAt: Date;
26
27
  }
28
+ export interface ActivityRenderState<TActivityState = DynamicState, TIdentityState = DynamicState> {
29
+ activity: TActivityState;
30
+ identity: TIdentityState;
31
+ }
27
32
  export interface HubIdentityProperty {
28
33
  name: string;
29
34
  values: Array<string>;
@@ -1,3 +1,4 @@
1
+ import { VelcronAppDefinition } from "@omnia/fx-models";
1
2
  import { GuidValue, StronglyTypedId } from "../..";
2
3
  export type ActivityRendererId = StronglyTypedId<string, "ActivityRendererId">;
3
4
  export declare function ActivityRendererId(id: GuidValue): ActivityRendererId;
@@ -5,6 +6,9 @@ export interface ActivityRendererReference {
5
6
  id: ActivityRendererId;
6
7
  version: string;
7
8
  }
8
- export interface ActivityRenderer extends ActivityRendererReference {
9
+ export interface ActivityRendererWithJson extends ActivityRendererReference {
9
10
  definition: string;
10
11
  }
12
+ export interface ActivityRenderer extends ActivityRendererReference {
13
+ definition: VelcronAppDefinition;
14
+ }
@@ -1,6 +1,6 @@
1
- import { Activity, ActivityId } from "./Activity";
2
- import { ActivityRenderer, ActivityRendererId } from "./ActivityRenderer";
3
- import { IdentityActivity } from "./IdentityActivity";
1
+ import { Activity, ActivityId, ActivityWithJson } from "./Activity";
2
+ import { ActivityRenderer, ActivityRendererId, ActivityRendererWithJson } from "./ActivityRenderer";
3
+ import { IdentityActivity, IdentityActivityWithJson } from "./IdentityActivity";
4
4
  export interface FeedResult {
5
5
  renderers: {
6
6
  [key: ActivityRendererId]: ActivityRenderer;
@@ -9,3 +9,11 @@ export interface FeedResult {
9
9
  activities: Array<Activity>;
10
10
  nextStartingFromId: ActivityId;
11
11
  }
12
+ export interface FeedResultWithJson {
13
+ renderers: {
14
+ [key: ActivityRendererId]: ActivityRendererWithJson;
15
+ };
16
+ identityActivities: Array<IdentityActivityWithJson>;
17
+ activities: Array<ActivityWithJson>;
18
+ nextStartingFromId: ActivityId;
19
+ }
@@ -5,7 +5,7 @@ export * from "./Topic";
5
5
  export * from "./Workers";
6
6
  export * from "./SharedConstants";
7
7
  export * from "./WorkerProxyFuncs";
8
- export * from "./Bring";
8
+ export * from "./HttpCommon";
9
9
  export * from "./Future";
10
10
  export * from "./Tokens";
11
11
  export * from "./Tenant";
@@ -9,7 +9,7 @@ tslib_1.__exportStar(require("./Topic"), exports);
9
9
  tslib_1.__exportStar(require("./Workers"), exports);
10
10
  tslib_1.__exportStar(require("./SharedConstants"), exports);
11
11
  tslib_1.__exportStar(require("./WorkerProxyFuncs"), exports);
12
- tslib_1.__exportStar(require("./Bring"), exports);
12
+ tslib_1.__exportStar(require("./HttpCommon"), exports);
13
13
  tslib_1.__exportStar(require("./Future"), exports);
14
14
  tslib_1.__exportStar(require("./Tokens"), exports);
15
15
  tslib_1.__exportStar(require("./Tenant"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.0-dev",
4
+ "version": "8.0.1-dev",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,24 +0,0 @@
1
- export type BringMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
2
- export type BringCacheOptions = "no-cache" | "reload" | "force-cache" | "only-if-cached";
3
- export type BringCredentials = "include" | "omit" | "same-origin";
4
- export interface BringInterceptOptions {
5
- beforeRequest?: (request: BringConfig) => BringConfig;
6
- afterRequest?: <T>(response: BringResponse<T>, request: BringConfig) => BringResponse<T>;
7
- }
8
- export interface BringConfig {
9
- baseUrl?: string;
10
- headers?: {
11
- [key: string]: string;
12
- };
13
- cache?: BringCacheOptions;
14
- interceptors?: BringInterceptOptions;
15
- abortable?: boolean;
16
- credentials?: BringCredentials;
17
- executeOnWorker?: boolean;
18
- }
19
- export interface BringResponse<TData> {
20
- data?: TData;
21
- status: Number;
22
- statusText: String;
23
- ok: Boolean;
24
- }