@distilled.cloud/fly-io 1.0.0-rc.14 → 1.0.0-rc.16
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/lib/credentials.d.ts +3 -3
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +43 -38
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +24 -24
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +37 -37
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +31 -31
- package/lib/pagination.d.ts +1 -1
- package/lib/pagination.js +3 -3
- package/lib/protocol.d.ts +2 -2
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +89 -66
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +26 -25
- package/lib/retry.js.map +1 -1
- package/lib/services/addons.d.ts +0 -65
- package/lib/services/addons.d.ts.map +1 -1
- package/lib/services/addons.js +54 -561
- package/lib/services/machines.d.ts +25 -444
- package/lib/services/machines.d.ts.map +1 -1
- package/lib/services/machines.js +317 -2726
- package/lib/services/mpg.d.ts +1 -67
- package/lib/services/mpg.d.ts.map +1 -1
- package/lib/services/mpg.js +75 -448
- package/lib/services/sprites.d.ts +1 -125
- package/lib/services/sprites.d.ts.map +1 -1
- package/lib/services/sprites.js +146 -884
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +14 -14
- package/lib/traits.js.map +1 -1
- package/package.json +13 -9
- package/src/credentials.ts +18 -15
- package/src/errors.ts +26 -28
- package/src/index.ts +2 -2
- package/src/pagination.ts +1 -1
- package/src/protocol.ts +67 -36
- package/src/retry.ts +6 -4
- package/src/services/addons.ts +593 -692
- package/src/services/machines.ts +3332 -3364
- package/src/services/mpg.ts +582 -519
- package/src/services/sprites.ts +1008 -948
- package/src/traits.ts +8 -4
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -126
- package/lib/protocol.test.js.map +0 -1
- package/lib/services/addons.js.map +0 -1
- package/lib/services/machines.js.map +0 -1
- package/lib/services/mpg.js.map +0 -1
- package/lib/services/sprites.js.map +0 -1
- package/lib/sprites-mint.test.d.ts +0 -2
- package/lib/sprites-mint.test.d.ts.map +0 -1
- package/lib/sprites-mint.test.js +0 -169
- package/lib/sprites-mint.test.js.map +0 -1
- package/src/protocol.test.ts +0 -214
- package/src/sprites-mint.test.ts +0 -228
package/lib/credentials.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ import * as Redacted from "effect/Redacted";
|
|
|
10
10
|
export declare const DEFAULT_API_BASE_URL = "https://api.machines.dev";
|
|
11
11
|
/** UI-EX REST + GraphQL host (MPG, Tigris, Redis). Not overridable via an invented env var. */
|
|
12
12
|
export declare const DEFAULT_FLY_API_BASE_URL = "https://api.fly.io";
|
|
13
|
-
/** Sprites REST root. Auth is a bearer minted from `FLY_API_TOKEN`
|
|
13
|
+
/** Sprites REST root. Auth is a bearer minted from `FLY_API_TOKEN` -- never `SPRITES_TOKEN`. */
|
|
14
14
|
export declare const DEFAULT_SPRITES_API_BASE_URL = "https://api.sprites.dev/v1";
|
|
15
15
|
/**
|
|
16
16
|
* Normalize a Fly API hostname into the Machines API base URL.
|
|
17
17
|
*
|
|
18
|
-
* - unset / empty
|
|
18
|
+
* - unset / empty -> `https://api.machines.dev`
|
|
19
19
|
* - trailing slashes stripped
|
|
20
20
|
* - a trailing `/v1` is dropped: `flyctl` and older consumers set
|
|
21
21
|
* `FLY_API_HOSTNAME` to the `/v1` root, and the routes already carry it
|
|
@@ -26,7 +26,7 @@ export interface Config {
|
|
|
26
26
|
readonly apiBaseUrl: string;
|
|
27
27
|
}
|
|
28
28
|
declare const Credentials_base: Context.ServiceClass<Credentials, "Fly-ioCredentials", Effect.Effect<Config, never, never>>;
|
|
29
|
-
export declare class Credentials extends Credentials_base {
|
|
29
|
+
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
30
30
|
}
|
|
31
31
|
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
32
32
|
/** Convenience layer from a redacted API token + optional base URL. */
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,gGAAgG;AAChG,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,cAAe,MAAM,KAAG,MAKvD,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAErB;CAAG;AAWN,eAAO,MAAM,kBAAkB,wCAe9B,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import * as EffectConfig from "@distilled.cloud/core/config";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
16
17
|
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
17
|
-
import * as EffectConfig from "effect/Config";
|
|
18
18
|
import * as Context from "effect/Context";
|
|
19
19
|
import * as Effect from "effect/Effect";
|
|
20
20
|
import * as Layer from "effect/Layer";
|
|
21
21
|
import * as Redacted from "effect/Redacted";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
27
|
export const DEFAULT_API_BASE_URL = "https://api.machines.dev";
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
export const DEFAULT_FLY_API_BASE_URL = "https://api.fly.io";
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
export const DEFAULT_SPRITES_API_BASE_URL = "https://api.sprites.dev/v1";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
40
|
export const normalizeApiBaseUrl = (hostname) => {
|
|
41
41
|
if (hostname === undefined)
|
|
42
42
|
return DEFAULT_API_BASE_URL;
|
|
@@ -45,19 +45,24 @@ export const normalizeApiBaseUrl = (hostname) => {
|
|
|
45
45
|
return DEFAULT_API_BASE_URL;
|
|
46
46
|
return trimmed.endsWith("/v1") ? trimmed.slice(0, -3) : trimmed;
|
|
47
47
|
};
|
|
48
|
-
export class Credentials extends Context.Service()("Fly-ioCredentials") {
|
|
48
|
+
export class Credentials extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("Fly-ioCredentials") {
|
|
49
49
|
}
|
|
50
|
-
const envConfig = EffectConfig.all({
|
|
51
|
-
apiKey: EffectConfig.String("FLY_API_TOKEN").pipe(
|
|
52
|
-
|
|
50
|
+
const envConfig = /*@__PURE__*/ EffectConfig.all({
|
|
51
|
+
apiKey: /*@__PURE__*/ EffectConfig.String("FLY_API_TOKEN").pipe(
|
|
52
|
+
/*@__PURE__*/ EffectConfig.orElse(() => EffectConfig.String("FLY_IO_API_KEY"))),
|
|
53
|
+
apiBaseUrl: /*@__PURE__*/ EffectConfig.String("FLY_API_HOSTNAME").pipe(
|
|
54
|
+
/*@__PURE__*/ EffectConfig.withDefault("")),
|
|
53
55
|
});
|
|
54
|
-
export const CredentialsFromEnv = Layer.succeed(Credentials,
|
|
56
|
+
export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(Credentials,
|
|
57
|
+
/*@__PURE__*/ envConfig.pipe(
|
|
58
|
+
/*@__PURE__*/ Effect.mapError(() => new ConfigError({
|
|
55
59
|
message: "FLY_API_TOKEN (or FLY_IO_API_KEY) environment variable is required",
|
|
56
|
-
})),
|
|
60
|
+
})),
|
|
61
|
+
/*@__PURE__*/ Effect.map(({ apiKey, apiBaseUrl }) => ({
|
|
57
62
|
apiKey: Redacted.make(apiKey),
|
|
58
63
|
apiBaseUrl: normalizeApiBaseUrl(apiBaseUrl || undefined),
|
|
59
64
|
})), Effect.orDie));
|
|
60
|
-
|
|
65
|
+
|
|
61
66
|
export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
62
67
|
apiKey: config.apiKey,
|
|
63
68
|
apiBaseUrl: normalizeApiBaseUrl(config.apiBaseUrl),
|
package/lib/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAC7D;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,gGAAgG;AAChG,MAAM,CAAC,MAAM,4BAA4B,GAAG,4BAA4B,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAiB,EAAU,EAAE;IAC/D,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,o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CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,UAAU,EAAE,mBAAmB,CAAC,UAAU,IAAI,SAAS,CAAC;CACzD,CAAC,CAAC,EACH,MAAM,CAAC,KAAK,CACb,CACF,CAAC;AAEF,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAG3B,EAA4B,EAAE,CAC7B,KAAK,CAAC,OAAO,CACX,WAAW,EACX,MAAM,CAAC,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC;CACnD,CAAC,CACH,CAAC"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -9,37 +9,37 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
11
11
|
import type { DefaultErrors as CoreDefaultErrors } from "@distilled.cloud/core/errors";
|
|
12
|
-
import * as Schema from "
|
|
13
|
-
declare const UnknownFlyIoError_base: Schema.
|
|
14
|
-
readonly code: Schema.optional<Schema.String>;
|
|
15
|
-
readonly message: Schema.optional<Schema.String>;
|
|
16
|
-
readonly body: Schema.Unknown;
|
|
17
|
-
}
|
|
12
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
13
|
+
declare const UnknownFlyIoError_base: Schema.TaggedErrorClass<"UnknownFlyIoError", {
|
|
14
|
+
readonly code: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
15
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
|
+
readonly body: import("effect/Schema").Unknown;
|
|
17
|
+
}> & (new (...args: any[]) => {
|
|
18
18
|
"@distilled.cloud/error/categories": {
|
|
19
19
|
ServerError: true;
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
/**
|
|
23
|
-
* Unknown Fly.io error
|
|
23
|
+
* Unknown Fly.io error -- returned when a failure matches no status-mapped
|
|
24
24
|
* error class. Carries the raw body for later cataloging.
|
|
25
25
|
*/
|
|
26
|
-
export declare class UnknownFlyIoError extends UnknownFlyIoError_base {
|
|
26
|
+
export declare class UnknownFlyIoError extends /*@__PURE__*/ UnknownFlyIoError_base {
|
|
27
27
|
}
|
|
28
|
-
declare const FlyIoParseError_base: Schema.
|
|
29
|
-
readonly body: Schema.Unknown;
|
|
30
|
-
readonly cause: Schema.Unknown;
|
|
31
|
-
}
|
|
28
|
+
declare const FlyIoParseError_base: Schema.TaggedErrorClass<"FlyIoParseError", {
|
|
29
|
+
readonly body: import("effect/Schema").Unknown;
|
|
30
|
+
readonly cause: import("effect/Schema").Unknown;
|
|
31
|
+
}> & (new (...args: any[]) => {
|
|
32
32
|
"@distilled.cloud/error/categories": {
|
|
33
33
|
ParseError: true;
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
/** Schema parse error wrapper. */
|
|
37
|
-
export declare class FlyIoParseError extends FlyIoParseError_base {
|
|
37
|
+
export declare class FlyIoParseError extends /*@__PURE__*/ FlyIoParseError_base {
|
|
38
38
|
}
|
|
39
|
-
declare const SpritesNotEnabled_base: Schema.
|
|
40
|
-
readonly code: Schema.optional<Schema.Int>;
|
|
41
|
-
readonly message: Schema.optional<Schema.String>;
|
|
42
|
-
}
|
|
39
|
+
declare const SpritesNotEnabled_base: Schema.TaggedErrorClass<"SpritesNotEnabled", {
|
|
40
|
+
readonly code: import("effect/Schema").optional<import("effect/Schema").Int>;
|
|
41
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
42
|
+
}> & (new (...args: any[]) => {
|
|
43
43
|
"@distilled.cloud/error/categories": {
|
|
44
44
|
AuthError: true;
|
|
45
45
|
};
|
|
@@ -49,14 +49,14 @@ declare const SpritesNotEnabled_base: Schema.Class<SpritesNotEnabled, Schema.Tag
|
|
|
49
49
|
*
|
|
50
50
|
* Returned by `POST /v1/organizations/{org}/tokens` as HTTP 401 with a
|
|
51
51
|
* message matching `sprites not enabled`. Sprite CRUD never sees a
|
|
52
|
-
* `SPRITES_TOKEN`
|
|
52
|
+
* `SPRITES_TOKEN` -- this is the mint-time entitlement signal.
|
|
53
53
|
*/
|
|
54
|
-
export declare class SpritesNotEnabled extends SpritesNotEnabled_base {
|
|
54
|
+
export declare class SpritesNotEnabled extends /*@__PURE__*/ SpritesNotEnabled_base {
|
|
55
55
|
}
|
|
56
|
-
declare const CreateExtensionTosAgreementNotAuthorized_base: Schema.
|
|
57
|
-
readonly code: Schema.optional<Schema.Int>;
|
|
58
|
-
readonly message: Schema.optional<Schema.String>;
|
|
59
|
-
}
|
|
56
|
+
declare const CreateExtensionTosAgreementNotAuthorized_base: Schema.TaggedErrorClass<"CreateExtensionTosAgreementNotAuthorized", {
|
|
57
|
+
readonly code: import("effect/Schema").optional<import("effect/Schema").Int>;
|
|
58
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
59
|
+
}> & (new (...args: any[]) => {
|
|
60
60
|
"@distilled.cloud/error/categories": {
|
|
61
61
|
AuthError: true;
|
|
62
62
|
};
|
|
@@ -66,7 +66,7 @@ declare const CreateExtensionTosAgreementNotAuthorized_base: Schema.Class<Create
|
|
|
66
66
|
* (`createExtensionTosAgreement`). GraphQL returns this as a 200
|
|
67
67
|
* with `Not authorized to access this createextensiontosagreement`.
|
|
68
68
|
*/
|
|
69
|
-
export declare class CreateExtensionTosAgreementNotAuthorized extends CreateExtensionTosAgreementNotAuthorized_base {
|
|
69
|
+
export declare class CreateExtensionTosAgreementNotAuthorized extends /*@__PURE__*/ CreateExtensionTosAgreementNotAuthorized_base {
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Errors any Fly.io operation may surface in addition to the status-mapped
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;;;;AAGlE;;;GAGG;AACH,qBAAa,iBACX,SAAQ,aAAa,CAAC,sBAIW;CAAG;;;;;;;;;AAEtC,kCAAkC;AAClC,qBAAa,eACX,SAAQ,aAAa,CAAC,oBAGU;CAAG;;;;;;;;;AAErC;;;;;;GAMG;AACH,qBAAa,iBACX,SAAQ,aAAa,CAAC,sBAGS;CAAG;;;;;;;;;AAKpC;;;;GAIG;AACH,qBAAa,wCACX,SAAQ,aAAa,CAAC,6CAMQ;CAAG;AASnC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,YAAY,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
10
|
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
11
11
|
import * as Category from "@distilled.cloud/core/category";
|
|
12
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
12
13
|
import { applyErrorMatchers } from "@distilled.cloud/core/trait";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
message: Schema.optional(Schema.String),
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export class UnknownFlyIoError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("UnknownFlyIoError", {
|
|
19
|
+
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
20
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
21
21
|
body: Schema.Unknown,
|
|
22
22
|
}).pipe(Category.withServerError) {
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
export class FlyIoParseError extends Schema.TaggedError()("FlyIoParseError", {
|
|
24
|
+
|
|
25
|
+
export class FlyIoParseError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("FlyIoParseError", {
|
|
26
26
|
body: Schema.Unknown,
|
|
27
27
|
cause: Schema.Unknown,
|
|
28
28
|
}).pipe(Category.withParseError) {
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export class SpritesNotEnabled extends Schema.TaggedError()("SpritesNotEnabled", {
|
|
38
|
-
code: Schema.optional(Schema.Int),
|
|
39
|
-
message: Schema.optional(Schema.String),
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export class SpritesNotEnabled extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("SpritesNotEnabled", {
|
|
38
|
+
code: /*@__PURE__*/ Schema.optional(Schema.Int),
|
|
39
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
40
40
|
}).pipe(Category.withAuthError) {
|
|
41
41
|
}
|
|
42
42
|
applyErrorMatchers(SpritesNotEnabled, [
|
|
43
43
|
{ status: 401, message: { matches: "[Ss]prites not enabled" } },
|
|
44
44
|
]);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export class CreateExtensionTosAgreementNotAuthorized extends Schema.TaggedError()("CreateExtensionTosAgreementNotAuthorized", {
|
|
51
|
-
code: Schema.optional(Schema.Int),
|
|
52
|
-
message: Schema.optional(Schema.String),
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export class CreateExtensionTosAgreementNotAuthorized extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("CreateExtensionTosAgreementNotAuthorized", {
|
|
51
|
+
code: /*@__PURE__*/ Schema.optional(Schema.Int),
|
|
52
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
53
53
|
}).pipe(Category.withAuthError) {
|
|
54
54
|
}
|
|
55
55
|
applyErrorMatchers(CreateExtensionTosAgreementNotAuthorized, [
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;GAGG;AACH,MAAM,OAAO,iBACX,SAAQ,aAAa,CAAb,aAAa,CAAC,MAAM,CAAC,WAAW,EAAqB,CAAC,mBAAmB,EAAE;IACjF,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe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8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @distilled.cloud/fly-io
|
|
2
|
+
* @distilled.cloud/fly-io -- Fly.io SDK for Effect.
|
|
3
3
|
*
|
|
4
4
|
* `./services` is generated by `scripts/generate.ts` from the Smithy model
|
|
5
|
-
* written by `scripts/convert.ts` (OpenAPI
|
|
5
|
+
* written by `scripts/convert.ts` (OpenAPI -> Smithy via the shared core
|
|
6
6
|
* converter). Everything else in this folder is hand-written.
|
|
7
7
|
*
|
|
8
8
|
* The generated barrel is re-exported at the package root, same as every
|
package/lib/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
32
|
export * from "./credentials.js";
|
|
33
33
|
export * from "./errors.js";
|
|
34
34
|
export * as T from "./traits.js";
|
package/lib/pagination.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fly.io pagination
|
|
2
|
+
* Fly.io pagination -- cursor (Sprites list) and Relay (GraphQL add-ons).
|
|
3
3
|
*/
|
|
4
4
|
export { paginateCursor, paginateRelay, extractItems, getItems, getPath, type PaginatedTrait, type PaginationStrategy, } from "@distilled.cloud/core/pagination";
|
|
5
5
|
//# sourceMappingURL=pagination.d.ts.map
|
package/lib/pagination.js
CHANGED
package/lib/protocol.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as API from "@distilled.cloud/core/api";
|
|
2
2
|
import { type ConfigError } from "@distilled.cloud/core/errors";
|
|
3
3
|
/**
|
|
4
|
-
* Fly.io protocols
|
|
4
|
+
* Fly.io protocols -- Machines REST, UI-EX REST (MPG), GraphQL add-ons, and
|
|
5
5
|
* Sprites REST.
|
|
6
6
|
*
|
|
7
7
|
* Machines (`FlyIoProtocol`) is a plain bearer-token JSON API at
|
|
@@ -48,7 +48,7 @@ declare const MachineIdentity_base: Context.ServiceClass<MachineIdentity, "FlyIo
|
|
|
48
48
|
* GetSecret in the same process; this service only changes headers:
|
|
49
49
|
* omit `Authorization`, send `Connection: close`.
|
|
50
50
|
*/
|
|
51
|
-
export declare class MachineIdentity extends MachineIdentity_base {
|
|
51
|
+
export declare class MachineIdentity extends /*@__PURE__*/ MachineIdentity_base {
|
|
52
52
|
}
|
|
53
53
|
export declare const FlyIoProtocol: Layer.Layer<API.Protocol>;
|
|
54
54
|
/** MPG UI-EX REST at `https://api.fly.io` with the Machines bearer token. */
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"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