@smplkit/sdk 3.0.88 → 3.0.90
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/dist/index.cjs +209 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -1
- package/dist/index.d.ts +87 -1
- package/dist/index.js +207 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -261,11 +261,26 @@ declare class HttpConfiguration {
|
|
|
261
261
|
* (`"2xx"`, `"4xx"`). Defaults to `"2xx"`.
|
|
262
262
|
*/
|
|
263
263
|
successStatus: string;
|
|
264
|
+
/**
|
|
265
|
+
* Whether to verify the destination's TLS certificate chain. Defaults
|
|
266
|
+
* to `true`; flip to `false` only for short-lived testing against a
|
|
267
|
+
* destination that serves an untrusted certificate. Prefer pinning the
|
|
268
|
+
* CA via {@link caCert} for long-lived self-signed setups.
|
|
269
|
+
*/
|
|
270
|
+
tlsVerify: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Optional PEM-encoded certificate (or bundle) trusted in addition to
|
|
273
|
+
* the system CA store. Ignored when {@link tlsVerify} is `false`.
|
|
274
|
+
* `null` (the default) means "use system CAs only".
|
|
275
|
+
*/
|
|
276
|
+
caCert: string | null;
|
|
264
277
|
constructor(fields?: {
|
|
265
278
|
method?: HttpMethod;
|
|
266
279
|
url?: string;
|
|
267
280
|
headers?: HttpHeader[];
|
|
268
281
|
successStatus?: string;
|
|
282
|
+
tlsVerify?: boolean;
|
|
283
|
+
caCert?: string | null;
|
|
269
284
|
});
|
|
270
285
|
}
|
|
271
286
|
/**
|
|
@@ -2043,6 +2058,12 @@ interface ContextTypeModelClient {
|
|
|
2043
2058
|
interface AccountSettingsModelClient {
|
|
2044
2059
|
_save(data: Record<string, any>): Promise<AccountSettings>;
|
|
2045
2060
|
}
|
|
2061
|
+
/** @internal */
|
|
2062
|
+
interface ServiceModelClient {
|
|
2063
|
+
_create(svc: Service): Promise<Service>;
|
|
2064
|
+
_update(svc: Service): Promise<Service>;
|
|
2065
|
+
delete(id: string): Promise<void>;
|
|
2066
|
+
}
|
|
2046
2067
|
/**
|
|
2047
2068
|
* An environment resource managed by the smplkit platform.
|
|
2048
2069
|
*
|
|
@@ -2155,6 +2176,38 @@ declare class AccountSettings {
|
|
|
2155
2176
|
get _rawData(): Record<string, any>;
|
|
2156
2177
|
toString(): string;
|
|
2157
2178
|
}
|
|
2179
|
+
/**
|
|
2180
|
+
* A service resource managed by the smplkit platform — a backend
|
|
2181
|
+
* application or microservice in the customer's stack.
|
|
2182
|
+
*
|
|
2183
|
+
* Mutate fields, then call {@link save} to create or update.
|
|
2184
|
+
*/
|
|
2185
|
+
declare class Service {
|
|
2186
|
+
/** Unique slug identifier (e.g. `"user_service"`). */
|
|
2187
|
+
id: string | null;
|
|
2188
|
+
/** Human-readable display name. */
|
|
2189
|
+
name: string;
|
|
2190
|
+
/** When the service was created. */
|
|
2191
|
+
createdAt: string | null;
|
|
2192
|
+
/** When the service was last updated. */
|
|
2193
|
+
updatedAt: string | null;
|
|
2194
|
+
/** @internal */
|
|
2195
|
+
readonly _client: ServiceModelClient | null;
|
|
2196
|
+
/** @internal */
|
|
2197
|
+
constructor(client: ServiceModelClient | null, fields: {
|
|
2198
|
+
id: string | null;
|
|
2199
|
+
name: string;
|
|
2200
|
+
createdAt?: string | null;
|
|
2201
|
+
updatedAt?: string | null;
|
|
2202
|
+
});
|
|
2203
|
+
/** Persist this service to the server (creates if new, updates if existing). */
|
|
2204
|
+
save(): Promise<void>;
|
|
2205
|
+
/** Delete this service from the server. */
|
|
2206
|
+
delete(): Promise<void>;
|
|
2207
|
+
/** @internal */
|
|
2208
|
+
_apply(other: Service): void;
|
|
2209
|
+
toString(): string;
|
|
2210
|
+
}
|
|
2158
2211
|
|
|
2159
2212
|
/**
|
|
2160
2213
|
* Public types for the Flags SDK: Op, Context, FlagDeclaration, Rule.
|
|
@@ -3457,6 +3510,36 @@ declare class EnvironmentsClient {
|
|
|
3457
3510
|
/** @internal */
|
|
3458
3511
|
_update(env: Environment): Promise<Environment>;
|
|
3459
3512
|
}
|
|
3513
|
+
/** `mgmt.services.*` — CRUD for services. */
|
|
3514
|
+
declare class ServicesClient {
|
|
3515
|
+
private readonly _http;
|
|
3516
|
+
/** @internal */
|
|
3517
|
+
constructor(_http: AppHttp);
|
|
3518
|
+
/**
|
|
3519
|
+
* Construct an unsaved {@link Service}. Call `.save()` to persist.
|
|
3520
|
+
*/
|
|
3521
|
+
new(id: string, options: {
|
|
3522
|
+
name: string;
|
|
3523
|
+
}): Service;
|
|
3524
|
+
/**
|
|
3525
|
+
* List services.
|
|
3526
|
+
*
|
|
3527
|
+
* Server defaults are `pageNumber=1`, `pageSize=1000` (capped at 1000).
|
|
3528
|
+
* Omit both to fetch the first page; pass them through to walk further
|
|
3529
|
+
* pages. The wrapper does not loop on the customer's behalf — the
|
|
3530
|
+
* customer chooses how to paginate.
|
|
3531
|
+
*/
|
|
3532
|
+
list(params?: {
|
|
3533
|
+
pageNumber?: number;
|
|
3534
|
+
pageSize?: number;
|
|
3535
|
+
}): Promise<Service[]>;
|
|
3536
|
+
get(id: string): Promise<Service>;
|
|
3537
|
+
delete(id: string): Promise<void>;
|
|
3538
|
+
/** @internal */
|
|
3539
|
+
_create(svc: Service): Promise<Service>;
|
|
3540
|
+
/** @internal */
|
|
3541
|
+
_update(svc: Service): Promise<Service>;
|
|
3542
|
+
}
|
|
3460
3543
|
/** `mgmt.contextTypes.*` — CRUD for context types. */
|
|
3461
3544
|
declare class ContextTypesClient {
|
|
3462
3545
|
private readonly _http;
|
|
@@ -3598,6 +3681,8 @@ declare class SmplManagementClient {
|
|
|
3598
3681
|
readonly contextTypes: ContextTypesClient;
|
|
3599
3682
|
/** Environment CRUD. */
|
|
3600
3683
|
readonly environments: EnvironmentsClient;
|
|
3684
|
+
/** Service CRUD. */
|
|
3685
|
+
readonly services: ServicesClient;
|
|
3601
3686
|
/** Account-level settings. */
|
|
3602
3687
|
readonly accountSettings: AccountSettingsClient;
|
|
3603
3688
|
/** Config CRUD (singular — matches runtime `client.config`). */
|
|
@@ -3622,6 +3707,7 @@ declare class SmplManagementClient {
|
|
|
3622
3707
|
private _contextsRef;
|
|
3623
3708
|
private _contextTypesRef;
|
|
3624
3709
|
private _environmentsRef;
|
|
3710
|
+
private _servicesRef;
|
|
3625
3711
|
private _accountSettingsRef;
|
|
3626
3712
|
private _configRef;
|
|
3627
3713
|
private _flagsRef;
|
|
@@ -4300,4 +4386,4 @@ declare class SmplPaymentRequiredError extends SmplError {
|
|
|
4300
4386
|
/** @deprecated Use {@link ApiErrorDetail}. */
|
|
4301
4387
|
type ApiErrorObject = ApiErrorDetail;
|
|
4302
4388
|
|
|
4303
|
-
export { AccountSettings, AccountSettingsClient, type ApiErrorDetail, type ApiErrorObject, AuditClient, type AuditEvent, type ListEventsPage as AuditEventListPage, type ListEventsParams as AuditEventListParams, type EventType as AuditEventType, type EventTypeListPage as AuditEventTypeListPage, ForwardersClient as AuditForwardersClient, type ListEventTypesParams as AuditListEventTypesParams, type ListResourceTypesParams as AuditListResourceTypesParams, type Pagination as AuditPagination, type ResourceType as AuditResourceType, type ListResourceTypesPage as AuditResourceTypeListPage, BooleanFlag, Color, Config, ConfigChangeEvent, ConfigClient, ConfigEnvironment, ConfigItem, Context, ContextType, ContextTypesClient, ContextsClient, type CreateEventInput as CreateAuditEventInput, Environment, EnvironmentClassification, EnvironmentsClient, Flag, FlagChangeEvent, FlagDeclaration, FlagEnvironment, FlagRule, FlagStats, FlagValue, FlagsClient, ItemType, JsonFlag, LiveConfigProxy, LogGroup, LogLevel, Logger, LoggerChangeEvent, LoggerEnvironment, LoggerSource, type LoggingAdapter, LoggingClient, ManagementAuditClient, NumberFlag, Op, PinoAdapter, type PinoAdapterConfig, Rule, SharedWebSocket, SmplClient, type SmplClientOptions, SmplConflictError, SmplConnectionError, SmplError, SmplManagementClient, type SmplManagementClientOptions, SmplNotFoundError, SmplPaymentRequiredError, SmplTimeoutError, SmplValidationError, SmplConflictError as SmplkitConflictError, SmplConnectionError as SmplkitConnectionError, SmplError as SmplkitError, SmplNotFoundError as SmplkitNotFoundError, SmplPaymentRequiredError as SmplkitPaymentRequiredError, SmplTimeoutError as SmplkitTimeoutError, SmplValidationError as SmplkitValidationError, StringFlag, WinstonAdapter, type WinstonAdapterConfig };
|
|
4389
|
+
export { AccountSettings, AccountSettingsClient, type ApiErrorDetail, type ApiErrorObject, AuditClient, type AuditEvent, type ListEventsPage as AuditEventListPage, type ListEventsParams as AuditEventListParams, type EventType as AuditEventType, type EventTypeListPage as AuditEventTypeListPage, ForwardersClient as AuditForwardersClient, type ListEventTypesParams as AuditListEventTypesParams, type ListResourceTypesParams as AuditListResourceTypesParams, type Pagination as AuditPagination, type ResourceType as AuditResourceType, type ListResourceTypesPage as AuditResourceTypeListPage, BooleanFlag, Color, Config, ConfigChangeEvent, ConfigClient, ConfigEnvironment, ConfigItem, Context, ContextType, ContextTypesClient, ContextsClient, type CreateEventInput as CreateAuditEventInput, Environment, EnvironmentClassification, EnvironmentsClient, Flag, FlagChangeEvent, FlagDeclaration, FlagEnvironment, FlagRule, FlagStats, FlagValue, FlagsClient, ItemType, JsonFlag, LiveConfigProxy, LogGroup, LogLevel, Logger, LoggerChangeEvent, LoggerEnvironment, LoggerSource, type LoggingAdapter, LoggingClient, ManagementAuditClient, NumberFlag, Op, PinoAdapter, type PinoAdapterConfig, Rule, Service, ServicesClient, SharedWebSocket, SmplClient, type SmplClientOptions, SmplConflictError, SmplConnectionError, SmplError, SmplManagementClient, type SmplManagementClientOptions, SmplNotFoundError, SmplPaymentRequiredError, SmplTimeoutError, SmplValidationError, SmplConflictError as SmplkitConflictError, SmplConnectionError as SmplkitConnectionError, SmplError as SmplkitError, SmplNotFoundError as SmplkitNotFoundError, SmplPaymentRequiredError as SmplkitPaymentRequiredError, SmplTimeoutError as SmplkitTimeoutError, SmplValidationError as SmplkitValidationError, StringFlag, WinstonAdapter, type WinstonAdapterConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -261,11 +261,26 @@ declare class HttpConfiguration {
|
|
|
261
261
|
* (`"2xx"`, `"4xx"`). Defaults to `"2xx"`.
|
|
262
262
|
*/
|
|
263
263
|
successStatus: string;
|
|
264
|
+
/**
|
|
265
|
+
* Whether to verify the destination's TLS certificate chain. Defaults
|
|
266
|
+
* to `true`; flip to `false` only for short-lived testing against a
|
|
267
|
+
* destination that serves an untrusted certificate. Prefer pinning the
|
|
268
|
+
* CA via {@link caCert} for long-lived self-signed setups.
|
|
269
|
+
*/
|
|
270
|
+
tlsVerify: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Optional PEM-encoded certificate (or bundle) trusted in addition to
|
|
273
|
+
* the system CA store. Ignored when {@link tlsVerify} is `false`.
|
|
274
|
+
* `null` (the default) means "use system CAs only".
|
|
275
|
+
*/
|
|
276
|
+
caCert: string | null;
|
|
264
277
|
constructor(fields?: {
|
|
265
278
|
method?: HttpMethod;
|
|
266
279
|
url?: string;
|
|
267
280
|
headers?: HttpHeader[];
|
|
268
281
|
successStatus?: string;
|
|
282
|
+
tlsVerify?: boolean;
|
|
283
|
+
caCert?: string | null;
|
|
269
284
|
});
|
|
270
285
|
}
|
|
271
286
|
/**
|
|
@@ -2043,6 +2058,12 @@ interface ContextTypeModelClient {
|
|
|
2043
2058
|
interface AccountSettingsModelClient {
|
|
2044
2059
|
_save(data: Record<string, any>): Promise<AccountSettings>;
|
|
2045
2060
|
}
|
|
2061
|
+
/** @internal */
|
|
2062
|
+
interface ServiceModelClient {
|
|
2063
|
+
_create(svc: Service): Promise<Service>;
|
|
2064
|
+
_update(svc: Service): Promise<Service>;
|
|
2065
|
+
delete(id: string): Promise<void>;
|
|
2066
|
+
}
|
|
2046
2067
|
/**
|
|
2047
2068
|
* An environment resource managed by the smplkit platform.
|
|
2048
2069
|
*
|
|
@@ -2155,6 +2176,38 @@ declare class AccountSettings {
|
|
|
2155
2176
|
get _rawData(): Record<string, any>;
|
|
2156
2177
|
toString(): string;
|
|
2157
2178
|
}
|
|
2179
|
+
/**
|
|
2180
|
+
* A service resource managed by the smplkit platform — a backend
|
|
2181
|
+
* application or microservice in the customer's stack.
|
|
2182
|
+
*
|
|
2183
|
+
* Mutate fields, then call {@link save} to create or update.
|
|
2184
|
+
*/
|
|
2185
|
+
declare class Service {
|
|
2186
|
+
/** Unique slug identifier (e.g. `"user_service"`). */
|
|
2187
|
+
id: string | null;
|
|
2188
|
+
/** Human-readable display name. */
|
|
2189
|
+
name: string;
|
|
2190
|
+
/** When the service was created. */
|
|
2191
|
+
createdAt: string | null;
|
|
2192
|
+
/** When the service was last updated. */
|
|
2193
|
+
updatedAt: string | null;
|
|
2194
|
+
/** @internal */
|
|
2195
|
+
readonly _client: ServiceModelClient | null;
|
|
2196
|
+
/** @internal */
|
|
2197
|
+
constructor(client: ServiceModelClient | null, fields: {
|
|
2198
|
+
id: string | null;
|
|
2199
|
+
name: string;
|
|
2200
|
+
createdAt?: string | null;
|
|
2201
|
+
updatedAt?: string | null;
|
|
2202
|
+
});
|
|
2203
|
+
/** Persist this service to the server (creates if new, updates if existing). */
|
|
2204
|
+
save(): Promise<void>;
|
|
2205
|
+
/** Delete this service from the server. */
|
|
2206
|
+
delete(): Promise<void>;
|
|
2207
|
+
/** @internal */
|
|
2208
|
+
_apply(other: Service): void;
|
|
2209
|
+
toString(): string;
|
|
2210
|
+
}
|
|
2158
2211
|
|
|
2159
2212
|
/**
|
|
2160
2213
|
* Public types for the Flags SDK: Op, Context, FlagDeclaration, Rule.
|
|
@@ -3457,6 +3510,36 @@ declare class EnvironmentsClient {
|
|
|
3457
3510
|
/** @internal */
|
|
3458
3511
|
_update(env: Environment): Promise<Environment>;
|
|
3459
3512
|
}
|
|
3513
|
+
/** `mgmt.services.*` — CRUD for services. */
|
|
3514
|
+
declare class ServicesClient {
|
|
3515
|
+
private readonly _http;
|
|
3516
|
+
/** @internal */
|
|
3517
|
+
constructor(_http: AppHttp);
|
|
3518
|
+
/**
|
|
3519
|
+
* Construct an unsaved {@link Service}. Call `.save()` to persist.
|
|
3520
|
+
*/
|
|
3521
|
+
new(id: string, options: {
|
|
3522
|
+
name: string;
|
|
3523
|
+
}): Service;
|
|
3524
|
+
/**
|
|
3525
|
+
* List services.
|
|
3526
|
+
*
|
|
3527
|
+
* Server defaults are `pageNumber=1`, `pageSize=1000` (capped at 1000).
|
|
3528
|
+
* Omit both to fetch the first page; pass them through to walk further
|
|
3529
|
+
* pages. The wrapper does not loop on the customer's behalf — the
|
|
3530
|
+
* customer chooses how to paginate.
|
|
3531
|
+
*/
|
|
3532
|
+
list(params?: {
|
|
3533
|
+
pageNumber?: number;
|
|
3534
|
+
pageSize?: number;
|
|
3535
|
+
}): Promise<Service[]>;
|
|
3536
|
+
get(id: string): Promise<Service>;
|
|
3537
|
+
delete(id: string): Promise<void>;
|
|
3538
|
+
/** @internal */
|
|
3539
|
+
_create(svc: Service): Promise<Service>;
|
|
3540
|
+
/** @internal */
|
|
3541
|
+
_update(svc: Service): Promise<Service>;
|
|
3542
|
+
}
|
|
3460
3543
|
/** `mgmt.contextTypes.*` — CRUD for context types. */
|
|
3461
3544
|
declare class ContextTypesClient {
|
|
3462
3545
|
private readonly _http;
|
|
@@ -3598,6 +3681,8 @@ declare class SmplManagementClient {
|
|
|
3598
3681
|
readonly contextTypes: ContextTypesClient;
|
|
3599
3682
|
/** Environment CRUD. */
|
|
3600
3683
|
readonly environments: EnvironmentsClient;
|
|
3684
|
+
/** Service CRUD. */
|
|
3685
|
+
readonly services: ServicesClient;
|
|
3601
3686
|
/** Account-level settings. */
|
|
3602
3687
|
readonly accountSettings: AccountSettingsClient;
|
|
3603
3688
|
/** Config CRUD (singular — matches runtime `client.config`). */
|
|
@@ -3622,6 +3707,7 @@ declare class SmplManagementClient {
|
|
|
3622
3707
|
private _contextsRef;
|
|
3623
3708
|
private _contextTypesRef;
|
|
3624
3709
|
private _environmentsRef;
|
|
3710
|
+
private _servicesRef;
|
|
3625
3711
|
private _accountSettingsRef;
|
|
3626
3712
|
private _configRef;
|
|
3627
3713
|
private _flagsRef;
|
|
@@ -4300,4 +4386,4 @@ declare class SmplPaymentRequiredError extends SmplError {
|
|
|
4300
4386
|
/** @deprecated Use {@link ApiErrorDetail}. */
|
|
4301
4387
|
type ApiErrorObject = ApiErrorDetail;
|
|
4302
4388
|
|
|
4303
|
-
export { AccountSettings, AccountSettingsClient, type ApiErrorDetail, type ApiErrorObject, AuditClient, type AuditEvent, type ListEventsPage as AuditEventListPage, type ListEventsParams as AuditEventListParams, type EventType as AuditEventType, type EventTypeListPage as AuditEventTypeListPage, ForwardersClient as AuditForwardersClient, type ListEventTypesParams as AuditListEventTypesParams, type ListResourceTypesParams as AuditListResourceTypesParams, type Pagination as AuditPagination, type ResourceType as AuditResourceType, type ListResourceTypesPage as AuditResourceTypeListPage, BooleanFlag, Color, Config, ConfigChangeEvent, ConfigClient, ConfigEnvironment, ConfigItem, Context, ContextType, ContextTypesClient, ContextsClient, type CreateEventInput as CreateAuditEventInput, Environment, EnvironmentClassification, EnvironmentsClient, Flag, FlagChangeEvent, FlagDeclaration, FlagEnvironment, FlagRule, FlagStats, FlagValue, FlagsClient, ItemType, JsonFlag, LiveConfigProxy, LogGroup, LogLevel, Logger, LoggerChangeEvent, LoggerEnvironment, LoggerSource, type LoggingAdapter, LoggingClient, ManagementAuditClient, NumberFlag, Op, PinoAdapter, type PinoAdapterConfig, Rule, SharedWebSocket, SmplClient, type SmplClientOptions, SmplConflictError, SmplConnectionError, SmplError, SmplManagementClient, type SmplManagementClientOptions, SmplNotFoundError, SmplPaymentRequiredError, SmplTimeoutError, SmplValidationError, SmplConflictError as SmplkitConflictError, SmplConnectionError as SmplkitConnectionError, SmplError as SmplkitError, SmplNotFoundError as SmplkitNotFoundError, SmplPaymentRequiredError as SmplkitPaymentRequiredError, SmplTimeoutError as SmplkitTimeoutError, SmplValidationError as SmplkitValidationError, StringFlag, WinstonAdapter, type WinstonAdapterConfig };
|
|
4389
|
+
export { AccountSettings, AccountSettingsClient, type ApiErrorDetail, type ApiErrorObject, AuditClient, type AuditEvent, type ListEventsPage as AuditEventListPage, type ListEventsParams as AuditEventListParams, type EventType as AuditEventType, type EventTypeListPage as AuditEventTypeListPage, ForwardersClient as AuditForwardersClient, type ListEventTypesParams as AuditListEventTypesParams, type ListResourceTypesParams as AuditListResourceTypesParams, type Pagination as AuditPagination, type ResourceType as AuditResourceType, type ListResourceTypesPage as AuditResourceTypeListPage, BooleanFlag, Color, Config, ConfigChangeEvent, ConfigClient, ConfigEnvironment, ConfigItem, Context, ContextType, ContextTypesClient, ContextsClient, type CreateEventInput as CreateAuditEventInput, Environment, EnvironmentClassification, EnvironmentsClient, Flag, FlagChangeEvent, FlagDeclaration, FlagEnvironment, FlagRule, FlagStats, FlagValue, FlagsClient, ItemType, JsonFlag, LiveConfigProxy, LogGroup, LogLevel, Logger, LoggerChangeEvent, LoggerEnvironment, LoggerSource, type LoggingAdapter, LoggingClient, ManagementAuditClient, NumberFlag, Op, PinoAdapter, type PinoAdapterConfig, Rule, Service, ServicesClient, SharedWebSocket, SmplClient, type SmplClientOptions, SmplConflictError, SmplConnectionError, SmplError, SmplManagementClient, type SmplManagementClientOptions, SmplNotFoundError, SmplPaymentRequiredError, SmplTimeoutError, SmplValidationError, SmplConflictError as SmplkitConflictError, SmplConnectionError as SmplkitConnectionError, SmplError as SmplkitError, SmplNotFoundError as SmplkitNotFoundError, SmplPaymentRequiredError as SmplkitPaymentRequiredError, SmplTimeoutError as SmplkitTimeoutError, SmplValidationError as SmplkitValidationError, StringFlag, WinstonAdapter, type WinstonAdapterConfig };
|
package/dist/index.js
CHANGED
|
@@ -18671,6 +18671,56 @@ var AccountSettings = class {
|
|
|
18671
18671
|
return `AccountSettings(${JSON.stringify(this._data)})`;
|
|
18672
18672
|
}
|
|
18673
18673
|
};
|
|
18674
|
+
var Service = class {
|
|
18675
|
+
/** Unique slug identifier (e.g. `"user_service"`). */
|
|
18676
|
+
id;
|
|
18677
|
+
/** Human-readable display name. */
|
|
18678
|
+
name;
|
|
18679
|
+
/** When the service was created. */
|
|
18680
|
+
createdAt;
|
|
18681
|
+
/** When the service was last updated. */
|
|
18682
|
+
updatedAt;
|
|
18683
|
+
/** @internal */
|
|
18684
|
+
_client;
|
|
18685
|
+
/** @internal */
|
|
18686
|
+
constructor(client, fields) {
|
|
18687
|
+
this._client = client;
|
|
18688
|
+
this.id = fields.id;
|
|
18689
|
+
this.name = fields.name;
|
|
18690
|
+
this.createdAt = fields.createdAt ?? null;
|
|
18691
|
+
this.updatedAt = fields.updatedAt ?? null;
|
|
18692
|
+
}
|
|
18693
|
+
/** Persist this service to the server (creates if new, updates if existing). */
|
|
18694
|
+
async save() {
|
|
18695
|
+
if (this._client === null) {
|
|
18696
|
+
throw new Error("Service was constructed without a client; cannot save");
|
|
18697
|
+
}
|
|
18698
|
+
if (this.createdAt === null) {
|
|
18699
|
+
const saved = await this._client._create(this);
|
|
18700
|
+
this._apply(saved);
|
|
18701
|
+
} else {
|
|
18702
|
+
const saved = await this._client._update(this);
|
|
18703
|
+
this._apply(saved);
|
|
18704
|
+
}
|
|
18705
|
+
}
|
|
18706
|
+
/** Delete this service from the server. */
|
|
18707
|
+
async delete() {
|
|
18708
|
+
if (this._client === null || this.id === null) {
|
|
18709
|
+
throw new Error("Service was constructed without a client or id; cannot delete");
|
|
18710
|
+
}
|
|
18711
|
+
await this._client.delete(this.id);
|
|
18712
|
+
}
|
|
18713
|
+
/** @internal */
|
|
18714
|
+
_apply(other) {
|
|
18715
|
+
this.id = other.id;
|
|
18716
|
+
this.name = other.name;
|
|
18717
|
+
this.createdAt = other.createdAt;
|
|
18718
|
+
this.updatedAt = other.updatedAt;
|
|
18719
|
+
}
|
|
18720
|
+
toString() {
|
|
18721
|
+
return `Service(id=${this.id}, name=${this.name})`;
|
|
18722
|
+
}
|
|
18723
|
+
};
|
|
18674
18724
|
|
|
18675
18725
|
// src/flags/types.ts
|
|
18676
18726
|
var Op = /* @__PURE__ */ ((Op2) => {
|
|
@@ -20174,11 +20224,26 @@ var HttpConfiguration = class {
|
|
|
20174
20224
|
* (`"2xx"`, `"4xx"`). Defaults to `"2xx"`.
|
|
20175
20225
|
*/
|
|
20176
20226
|
successStatus;
|
|
20227
|
+
/**
|
|
20228
|
+
* Whether to verify the destination's TLS certificate chain. Defaults
|
|
20229
|
+
* to `true`; flip to `false` only for short-lived testing against a
|
|
20230
|
+
* destination that serves an untrusted certificate. Prefer pinning the
|
|
20231
|
+
* CA via {@link caCert} for long-lived self-signed setups.
|
|
20232
|
+
*/
|
|
20233
|
+
tlsVerify;
|
|
20234
|
+
/**
|
|
20235
|
+
* Optional PEM-encoded certificate (or bundle) trusted in addition to
|
|
20236
|
+
* the system CA store. Ignored when {@link tlsVerify} is `false`.
|
|
20237
|
+
* `null` (the default) means "use system CAs only".
|
|
20238
|
+
*/
|
|
20239
|
+
caCert;
|
|
20177
20240
|
constructor(fields = {}) {
|
|
20178
20241
|
this.method = fields.method ?? "POST" /* POST */;
|
|
20179
20242
|
this.url = fields.url ?? "";
|
|
20180
20243
|
this.headers = fields.headers ?? [];
|
|
20181
20244
|
this.successStatus = fields.successStatus ?? "2xx";
|
|
20245
|
+
this.tlsVerify = fields.tlsVerify ?? true;
|
|
20246
|
+
this.caCert = fields.caCert ?? null;
|
|
20182
20247
|
}
|
|
20183
20248
|
};
|
|
20184
20249
|
var Forwarder = class {
|
|
@@ -20333,7 +20398,9 @@ function _configurationToWire(config) {
|
|
|
20333
20398
|
method: config.method,
|
|
20334
20399
|
url: config.url,
|
|
20335
20400
|
headers: config.headers.map((h) => ({ name: h.name, value: h.value })),
|
|
20336
|
-
success_status: config.successStatus
|
|
20401
|
+
success_status: config.successStatus,
|
|
20402
|
+
tls_verify: config.tlsVerify,
|
|
20403
|
+
ca_cert: config.caCert
|
|
20337
20404
|
};
|
|
20338
20405
|
}
|
|
20339
20406
|
function _configurationFromWire(raw) {
|
|
@@ -20346,7 +20413,9 @@ function _configurationFromWire(raw) {
|
|
|
20346
20413
|
method: r.method ?? "POST" /* POST */,
|
|
20347
20414
|
url: String(r.url ?? ""),
|
|
20348
20415
|
headers,
|
|
20349
|
-
successStatus: String(r.success_status ?? "2xx")
|
|
20416
|
+
successStatus: String(r.success_status ?? "2xx"),
|
|
20417
|
+
tlsVerify: r.tls_verify === void 0 ? true : Boolean(r.tls_verify),
|
|
20418
|
+
caCert: r.ca_cert == null ? null : String(r.ca_cert)
|
|
20350
20419
|
});
|
|
20351
20420
|
}
|
|
20352
20421
|
function _forwarderAttrs(forwarder) {
|
|
@@ -20759,6 +20828,15 @@ function envFromResource(resource, client) {
|
|
|
20759
20828
|
updatedAt: attrs.updated_at ?? null
|
|
20760
20829
|
});
|
|
20761
20830
|
}
|
|
20831
|
+
function svcFromResource(resource, client) {
|
|
20832
|
+
const attrs = resource.attributes ?? {};
|
|
20833
|
+
return new Service(client, {
|
|
20834
|
+
id: resource.id ?? null,
|
|
20835
|
+
name: attrs.name ?? "",
|
|
20836
|
+
createdAt: attrs.created_at ?? null,
|
|
20837
|
+
updatedAt: attrs.updated_at ?? null
|
|
20838
|
+
});
|
|
20839
|
+
}
|
|
20762
20840
|
function ctFromResource(resource, client) {
|
|
20763
20841
|
const attrs = resource.attributes ?? {};
|
|
20764
20842
|
const rawMeta = attrs.attributes;
|
|
@@ -20921,6 +20999,126 @@ var EnvironmentsClient = class {
|
|
|
20921
20999
|
return envFromResource(data.data, this);
|
|
20922
21000
|
}
|
|
20923
21001
|
};
|
|
21002
|
+
var ServicesClient = class {
|
|
21003
|
+
/** @internal */
|
|
21004
|
+
constructor(_http) {
|
|
21005
|
+
this._http = _http;
|
|
21006
|
+
}
|
|
21007
|
+
/**
|
|
21008
|
+
* Construct an unsaved {@link Service}. Call `.save()` to persist.
|
|
21009
|
+
*/
|
|
21010
|
+
new(id, options) {
|
|
21011
|
+
return new Service(this, {
|
|
21012
|
+
id,
|
|
21013
|
+
name: options.name,
|
|
21014
|
+
createdAt: null,
|
|
21015
|
+
updatedAt: null
|
|
21016
|
+
});
|
|
21017
|
+
}
|
|
21018
|
+
/**
|
|
21019
|
+
* List services.
|
|
21020
|
+
*
|
|
21021
|
+
* Server defaults are `pageNumber=1`, `pageSize=1000` (capped at 1000).
|
|
21022
|
+
* Omit both to fetch the first page; pass them through to walk further
|
|
21023
|
+
* pages. The wrapper does not loop on the customer's behalf — the
|
|
21024
|
+
* customer chooses how to paginate.
|
|
21025
|
+
*/
|
|
21026
|
+
async list(params = {}) {
|
|
21027
|
+
const query = {};
|
|
21028
|
+
if (params.pageNumber !== void 0) query["page[number]"] = params.pageNumber;
|
|
21029
|
+
if (params.pageSize !== void 0) query["page[size]"] = params.pageSize;
|
|
21030
|
+
let data;
|
|
21031
|
+
try {
|
|
21032
|
+
const result = await this._http.GET("/api/v1/services", {
|
|
21033
|
+
params: { query }
|
|
21034
|
+
});
|
|
21035
|
+
if (!result.response.ok) await checkError5(result.response, result.error);
|
|
21036
|
+
data = result.data;
|
|
21037
|
+
} catch (err) {
|
|
21038
|
+
wrapFetchError5(err);
|
|
21039
|
+
}
|
|
21040
|
+
const items = data?.data ?? [];
|
|
21041
|
+
return items.map((r) => svcFromResource(r, this));
|
|
21042
|
+
}
|
|
21043
|
+
async get(id) {
|
|
21044
|
+
let data;
|
|
21045
|
+
try {
|
|
21046
|
+
const result = await this._http.GET("/api/v1/services/{id}", {
|
|
21047
|
+
params: { path: { id } }
|
|
21048
|
+
});
|
|
21049
|
+
if (!result.response.ok) await checkError5(result.response, result.error);
|
|
21050
|
+
data = result.data;
|
|
21051
|
+
} catch (err) {
|
|
21052
|
+
wrapFetchError5(err);
|
|
21053
|
+
}
|
|
21054
|
+
if (!data?.data)
|
|
21055
|
+
throw new SmplNotFoundError(`Service with id ${JSON.stringify(id)} not found`);
|
|
21056
|
+
return svcFromResource(data.data, this);
|
|
21057
|
+
}
|
|
21058
|
+
async delete(id) {
|
|
21059
|
+
try {
|
|
21060
|
+
const result = await this._http.DELETE("/api/v1/services/{id}", {
|
|
21061
|
+
params: { path: { id } }
|
|
21062
|
+
});
|
|
21063
|
+
if (!result.response.ok && result.response.status !== 204) {
|
|
21064
|
+
await checkError5(result.response, result.error);
|
|
21065
|
+
}
|
|
21066
|
+
} catch (err) {
|
|
21067
|
+
wrapFetchError5(err);
|
|
21068
|
+
}
|
|
21069
|
+
}
|
|
21070
|
+
/** @internal */
|
|
21071
|
+
async _create(svc) {
|
|
21072
|
+
if (svc.id === null) {
|
|
21073
|
+
throw new SmplValidationError("Cannot create a Service without an id");
|
|
21074
|
+
}
|
|
21075
|
+
const body = {
|
|
21076
|
+
data: {
|
|
21077
|
+
id: svc.id,
|
|
21078
|
+
type: "service",
|
|
21079
|
+
attributes: {
|
|
21080
|
+
name: svc.name
|
|
21081
|
+
}
|
|
21082
|
+
}
|
|
21083
|
+
};
|
|
21084
|
+
let data;
|
|
21085
|
+
try {
|
|
21086
|
+
const result = await this._http.POST("/api/v1/services", { body });
|
|
21087
|
+
if (!result.response.ok) await checkError5(result.response, result.error);
|
|
21088
|
+
data = result.data;
|
|
21089
|
+
} catch (err) {
|
|
21090
|
+
wrapFetchError5(err);
|
|
21091
|
+
}
|
|
21092
|
+
if (!data?.data) throw new SmplValidationError("Failed to create service");
|
|
21093
|
+
return svcFromResource(data.data, this);
|
|
21094
|
+
}
|
|
21095
|
+
/** @internal */
|
|
21096
|
+
async _update(svc) {
|
|
21097
|
+
if (!svc.id) throw new Error("Cannot update a Service with no id");
|
|
21098
|
+
const body = {
|
|
21099
|
+
data: {
|
|
21100
|
+
id: svc.id,
|
|
21101
|
+
type: "service",
|
|
21102
|
+
attributes: {
|
|
21103
|
+
name: svc.name
|
|
21104
|
+
}
|
|
21105
|
+
}
|
|
21106
|
+
};
|
|
21107
|
+
let data;
|
|
21108
|
+
try {
|
|
21109
|
+
const result = await this._http.PUT("/api/v1/services/{id}", {
|
|
21110
|
+
params: { path: { id: svc.id } },
|
|
21111
|
+
body
|
|
21112
|
+
});
|
|
21113
|
+
if (!result.response.ok) await checkError5(result.response, result.error);
|
|
21114
|
+
data = result.data;
|
|
21115
|
+
} catch (err) {
|
|
21116
|
+
wrapFetchError5(err);
|
|
21117
|
+
}
|
|
21118
|
+
if (!data?.data) throw new SmplValidationError(`Failed to update service ${svc.id}`);
|
|
21119
|
+
return svcFromResource(data.data, this);
|
|
21120
|
+
}
|
|
21121
|
+
};
|
|
20924
21122
|
var ContextTypesClient = class {
|
|
20925
21123
|
/** @internal */
|
|
20926
21124
|
constructor(_http) {
|
|
@@ -21271,6 +21469,8 @@ var SmplManagementClient = class {
|
|
|
21271
21469
|
contextTypes;
|
|
21272
21470
|
/** Environment CRUD. */
|
|
21273
21471
|
environments;
|
|
21472
|
+
/** Service CRUD. */
|
|
21473
|
+
services;
|
|
21274
21474
|
/** Account-level settings. */
|
|
21275
21475
|
accountSettings;
|
|
21276
21476
|
/** Config CRUD (singular — matches runtime `client.config`). */
|
|
@@ -21297,6 +21497,7 @@ var SmplManagementClient = class {
|
|
|
21297
21497
|
this.contexts = this._contextsRef;
|
|
21298
21498
|
this.contextTypes = this._contextTypesRef;
|
|
21299
21499
|
this.environments = this._environmentsRef;
|
|
21500
|
+
this.services = this._servicesRef;
|
|
21300
21501
|
this.accountSettings = this._accountSettingsRef;
|
|
21301
21502
|
this.config = this._configRef;
|
|
21302
21503
|
this.flags = this._flagsRef;
|
|
@@ -21313,6 +21514,7 @@ var SmplManagementClient = class {
|
|
|
21313
21514
|
_contextsRef;
|
|
21314
21515
|
_contextTypesRef;
|
|
21315
21516
|
_environmentsRef;
|
|
21517
|
+
_servicesRef;
|
|
21316
21518
|
_accountSettingsRef;
|
|
21317
21519
|
_configRef;
|
|
21318
21520
|
_flagsRef;
|
|
@@ -21361,6 +21563,7 @@ var SmplManagementClient = class {
|
|
|
21361
21563
|
});
|
|
21362
21564
|
this._sharedContextBuffer = new ContextRegistrationBuffer();
|
|
21363
21565
|
this._environmentsRef = new EnvironmentsClient(this._appHttpRef);
|
|
21566
|
+
this._servicesRef = new ServicesClient(this._appHttpRef);
|
|
21364
21567
|
this._contextTypesRef = new ContextTypesClient(this._appHttpRef);
|
|
21365
21568
|
this._contextsRef = new ContextsClient(this._appHttpRef, this._sharedContextBuffer);
|
|
21366
21569
|
this._accountSettingsRef = new AccountSettingsClient(appBaseUrl, cfg.apiKey);
|
|
@@ -23799,6 +24002,8 @@ export {
|
|
|
23799
24002
|
Op,
|
|
23800
24003
|
PinoAdapter,
|
|
23801
24004
|
Rule,
|
|
24005
|
+
Service,
|
|
24006
|
+
ServicesClient,
|
|
23802
24007
|
SharedWebSocket,
|
|
23803
24008
|
SmplClient,
|
|
23804
24009
|
SmplConflictError,
|