@abyss-project/reflex 5.5.0 → 5.6.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.
@@ -16,5 +16,7 @@ export declare enum ReflexErrorCode {
16
16
  DISCORD_COMMAND_CONFLICT = "DISCORD_COMMAND_CONFLICT",
17
17
  DISCORD_COMPONENT_PREFIX_CONFLICT = "DISCORD_COMPONENT_PREFIX_CONFLICT",
18
18
  SERVICE_TYPE_FIELD_REFUSED = "SERVICE_TYPE_FIELD_REFUSED",
19
- ROUTE_SEGMENT_RESERVED = "ROUTE_SEGMENT_RESERVED"
19
+ ROUTE_SEGMENT_RESERVED = "ROUTE_SEGMENT_RESERVED",
20
+ CREDIT_OVERAGE_NOT_ALLOWED = "CREDIT_OVERAGE_NOT_ALLOWED",
21
+ BOT_EVENT_RESERVE_EXCEEDED = "BOT_EVENT_RESERVE_EXCEEDED"
20
22
  }
@@ -21,5 +21,7 @@ var ReflexErrorCode;
21
21
  ReflexErrorCode["DISCORD_COMPONENT_PREFIX_CONFLICT"] = "DISCORD_COMPONENT_PREFIX_CONFLICT";
22
22
  ReflexErrorCode["SERVICE_TYPE_FIELD_REFUSED"] = "SERVICE_TYPE_FIELD_REFUSED";
23
23
  ReflexErrorCode["ROUTE_SEGMENT_RESERVED"] = "ROUTE_SEGMENT_RESERVED";
24
+ ReflexErrorCode["CREDIT_OVERAGE_NOT_ALLOWED"] = "CREDIT_OVERAGE_NOT_ALLOWED";
25
+ ReflexErrorCode["BOT_EVENT_RESERVE_EXCEEDED"] = "BOT_EVENT_RESERVE_EXCEEDED";
24
26
  })(ReflexErrorCode || (exports.ReflexErrorCode = ReflexErrorCode = {}));
25
27
  //# sourceMappingURL=reflex-error-code.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reflex-error-code.enum.js","sourceRoot":"","sources":["../../../src/types/enum/reflex-error-code.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,eAqCX;AArCD,WAAY,eAAe;IAEzB,4DAAyC,CAAA;IAEzC,sDAAmC,CAAA;IAEnC,4CAAyB,CAAA;IAEzB,8DAA2C,CAAA;IAE3C,kEAA+C,CAAA;IAE/C,oDAAiC,CAAA;IAEjC,8EAA2D,CAAA;IAE3D,oDAAiC,CAAA;IAEjC,8DAA2C,CAAA;IAE3C,oDAAiC,CAAA;IAEjC,0DAAuC,CAAA;IAEvC,kEAA+C,CAAA;IAE/C,oEAAiD,CAAA;IAEjD,8EAA2D,CAAA;IAE3D,wEAAqD,CAAA;IAErD,0FAAuE,CAAA;IAEvE,4EAAyD,CAAA;IAEzD,oEAAiD,CAAA;AACnD,CAAC,EArCW,eAAe,+BAAf,eAAe,QAqC1B"}
