@abyss-project/reflex 1.0.0 → 1.1.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.
Files changed (120) hide show
  1. package/dist/api/function-run.api.d.ts +2 -1
  2. package/dist/api/function-run.api.js +3 -1
  3. package/dist/api/function-run.api.js.map +1 -1
  4. package/dist/api/function-settings.api.d.ts +5 -0
  5. package/dist/api/function-settings.api.js +15 -0
  6. package/dist/api/function-settings.api.js.map +1 -0
  7. package/dist/api/function-version.api.d.ts +2 -1
  8. package/dist/api/function-version.api.js +3 -1
  9. package/dist/api/function-version.api.js.map +1 -1
  10. package/dist/api/index.d.ts +1 -0
  11. package/dist/api/index.js +1 -0
  12. package/dist/api/index.js.map +1 -1
  13. package/dist/index.d.ts +9 -0
  14. package/dist/index.js +9 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/types/enum/execution-mode.enum.d.ts +4 -0
  17. package/dist/types/enum/execution-mode.enum.js +9 -0
  18. package/dist/types/enum/execution-mode.enum.js.map +1 -0
  19. package/dist/types/enum/execution-profile.enum.d.ts +8 -0
  20. package/dist/types/enum/execution-profile.enum.js +19 -0
  21. package/dist/types/enum/execution-profile.enum.js.map +1 -0
  22. package/dist/types/enum/execution-settings-source.enum.d.ts +5 -0
  23. package/dist/types/enum/execution-settings-source.enum.js +10 -0
  24. package/dist/types/enum/execution-settings-source.enum.js.map +1 -0
  25. package/dist/types/enum/index.d.ts +5 -0
  26. package/dist/types/enum/index.js +5 -0
  27. package/dist/types/enum/index.js.map +1 -1
  28. package/dist/types/enum/run-log-level.enum.d.ts +5 -0
  29. package/dist/types/enum/run-log-level.enum.js +10 -0
  30. package/dist/types/enum/run-log-level.enum.js.map +1 -0
  31. package/dist/types/enum/run-status.enum.d.ts +3 -1
  32. package/dist/types/enum/run-status.enum.js +2 -0
  33. package/dist/types/enum/run-status.enum.js.map +1 -1
  34. package/dist/types/enum/run-step-status.enum.d.ts +5 -0
  35. package/dist/types/enum/run-step-status.enum.js +10 -0
  36. package/dist/types/enum/run-step-status.enum.js.map +1 -0
  37. package/dist/types/enum/trace-effect-type.enum.js.map +1 -1
  38. package/dist/types/interface/api/requests/function-run.request.d.ts +5 -0
  39. package/dist/types/interface/api/requests/function-settings.request.d.ts +21 -0
  40. package/dist/types/interface/api/requests/function-settings.request.js +3 -0
  41. package/dist/types/interface/api/requests/function-settings.request.js.map +1 -0
  42. package/dist/types/interface/api/requests/function-version.request.d.ts +8 -0
  43. package/dist/types/interface/api/requests/index.d.ts +1 -0
  44. package/dist/types/interface/api/requests/index.js +1 -0
  45. package/dist/types/interface/api/requests/index.js.map +1 -1
  46. package/dist/types/interface/api/responses/function-run.response.d.ts +6 -2
  47. package/dist/types/interface/api/responses/function-settings.response.d.ts +19 -0
  48. package/dist/types/interface/api/responses/function-settings.response.js +3 -0
  49. package/dist/types/interface/api/responses/function-settings.response.js.map +1 -0
  50. package/dist/types/interface/api/responses/function-version.response.d.ts +10 -1
  51. package/dist/types/interface/api/responses/index.d.ts +1 -0
  52. package/dist/types/interface/api/responses/index.js +1 -0
  53. package/dist/types/interface/api/responses/index.js.map +1 -1
  54. package/dist/types/interface/models/index.d.ts +2 -0
  55. package/dist/types/interface/models/index.js +2 -0
  56. package/dist/types/interface/models/index.js.map +1 -1
  57. package/dist/types/interface/models/reflex-execution-settings.model.d.ts +36 -0
  58. package/dist/types/interface/models/reflex-execution-settings.model.js +16 -0
  59. package/dist/types/interface/models/reflex-execution-settings.model.js.map +1 -0
  60. package/dist/types/interface/models/reflex-run.model.d.ts +52 -1
  61. package/dist/types/interface/models/reflex-step-stats.model.d.ts +22 -0
  62. package/dist/types/interface/models/reflex-step-stats.model.js +3 -0
  63. package/dist/types/interface/models/reflex-step-stats.model.js.map +1 -0
  64. package/package.json +1 -1
  65. package/src/api/function-access.api.ts +36 -36
  66. package/src/api/function-promotion.api.ts +42 -42
  67. package/src/api/function-run.api.ts +13 -1
  68. package/src/api/function-settings.api.ts +59 -0
  69. package/src/api/function-test.api.ts +33 -33
  70. package/src/api/function-trigger.api.ts +52 -52
  71. package/src/api/function-version.api.ts +19 -0
  72. package/src/api/function.api.test.ts +90 -1
  73. package/src/api/function.api.ts +62 -62
  74. package/src/api/index.ts +1 -0
  75. package/src/index.ts +17 -0
  76. package/src/types/enum/access-grant-status.enum.ts +12 -12
  77. package/src/types/enum/access-kind.enum.ts +7 -7
  78. package/src/types/enum/execution-mode.enum.ts +9 -0
  79. package/src/types/enum/execution-profile.enum.ts +20 -0
  80. package/src/types/enum/execution-settings-source.enum.ts +9 -0
  81. package/src/types/enum/index.ts +5 -0
  82. package/src/types/enum/reflex-error-code.enum.ts +19 -19
  83. package/src/types/enum/run-log-level.enum.ts +6 -0
  84. package/src/types/enum/run-mode.enum.ts +11 -11
  85. package/src/types/enum/run-status.enum.ts +7 -0
  86. package/src/types/enum/run-step-status.enum.ts +7 -0
  87. package/src/types/enum/trace-effect-type.enum.ts +6 -0
  88. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  89. package/src/types/enum/trigger-type.enum.ts +4 -4
  90. package/src/types/interface/api/index.ts +3 -3
  91. package/src/types/interface/api/requests/function-access.request.ts +25 -25
  92. package/src/types/interface/api/requests/function-promotion.request.ts +25 -25
  93. package/src/types/interface/api/requests/function-run.request.ts +7 -0
  94. package/src/types/interface/api/requests/function-settings.request.ts +27 -0
  95. package/src/types/interface/api/requests/function-test.request.ts +19 -19
  96. package/src/types/interface/api/requests/function-trigger.request.ts +28 -28
  97. package/src/types/interface/api/requests/function-version.request.ts +10 -0
  98. package/src/types/interface/api/requests/function.request.ts +34 -34
  99. package/src/types/interface/api/requests/index.ts +1 -0
  100. package/src/types/interface/api/response.ts +4 -4
  101. package/src/types/interface/api/responses/function-access.response.ts +17 -17
  102. package/src/types/interface/api/responses/function-promotion.response.ts +18 -18
  103. package/src/types/interface/api/responses/function-run.response.ts +7 -2
  104. package/src/types/interface/api/responses/function-settings.response.ts +33 -0
  105. package/src/types/interface/api/responses/function-test.response.ts +12 -12
  106. package/src/types/interface/api/responses/function-trigger.response.ts +24 -24
  107. package/src/types/interface/api/responses/function-version.response.ts +20 -1
  108. package/src/types/interface/api/responses/function.response.ts +25 -25
  109. package/src/types/interface/api/responses/index.ts +1 -0
  110. package/src/types/interface/index.ts +3 -3
  111. package/src/types/interface/models/index.ts +2 -0
  112. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  113. package/src/types/interface/models/reflex-definition.model.ts +23 -23
  114. package/src/types/interface/models/reflex-environment-pointer.model.ts +18 -18
  115. package/src/types/interface/models/reflex-execution-settings.model.ts +53 -0
  116. package/src/types/interface/models/reflex-function-version.model.ts +14 -14
  117. package/src/types/interface/models/reflex-function.model.ts +14 -14
  118. package/src/types/interface/models/reflex-run.model.ts +107 -5
  119. package/src/types/interface/models/reflex-step-stats.model.ts +35 -0
  120. package/src/types/interface/models/reflex-trigger.model.ts +17 -17