1
+ {"version":3,"file":"reflex-error-code.enum.js","sourceRoot":"","sources":["../../../src/types/enum/reflex-error-code.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,eAyCX;AAzCD,WAAY,eAAe;IAEzB,4DAAyC,CAAA;IAEzC,sDAAmC,CAAA;IAEnC,4CAAyB,CAAA;IAEzB,8DAA2C,CAAA;IAE3C,kEAA+C,CAAA;IAE/C,oDAAiC,CAAA;IAEjC,8EAA2D,CAAA;IAE3D,oDAAiC,CAAA;IAEjC,8DAA2C,CAAA;IAE3C,oDAAiC,CAAA;IAEjC,0DAAuC,CAAA;IAEvC,kEAA+C,CAAA;IAE/C,oEAAiD,CAAA;IAEjD,8EAA2D,CAAA;IAE3D,wEAAqD,CAAA;IAErD,0FAAuE,CAAA;IAEvE,4EAAyD,CAAA;IAEzD,oEAAiD,CAAA;IAEjD,4EAAyD,CAAA;IAEzD,4EAAyD,CAAA;AAC3D,CAAC,EAzCW,eAAe,+BAAf,eAAe,QAyC1B"}
@@ -4,9 +4,9 @@ export interface IServiceDiscordEnvironmentEvents {
4
4
  activeIntents: number;
5
5
  privilegedIntentsRequested: number[];
6
6
  intentsDisallowedSince: Date | null;
7
- rate: IReflexBotEventRate;
7
+ rate: IReflexBotEventRate | null;
8
8
  rateExcess: IReflexBotRateExcess;
9
- credits: IReflexBotCredits;
9
+ credits: IReflexBotCredits | null;
10
10
  monthlySpendCap: IReflexBotMonthlySpendCap;
11
11
  alerts: IReflexBotAlerts;
12
12
  block: IReflexBotBlock | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/reflex",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "description": "Core package to interact with AbyssReflex",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,39 +1,43 @@
1
- /** `error.code` of the refusals a client acts on. */
2
- export enum ReflexErrorCode {
3
- /** 400: the definition does not match the format; `error.details` holds the path of each fault. */
4
- INVALID_DEFINITION = 'INVALID_DEFINITION',
5
- /** 409: an access granted to the function is suspended; revoke it and grant it again. */
6
- GRANT_SUSPENDED = 'GRANT_SUSPENDED',
7
- /** 409: the function has no frozen version of its own draft yet, or none to go back to. */
8
- NO_VERSION = 'NO_VERSION',
9
- /** 409: the access to grant is not declared by the draft of the function. */
10
- ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
11
- /** 404: the environment is not one of the application's environments (abyss-main). */
12
- ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
13
- /** 409: a name, a path or an access already exists. */
14
- ALREADY_EXISTS = 'ALREADY_EXISTS',
15
- /** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
16
- PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
17
- /** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
18
- SERVICE_PAUSED = 'SERVICE_PAUSED',
19
- /** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
20
- RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
21
- /** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
22
- ROUTE_CONFLICT = 'ROUTE_CONFLICT',
23
- /** 409: the Service has not changed since its last version. */
24
- VERSION_UNCHANGED = 'VERSION_UNCHANGED',
25
- /** 409: the Discord bot token has no value in this environment's Vault entry. */
26
- DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
27
- /** 409: Discord refused the bot token (401). */
28
- DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
29
- /** 409: a non-production environment needs a test server before a Discord bot goes live there. */
30
- DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
31
- /** 409: a command of that name already exists in the Service. */
32
- DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
33
- /** 409: the component prefix equals, starts or is started by another prefix of the Service. */
34
- DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
35
- /** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
36
- SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
37
- /** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
38
- ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
39
- }
1
+ /** `error.code` of the refusals a client acts on. */
2
+ export enum ReflexErrorCode {
3
+ /** 400: the definition does not match the format; `error.details` holds the path of each fault. */
4
+ INVALID_DEFINITION = 'INVALID_DEFINITION',
5
+ /** 409: an access granted to the function is suspended; revoke it and grant it again. */
6
+ GRANT_SUSPENDED = 'GRANT_SUSPENDED',
7
+ /** 409: the function has no frozen version of its own draft yet, or none to go back to. */
8
+ NO_VERSION = 'NO_VERSION',
9
+ /** 409: the access to grant is not declared by the draft of the function. */
10
+ ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
11
+ /** 404: the environment is not one of the application's environments (abyss-main). */
12
+ ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
13
+ /** 409: a name, a path or an access already exists. */
14
+ ALREADY_EXISTS = 'ALREADY_EXISTS',
15
+ /** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
16
+ PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
17
+ /** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
18
+ SERVICE_PAUSED = 'SERVICE_PAUSED',
19
+ /** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
20
+ RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
21
+ /** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
22
+ ROUTE_CONFLICT = 'ROUTE_CONFLICT',
23
+ /** 409: the Service has not changed since its last version. */
24
+ VERSION_UNCHANGED = 'VERSION_UNCHANGED',
25
+ /** 409: the Discord bot token has no value in this environment's Vault entry. */
26
+ DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
27
+ /** 409: Discord refused the bot token (401). */
28
+ DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
29
+ /** 409: a non-production environment needs a test server before a Discord bot goes live there. */
30
+ DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
31
+ /** 409: a command of that name already exists in the Service. */
32
+ DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
33
+ /** 409: the component prefix equals, starts or is started by another prefix of the Service. */
34
+ DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
35
+ /** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
36
+ SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
37
+ /** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
38
+ ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
39
+ /** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
40
+ CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
41
+ /** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
42
+ BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
43
+ }
@@ -21,12 +21,15 @@ export interface IServiceDiscordEnvironmentEvents {
21
21
  privilegedIntentsRequested: number[];
22
22
  /** Since when Discord refuses the intents (`INTENTS_DISALLOWED`, close code 4014); null otherwise. */
23
23
  intentsDisallowedSince: Date | null;
24
- /** Events per minute, concurrency and the lots of the reserve. */
25
- rate: IReflexBotEventRate;
24
+ /**
25
+ * Events per minute, concurrency and the lots of the reserve; null while abyss-main, which holds the plan and the
26
+ * reserve, does not answer (the screen shows them as unknown).
27
+ */
28
+ rate: IReflexBotEventRate | null;
26
29
  /** Minutes above the alert percent, peak and minutes at the cap. */
27
30
  rateExcess: IReflexBotRateExcess;
28
- /** Credits of the month and the overage setting. */
29
- credits: IReflexBotCredits;
31
+ /** Credits of the month and the overage setting; null while abyss-main does not answer. */
32
+ credits: IReflexBotCredits | null;
30
33
  monthlySpendCap: IReflexBotMonthlySpendCap;
31
34
  alerts: IReflexBotAlerts;
32
35
  /** What stops the events at the Gateway; null when nothing does. */