@@ -1,28 +1,28 @@
1
- import type { TriggerAccessMode } from '../../../enum';
2
-
3
- export interface IListFunctionTriggerParams {
4
- applicationId: string;
5
- functionId: string;
6
- }
7
-
8
- export interface ICreateFunctionTriggerParams {
9
- applicationId: string;
10
- functionId: string;
11
- }
12
- export interface ICreateFunctionTriggerBody {
13
- /** Segments of `[A-Za-z0-9._~-]` joined by `/`; unique within the application. */
14
- path: string;
15
- accessMode: TriggerAccessMode;
16
- }
17
-
18
- export interface IRotateFunctionTriggerParams {
19
- applicationId: string;
20
- functionId: string;
21
- triggerId: string;
22
- }
23
-
24
- export interface IDeleteFunctionTriggerParams {
25
- applicationId: string;
26
- functionId: string;
27
- triggerId: string;
28
- }
1
+ import type { TriggerAccessMode } from '../../../enum';
2
+
3
+ export interface IListFunctionTriggerParams {
4
+ applicationId: string;
5
+ functionId: string;
6
+ }
7
+
8
+ export interface ICreateFunctionTriggerParams {
9
+ applicationId: string;
10
+ functionId: string;
11
+ }
12
+ export interface ICreateFunctionTriggerBody {
13
+ /** Segments of `[A-Za-z0-9._~-]` joined by `/`; unique within the application. */
14
+ path: string;
15
+ accessMode: TriggerAccessMode;
16
+ }
17
+
18
+ export interface IRotateFunctionTriggerParams {
19
+ applicationId: string;
20
+ functionId: string;
21
+ triggerId: string;
22
+ }
23
+
24
+ export interface IDeleteFunctionTriggerParams {
25
+ applicationId: string;
26
+ functionId: string;
27
+ triggerId: string;
28
+ }
@@ -13,3 +13,13 @@ export interface IGetFunctionVersionParams {
13
13
  functionId: string;
14
14
  versionId: string;
15
15
  }
16
+
17
+ export interface IGetFunctionVersionStepStatsParams {
18
+ applicationId: string;
19
+ functionId: string;
20
+ versionId: string;
21
+ }
22
+ export interface IGetFunctionVersionStepStatsQuery {
23
+ /** Only the executions of this Monitor environment; every environment when absent. */
24
+ environmentId?: string;
25
+ }
@@ -1,34 +1,34 @@
1
- import type { IReflexDefinition } from '../../models';
2
-
3
- export interface IListFunctionParams {
4
- applicationId: string;
5
- }
6
-
7
- export interface ICreateFunctionParams {
8
- applicationId: string;
9
- }
10
- export interface ICreateFunctionBody {
11
- /** Unique within the application, 1 to 100 characters. */
12
- name: string;
13
- /** Absent: a function without access or step, to fill in. */
14
- definition?: IReflexDefinition;
15
- }
16
-
17
- export interface IGetFunctionParams {
18
- applicationId: string;
19
- functionId: string;
20
- }
21
-
22
- export interface IUpdateFunctionParams {
23
- applicationId: string;
24
- functionId: string;
25
- }
26
- export interface IUpdateFunctionBody {
27
- name?: string;
28
- definition?: IReflexDefinition;
29
- }
30
-
31
- export interface IDeleteFunctionParams {
32
- applicationId: string;
33
- functionId: string;
34
- }
1
+ import type { IReflexDefinition } from '../../models';
2
+
3
+ export interface IListFunctionParams {
4
+ applicationId: string;
5
+ }
6
+
7
+ export interface ICreateFunctionParams {
8
+ applicationId: string;
9
+ }
10
+ export interface ICreateFunctionBody {
11
+ /** Unique within the application, 1 to 100 characters. */
12
+ name: string;
13
+ /** Absent: a function without access or step, to fill in. */
14
+ definition?: IReflexDefinition;
15
+ }
16
+
17
+ export interface IGetFunctionParams {
18
+ applicationId: string;
19
+ functionId: string;
20
+ }
21
+
22
+ export interface IUpdateFunctionParams {
23
+ applicationId: string;
24
+ functionId: string;
25
+ }
26
+ export interface IUpdateFunctionBody {
27
+ name?: string;
28
+ definition?: IReflexDefinition;
29
+ }
30
+
31
+ export interface IDeleteFunctionParams {
32
+ applicationId: string;
33
+ functionId: string;
34
+ }
@@ -5,3 +5,4 @@ export * from './function-version.request';
5
5
  export * from './function-promotion.request';
6
6
  export * from './function-trigger.request';
7
7
  export * from './function-run.request';
8
+ export * from './function-settings.request';
@@ -1,4 +1,4 @@
1
- /** Every success of the API wraps its payload in `data`. */
2
- export interface IResponse<T> {
3
- data: T;
4
- }
1
+ /** Every success of the API wraps its payload in `data`. */
2
+ export interface IResponse<T> {
3
+ data: T;
4
+ }
@@ -1,17 +1,17 @@
1
- import type { IReflexAccessGrant } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListFunctionAccessData {
5
- grants: IReflexAccessGrant[];
6
- }
7
- export type IListFunctionAccessResponse = IResponse<IListFunctionAccessData>;
8
-
9
- export interface IGrantFunctionAccessData {
10
- grant: IReflexAccessGrant;
11
- }
12
- export type IGrantFunctionAccessResponse = IResponse<IGrantFunctionAccessData>;
13
-
14
- export interface IRevokeFunctionAccessData {
15
- grant: IReflexAccessGrant;
16
- }
17
- export type IRevokeFunctionAccessResponse = IResponse<IRevokeFunctionAccessData>;
1
+ import type { IReflexAccessGrant } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface IListFunctionAccessData {
5
+ grants: IReflexAccessGrant[];
6
+ }
7
+ export type IListFunctionAccessResponse = IResponse<IListFunctionAccessData>;
8
+
9
+ export interface IGrantFunctionAccessData {
10
+ grant: IReflexAccessGrant;
11
+ }
12
+ export type IGrantFunctionAccessResponse = IResponse<IGrantFunctionAccessData>;
13
+
14
+ export interface IRevokeFunctionAccessData {
15
+ grant: IReflexAccessGrant;
16
+ }
17
+ export type IRevokeFunctionAccessResponse = IResponse<IRevokeFunctionAccessData>;
@@ -1,18 +1,18 @@
1
- import type { IReflexEnvironmentPointer } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListFunctionPromotionData {
5
- /** The 200 most recent promotions, newest first; the current ones have `isCurrent`. */
6
- pointers: IReflexEnvironmentPointer[];
7
- }
8
- export type IListFunctionPromotionResponse = IResponse<IListFunctionPromotionData>;
9
-
10
- export interface IPromoteFunctionData {
11
- pointer: IReflexEnvironmentPointer;
12
- }
13
- export type IPromoteFunctionResponse = IResponse<IPromoteFunctionData>;
14
-
15
- export interface IRollbackFunctionData {
16
- pointer: IReflexEnvironmentPointer;
17
- }
18
- export type IRollbackFunctionResponse = IResponse<IRollbackFunctionData>;
1
+ import type { IReflexEnvironmentPointer } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface IListFunctionPromotionData {
5
+ /** The 200 most recent promotions, newest first; the current ones have `isCurrent`. */
6
+ pointers: IReflexEnvironmentPointer[];
7
+ }
8
+ export type IListFunctionPromotionResponse = IResponse<IListFunctionPromotionData>;
9
+
10
+ export interface IPromoteFunctionData {
11
+ pointer: IReflexEnvironmentPointer;
12
+ }
13
+ export type IPromoteFunctionResponse = IResponse<IPromoteFunctionData>;
14
+
15
+ export interface IRollbackFunctionData {
16
+ pointer: IReflexEnvironmentPointer;
17
+ }
18
+ export type IRollbackFunctionResponse = IResponse<IRollbackFunctionData>;
@@ -1,4 +1,4 @@
1
- import type { IReflexRun } from '../../models';
1
+ import type { IReflexExecutionState, IReflexRun, IReflexRunDetail } from '../../models';
2
2
  import type { IResponse } from '../response';
3
3
 
4
4
  export interface IListFunctionRunData {
@@ -8,6 +8,11 @@ export interface IListFunctionRunData {
8
8
  export type IListFunctionRunResponse = IResponse<IListFunctionRunData>;
9
9
 
10
10
  export interface IGetFunctionRunData {
11
- run: IReflexRun;
11
+ run: IReflexRunDetail;
12
12
  }
13
13
  export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
14
+
15
+ export interface IGetFunctionRunStateData {
16
+ state: IReflexExecutionState;
17
+ }
18
+ export type IGetFunctionRunStateResponse = IResponse<IGetFunctionRunStateData>;
@@ -0,0 +1,33 @@
1
+ import type {
2
+ IReflexEffectiveExecutionSettings,
3
+ IReflexExecutionSettings,
4
+ IReflexExecutionSettingsValues,
5
+ } from '../../models';
6
+ import type { IResponse } from '../response';
7
+
8
+ export interface IGetFunctionSettingsData {
9
+ /** The default of the function; null when none is set. */
10
+ default: IReflexExecutionSettings | null;
11
+ /** The override of each environment that has one. */
12
+ environments: IReflexExecutionSettings[];
13
+ /** What each Monitor environment of the application runs with. */
14
+ effective: IReflexEffectiveExecutionSettings[];
15
+ /** What applies when neither the environment nor the function sets anything. */
16
+ builtIn: IReflexExecutionSettingsValues;
17
+ }
18
+ export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
19
+
20
+ export interface ISetFunctionDefaultSettingsData {
21
+ settings: IReflexExecutionSettings;
22
+ }
23
+ export type ISetFunctionDefaultSettingsResponse = IResponse<ISetFunctionDefaultSettingsData>;
24
+
25
+ export interface ISetFunctionEnvironmentSettingsData {
26
+ settings: IReflexExecutionSettings;
27
+ }
28
+ export type ISetFunctionEnvironmentSettingsResponse =
29
+ IResponse<ISetFunctionEnvironmentSettingsData>;
30
+
31
+ export type IRemoveFunctionEnvironmentSettingsData = Record<string, never>;
32
+ export type IRemoveFunctionEnvironmentSettingsResponse =
33
+ IResponse<IRemoveFunctionEnvironmentSettingsData>;
@@ -1,12 +1,12 @@
1
- import type { IReflexRun } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface ISimulateFunctionData {
5
- run: IReflexRun;
6
- }
7
- export type ISimulateFunctionResponse = IResponse<ISimulateFunctionData>;
8
-
9
- export interface IDryRunFunctionData {
10
- run: IReflexRun;
11
- }
12
- export type IDryRunFunctionResponse = IResponse<IDryRunFunctionData>;
1
+ import type { IReflexRun } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface ISimulateFunctionData {
5
+ run: IReflexRun;
6
+ }
7
+ export type ISimulateFunctionResponse = IResponse<ISimulateFunctionData>;
8
+
9
+ export interface IDryRunFunctionData {
10
+ run: IReflexRun;
11
+ }
12
+ export type IDryRunFunctionResponse = IResponse<IDryRunFunctionData>;
@@ -1,24 +1,24 @@
1
- import type { IReflexTrigger } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListFunctionTriggerData {
5
- triggers: IReflexTrigger[];
6
- }
7
- export type IListFunctionTriggerResponse = IResponse<IListFunctionTriggerData>;
8
-
9
- export interface ICreateFunctionTriggerData {
10
- trigger: IReflexTrigger;
11
- /** The API key (API_KEY) or the signing secret (SIGNATURE), in clear, ONCE. `null` for PUBLIC. */
12
- secret: string | null;
13
- }
14
- export type ICreateFunctionTriggerResponse = IResponse<ICreateFunctionTriggerData>;
15
-
16
- export interface IRotateFunctionTriggerData {
17
- trigger: IReflexTrigger;
18
- /** The new key or signing secret, in clear, ONCE; the previous one stops working at once. */
19
- secret: string;
20
- }
21
- export type IRotateFunctionTriggerResponse = IResponse<IRotateFunctionTriggerData>;
22
-
23
- export type IDeleteFunctionTriggerData = Record<string, never>;
24
- export type IDeleteFunctionTriggerResponse = IResponse<IDeleteFunctionTriggerData>;
1
+ import type { IReflexTrigger } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface IListFunctionTriggerData {
5
+ triggers: IReflexTrigger[];
6
+ }
7
+ export type IListFunctionTriggerResponse = IResponse<IListFunctionTriggerData>;
8
+
9
+ export interface ICreateFunctionTriggerData {
10
+ trigger: IReflexTrigger;
11
+ /** The API key (API_KEY) or the signing secret (SIGNATURE), in clear, ONCE. `null` for PUBLIC. */
12
+ secret: string | null;
13
+ }
14
+ export type ICreateFunctionTriggerResponse = IResponse<ICreateFunctionTriggerData>;
15
+
16
+ export interface IRotateFunctionTriggerData {
17
+ trigger: IReflexTrigger;
18
+ /** The new key or signing secret, in clear, ONCE; the previous one stops working at once. */
19
+ secret: string;
20
+ }
21
+ export type IRotateFunctionTriggerResponse = IResponse<IRotateFunctionTriggerData>;
22
+
23
+ export type IDeleteFunctionTriggerData = Record<string, never>;
24
+ export type IDeleteFunctionTriggerResponse = IResponse<IDeleteFunctionTriggerData>;
@@ -1,4 +1,8 @@
1
- import type { IReflexFunctionVersion } from '../../models';
1
+ import type {
2
+ IReflexFunctionVersion,
3
+ IReflexRunningVersionHeapPeaks,
4
+ IReflexStepStats,
5
+ } from '../../models';
2
6
  import type { IResponse } from '../response';
3
7
 
4
8
  export interface IListFunctionVersionData {
@@ -15,3 +19,18 @@ export interface IGetFunctionVersionData {
15
19
  version: IReflexFunctionVersion;
16
20
  }
17
21
  export type IGetFunctionVersionResponse = IResponse<IGetFunctionVersionData>;
22
+
23
+ export interface IGetFunctionVersionStepStatsData {
24
+ versionId: string;
25
+ /** The environment asked for; null for every environment. */
26
+ environmentId: string | null;
27
+ /** The window the statistics cover: the retention of the live runs. */
28
+ windowDays: number;
29
+ /** Executions of the version in the window, interrupted and running ones left out. */
30
+ executions: number;
31
+ /** One entry per step that ran, most costly first. */
32
+ steps: IReflexStepStats[];
33
+ /** The p99 heap peak per step of the version running in `environmentId`; null without an environment or when nothing runs there. */
34
+ runningVersion: IReflexRunningVersionHeapPeaks | null;
35
+ }
36
+ export type IGetFunctionVersionStepStatsResponse = IResponse<IGetFunctionVersionStepStatsData>;
@@ -1,25 +1,25 @@
1
- import type { IReflexFunction } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListFunctionData {
5
- functions: IReflexFunction[];
6
- }
7
- export type IListFunctionResponse = IResponse<IListFunctionData>;
8
-
9
- export interface ICreateFunctionData {
10
- function: IReflexFunction;
11
- }
12
- export type ICreateFunctionResponse = IResponse<ICreateFunctionData>;
13
-
14
- export interface IGetFunctionData {
15
- function: IReflexFunction;
16
- }
17
- export type IGetFunctionResponse = IResponse<IGetFunctionData>;
18
-
19
- export interface IUpdateFunctionData {
20
- function: IReflexFunction;
21
- }
22
- export type IUpdateFunctionResponse = IResponse<IUpdateFunctionData>;
23
-
24
- export type IDeleteFunctionData = Record<string, never>;
25
- export type IDeleteFunctionResponse = IResponse<IDeleteFunctionData>;
1
+ import type { IReflexFunction } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface IListFunctionData {
5
+ functions: IReflexFunction[];
6
+ }
7
+ export type IListFunctionResponse = IResponse<IListFunctionData>;
8
+
9
+ export interface ICreateFunctionData {
10
+ function: IReflexFunction;
11
+ }
12
+ export type ICreateFunctionResponse = IResponse<ICreateFunctionData>;
13
+
14
+ export interface IGetFunctionData {
15
+ function: IReflexFunction;
16
+ }
17
+ export type IGetFunctionResponse = IResponse<IGetFunctionData>;
18
+
19
+ export interface IUpdateFunctionData {
20
+ function: IReflexFunction;
21
+ }
22
+ export type IUpdateFunctionResponse = IResponse<IUpdateFunctionData>;
23
+
24
+ export type IDeleteFunctionData = Record<string, never>;
25
+ export type IDeleteFunctionResponse = IResponse<IDeleteFunctionData>;
@@ -5,3 +5,4 @@ export * from './function-version.response';
5
5
  export * from './function-promotion.response';
6
6
  export * from './function-trigger.response';
7
7
  export * from './function-run.response';
8
+ export * from './function-settings.response';
@@ -1,3 +1,3 @@
1
- export * from './health.response';
2
- export * from './models';
3
- export * from './api';
1
+ export * from './health.response';
2
+ export * from './models';
3
+ export * from './api';
@@ -5,3 +5,5 @@ export * from './reflex-environment-pointer.model';
5
5
  export * from './reflex-trigger.model';
6
6
  export * from './reflex-access-grant.model';
7
7
  export * from './reflex-run.model';
8
+ export * from './reflex-execution-settings.model';
9
+ export * from './reflex-step-stats.model';
@@ -1,14 +1,14 @@
1
- import type { AccessGrantStatus } from '../../enum';
2
- import type { IReflexAccessDeclaration } from './reflex-definition.model';
3
-
4
- export interface IReflexAccessGrant {
5
- id: string;
6
- functionId: string;
7
- declaration: IReflexAccessDeclaration;
8
- status: AccessGrantStatus;
9
- grantedByUserId: string;
10
- grantedAt: Date;
11
- suspendedAt: Date | null;
12
- revokedByUserId: string | null;
13
- revokedAt: Date | null;
14
- }
1
+ import type { AccessGrantStatus } from '../../enum';
2
+ import type { IReflexAccessDeclaration } from './reflex-definition.model';
3
+
4
+ export interface IReflexAccessGrant {
5
+ id: string;
6
+ functionId: string;
7
+ declaration: IReflexAccessDeclaration;
8
+ status: AccessGrantStatus;
9
+ grantedByUserId: string;
10
+ grantedAt: Date;
11
+ suspendedAt: Date | null;
12
+ revokedByUserId: string | null;
13
+ revokedAt: Date | null;
14
+ }
@@ -1,23 +1,23 @@
1
- import type { ReflexAccessKind } from '../../enum';
2
-
3
- export interface IReflexHttpAccess {
4
- kind: ReflexAccessKind.HTTP;
5
- hosts: string[];
6
- }
7
-
8
- export interface IReflexHostActionAccess {
9
- kind: ReflexAccessKind.HOST_ACTION;
10
- action: string;
11
- }
12
-
13
- export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
14
-
15
- /**
16
- * A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
17
- * the core's own and validated by the API; the SDK only carries them.
18
- */
19
- export interface IReflexDefinition {
20
- formatVersion: number;
21
- accesses: IReflexAccessDeclaration[];
22
- steps: Array<Record<string, unknown>>;
23
- }
1
+ import type { ReflexAccessKind } from '../../enum';
2
+
3
+ export interface IReflexHttpAccess {
4
+ kind: ReflexAccessKind.HTTP;
5
+ hosts: string[];
6
+ }
7
+
8
+ export interface IReflexHostActionAccess {
9
+ kind: ReflexAccessKind.HOST_ACTION;
10
+ action: string;
11
+ }
12
+
13
+ export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
14
+
15
+ /**
16
+ * A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
17
+ * the core's own and validated by the API; the SDK only carries them.
18
+ */
19
+ export interface IReflexDefinition {
20
+ formatVersion: number;
21
+ accesses: IReflexAccessDeclaration[];
22
+ steps: Array<Record<string, unknown>>;
23
+ }
@@ -1,18 +1,18 @@
1
- import type { IReflexAccessDeclaration } from './reflex-definition.model';
2
-
3
- /** One promotion of a version into a Monitor environment. The `isCurrent` one is what runs. */
4
- export interface IReflexEnvironmentPointer {
5
- id: string;
6
- functionId: string;
7
- /** The Monitor environment of the application. */
8
- environmentId: string;
9
- /** The name of that environment, which the trigger's address carries. */
10
- environmentSlug: string;
11
- versionId: string;
12
- versionNumber: number;
13
- /** The accesses that were granted when the version was promoted. */
14
- grants: IReflexAccessDeclaration[];
15
- isCurrent: boolean;
16
- promotedByUserId: string;
17
- promotedAt: Date;
18
- }
1
+ import type { IReflexAccessDeclaration } from './reflex-definition.model';
2
+
3
+ /** One promotion of a version into a Monitor environment. The `isCurrent` one is what runs. */
4
+ export interface IReflexEnvironmentPointer {
5
+ id: string;
6
+ functionId: string;
7
+ /** The Monitor environment of the application. */
8
+ environmentId: string;
9
+ /** The name of that environment, which the trigger's address carries. */
10
+ environmentSlug: string;
11
+ versionId: string;
12
+ versionNumber: number;
13
+ /** The accesses that were granted when the version was promoted. */
14
+ grants: IReflexAccessDeclaration[];
15
+ isCurrent: boolean;
16
+ promotedByUserId: string;
17
+ promotedAt: Date;
18
+ }
@@ -0,0 +1,53 @@
1
+ import { ExecutionMode, ExecutionProfile } from '../../enum';
2
+ import type { ExecutionSettingsSource } from '../../enum';
3
+
4
+ /** The execution settings of a function in an environment. */
5
+ export interface IReflexExecutionSettingsValues {
6
+ profile: ExecutionProfile;
7
+ /** One core reserved for the execution; the CPU part of the cost is multiplied by 1.5. */
8
+ guaranteedCpu: boolean;
9
+ /** Past this, a synchronous caller that got no answer receives 504 and the execution goes on. */
10
+ responseTimeoutMs: number;
11
+ /** Past this, the execution is stopped with TIMEOUT. */
12
+ maxDurationMs: number;
13
+ mode: ExecutionMode;
14
+ }
15
+
16
+ /** Bounds of the settings, in milliseconds. */
17
+ export const REFLEX_EXECUTION_SETTINGS_LIMITS = {
18
+ responseTimeoutMs: { min: 1_000, max: 100_000 },
19
+ maxDurationMs: { min: 1_000, max: 3_600_000 },
20
+ } as const;
21
+
22
+ /** What a function runs with when nothing is set. */
23
+ export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSettingsValues> = {
24
+ profile: ExecutionProfile.S,
25
+ guaranteedCpu: false,
26
+ responseTimeoutMs: 30_000,
27
+ maxDurationMs: 30_000,
28
+ mode: ExecutionMode.SYNC,
29
+ };
30
+
31
+ /** A row of settings: the default of the function (`environmentId` null) or the override of one environment. */
32
+ export interface IReflexExecutionSettings extends IReflexExecutionSettingsValues {
33
+ id: string;
34
+ functionId: string;
35
+ /** A Monitor environment of the application; null for the default of every environment. */
36
+ environmentId: string | null;
37
+ updatedByUserId: string;
38
+ createdAt: Date;
39
+ updatedAt: Date;
40
+ }
41
+
42
+ /** What one Monitor environment of the application runs with. */
43
+ export interface IReflexEffectiveExecutionSettings {
44
+ environmentId: string;
45
+ /** The name of the environment in Monitor. */
46
+ environmentSlug: string;
47
+ /** Changing what a production environment runs with needs REFLEX_PUBLISH_PRODUCTION. */
48
+ isProduction: boolean;
49
+ source: ExecutionSettingsSource;
50
+ settings: IReflexExecutionSettingsValues;
51
+ /** The version promoted in this environment, whose step statistics drive the profile warning; null when none. */
52
+ runningVersionId: string | null;
53
+ }
@@ -1,14 +1,14 @@
1
- import type { IReflexDefinition } from './reflex-definition.model';
2
-
3
- export interface IReflexFunctionVersion {
4
- id: string;
5
- functionId: string;
6
- /** 1, 2, 3...: counted per function. */
7
- number: number;
8
- /** The frozen definition. */
9
- definition: IReflexDefinition;
10
- /** SHA-256 of the definition, lowercase hex. */
11
- hash: string;
12
- publishedByUserId: string;
13
- publishedAt: Date;
14
- }
1
+ import type { IReflexDefinition } from './reflex-definition.model';
2
+
3
+ export interface IReflexFunctionVersion {
4
+ id: string;
5
+ functionId: string;
6
+ /** 1, 2, 3...: counted per function. */
7
+ number: number;
8
+ /** The frozen definition. */
9
+ definition: IReflexDefinition;
10
+ /** SHA-256 of the definition, lowercase hex. */
11
+ hash: string;
12
+ publishedByUserId: string;
13
+ publishedAt: Date;
14
+ }