@pontive/server 1.26.0 → 1.28.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.
- package/dist/client-BkRsOrbo.cjs +2 -0
- package/dist/client-BkRsOrbo.cjs.map +1 -0
- package/dist/{client-BI4W1IJJ.js → client-DhAfqKrD.js} +99 -104
- package/dist/client-DhAfqKrD.js.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1371 -439
- package/dist/index.js.map +1 -1
- package/dist/management/generated/namespaces.d.cts +20 -27
- package/dist/management/generated/namespaces.d.ts +20 -27
- package/dist/management/generated/types.d.cts +105 -101
- package/dist/management/generated/types.d.ts +105 -101
- package/dist/management.cjs +1 -1
- package/dist/management.js +1 -1
- package/dist/platform/client.d.cts +49 -0
- package/dist/platform/client.d.ts +49 -0
- package/dist/platform/core.d.cts +1 -0
- package/dist/platform/core.d.ts +1 -0
- package/dist/platform/generated/namespaces.d.cts +767 -0
- package/dist/platform/generated/namespaces.d.ts +767 -0
- package/dist/platform/generated/types.d.cts +2075 -0
- package/dist/platform/generated/types.d.ts +2075 -0
- package/dist/platform/index.d.cts +6 -0
- package/dist/platform/index.d.ts +6 -0
- package/package.json +1 -1
- package/dist/client-BI4W1IJJ.js.map +0 -1
- package/dist/client-fmMA2Var.cjs +0 -2
- package/dist/client-fmMA2Var.cjs.map +0 -1
|
@@ -38,8 +38,8 @@ export interface AccessKeyWithSecret {
|
|
|
38
38
|
updated_at?: string;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* AccessOutcomes decide what losing a contract or access leads to in the
|
|
42
|
-
* are set; on an update only the fields given change.
|
|
41
|
+
* AccessOutcomes decide what losing a contract or access leads to in the Customer's access. On a read
|
|
42
|
+
* both are set; on an update only the fields given change.
|
|
43
43
|
*/
|
|
44
44
|
export interface AccessOutcomes {
|
|
45
45
|
/**
|
|
@@ -52,8 +52,8 @@ export interface AccessOutcomes {
|
|
|
52
52
|
on_contract_ended: string;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* AccessOutcomes decide what losing a contract or access leads to in the
|
|
56
|
-
* are set; on an update only the fields given change.
|
|
55
|
+
* AccessOutcomes decide what losing a contract or access leads to in the Customer's access. On a read
|
|
56
|
+
* both are set; on an update only the fields given change.
|
|
57
57
|
*/
|
|
58
58
|
export interface AccessOutcomesInput {
|
|
59
59
|
/**
|
|
@@ -1131,7 +1131,7 @@ export interface BillingScheduleInput {
|
|
|
1131
1131
|
*/
|
|
1132
1132
|
export interface BillingSettings {
|
|
1133
1133
|
/**
|
|
1134
|
-
* What losing a contract or access leads to in the
|
|
1134
|
+
* What losing a contract or access leads to in the Customer's access.
|
|
1135
1135
|
*/
|
|
1136
1136
|
access_outcomes: AccessOutcomes;
|
|
1137
1137
|
default_collection: Collection;
|
|
@@ -3009,8 +3009,9 @@ export interface CreateSubscriptionRequest {
|
|
|
3009
3009
|
headers?: Record<string, string>;
|
|
3010
3010
|
metadata?: Record<string, string>;
|
|
3011
3011
|
organization_id?: string;
|
|
3012
|
-
scope?: "
|
|
3012
|
+
scope?: "instance" | "organization" | "workspace";
|
|
3013
3013
|
url: string;
|
|
3014
|
+
workspace_id?: string;
|
|
3014
3015
|
}
|
|
3015
3016
|
export interface CreateTimeMachineRequest {
|
|
3016
3017
|
/**
|
|
@@ -3426,6 +3427,81 @@ export interface Customer {
|
|
|
3426
3427
|
time_machine_id: string;
|
|
3427
3428
|
updated_at: string;
|
|
3428
3429
|
}
|
|
3430
|
+
/**
|
|
3431
|
+
* CustomerAccess is a Customer's access, part of the Customer: it has no id of its own.
|
|
3432
|
+
*/
|
|
3433
|
+
export interface CustomerAccess {
|
|
3434
|
+
computed_at: string;
|
|
3435
|
+
/**
|
|
3436
|
+
* "cust_" plus 26 characters.
|
|
3437
|
+
*/
|
|
3438
|
+
customer_id: string;
|
|
3439
|
+
/**
|
|
3440
|
+
* Every feature the subject resolves a value for, by key. A feature no source sets is absent: the
|
|
3441
|
+
* subject is not entitled to it.
|
|
3442
|
+
*/
|
|
3443
|
+
features: Record<string, CustomerAccessFeature>;
|
|
3444
|
+
object: "customer_access";
|
|
3445
|
+
/**
|
|
3446
|
+
* The key of the package of the contract in force; unset with none.
|
|
3447
|
+
*/
|
|
3448
|
+
package: string;
|
|
3449
|
+
/**
|
|
3450
|
+
* The seat cap; unset with none.
|
|
3451
|
+
*/
|
|
3452
|
+
seat_limit: number;
|
|
3453
|
+
/**
|
|
3454
|
+
* The Customer's subject, since an enforcer works by subject.
|
|
3455
|
+
*/
|
|
3456
|
+
subject: EntitlementSubject;
|
|
3457
|
+
suspended: boolean;
|
|
3458
|
+
/**
|
|
3459
|
+
* dunning, contract_ended, client_block or subject_deleted; unset when not suspended.
|
|
3460
|
+
*/
|
|
3461
|
+
suspension_cause: string;
|
|
3462
|
+
/**
|
|
3463
|
+
* Increases on every change; 0 for a Customer with no access stored yet.
|
|
3464
|
+
*/
|
|
3465
|
+
version: number;
|
|
3466
|
+
}
|
|
3467
|
+
/**
|
|
3468
|
+
* CustomerAccessFeature is one feature's value in an access, by its type. The gateway writes it as
|
|
3469
|
+
* billing.customer.access_changed carries it: { type, value } for a boolean (true or false) or a
|
|
3470
|
+
* numeric feature (a decimal string), and { type, allowance, per, limit, overage, exhausted } for a
|
|
3471
|
+
* metered one, the metered fields inline.
|
|
3472
|
+
*/
|
|
3473
|
+
export interface CustomerAccessFeature {
|
|
3474
|
+
/**
|
|
3475
|
+
* A decimal.
|
|
3476
|
+
*/
|
|
3477
|
+
allowance?: string;
|
|
3478
|
+
/**
|
|
3479
|
+
* True when the usage period's usage has reached the allowance: under a hard limit the next use is
|
|
3480
|
+
* denied. Recomputed, with a new version, when usage crosses the allowance either way.
|
|
3481
|
+
*/
|
|
3482
|
+
exhausted?: boolean;
|
|
3483
|
+
/**
|
|
3484
|
+
* hard or soft.
|
|
3485
|
+
*/
|
|
3486
|
+
limit?: string;
|
|
3487
|
+
/**
|
|
3488
|
+
* bill or block.
|
|
3489
|
+
*/
|
|
3490
|
+
overage?: string;
|
|
3491
|
+
/**
|
|
3492
|
+
* period: the allowance is per usage period.
|
|
3493
|
+
*/
|
|
3494
|
+
per?: string;
|
|
3495
|
+
/**
|
|
3496
|
+
* boolean, numeric or metered.
|
|
3497
|
+
*/
|
|
3498
|
+
type: string;
|
|
3499
|
+
/**
|
|
3500
|
+
* A boolean or numeric feature's value; null for no limit. A metered feature carries its fields
|
|
3501
|
+
* instead.
|
|
3502
|
+
*/
|
|
3503
|
+
value?: boolean | string;
|
|
3504
|
+
}
|
|
3429
3505
|
export interface CustomerList {
|
|
3430
3506
|
data: Customer[];
|
|
3431
3507
|
object: "list";
|
|
@@ -3852,7 +3928,7 @@ export interface Edge {
|
|
|
3852
3928
|
*/
|
|
3853
3929
|
export interface Edit {
|
|
3854
3930
|
applied_at: string;
|
|
3855
|
-
|
|
3931
|
+
canceled_at: string;
|
|
3856
3932
|
contract_id: string;
|
|
3857
3933
|
created_at: string;
|
|
3858
3934
|
deleted_at: string;
|
|
@@ -3870,7 +3946,7 @@ export interface Edit {
|
|
|
3870
3946
|
operations: Array<OperationSetQuantity | OperationAddSubscription | OperationEndSubscription | OperationAddOverride | OperationEndOverride | OperationChangePackage | OperationEndTrial | OperationAddBlock | OperationLiftBlock | OperationSetFeature | OperationUnsetFeature | OperationChangeBillingFrequency>;
|
|
3871
3947
|
reason: string;
|
|
3872
3948
|
/**
|
|
3873
|
-
* scheduled, applied, deleted, dropped or
|
|
3949
|
+
* scheduled, applied, deleted, dropped or canceled.
|
|
3874
3950
|
*/
|
|
3875
3951
|
status: string;
|
|
3876
3952
|
}
|
|
@@ -4079,6 +4155,10 @@ export interface Event {
|
|
|
4079
4155
|
organization_id?: string;
|
|
4080
4156
|
source?: "system" | "custom" | "meta" | "test";
|
|
4081
4157
|
type?: string;
|
|
4158
|
+
/**
|
|
4159
|
+
* WorkspaceID is set on a workspace-level event, in the Platform Plane instance.
|
|
4160
|
+
*/
|
|
4161
|
+
workspace_id?: string;
|
|
4082
4162
|
}
|
|
4083
4163
|
export interface EventCursorList {
|
|
4084
4164
|
data: BillingEvent[];
|
|
@@ -4124,7 +4204,7 @@ export interface EventType {
|
|
|
4124
4204
|
object?: string;
|
|
4125
4205
|
payload_schema?: string;
|
|
4126
4206
|
schema_mode?: "strict" | "lenient";
|
|
4127
|
-
scope?: "
|
|
4207
|
+
scope?: "instance" | "organization" | "workspace";
|
|
4128
4208
|
type?: "system" | "custom";
|
|
4129
4209
|
updated_at?: string;
|
|
4130
4210
|
}
|
|
@@ -10111,82 +10191,6 @@ export interface StaffAccess {
|
|
|
10111
10191
|
reason?: string;
|
|
10112
10192
|
session_id?: string;
|
|
10113
10193
|
}
|
|
10114
|
-
/**
|
|
10115
|
-
* SubjectState is one subject's state.
|
|
10116
|
-
*/
|
|
10117
|
-
export interface SubjectState {
|
|
10118
|
-
computed_at: string;
|
|
10119
|
-
/**
|
|
10120
|
-
* "cust_" plus 26 characters; unset when the subject has no Customer.
|
|
10121
|
-
*/
|
|
10122
|
-
customer_id: string;
|
|
10123
|
-
/**
|
|
10124
|
-
* Every feature the subject resolves a value for, by key. A feature no source sets is absent: the
|
|
10125
|
-
* subject is not entitled to it.
|
|
10126
|
-
*/
|
|
10127
|
-
features: Record<string, SubjectStateFeature>;
|
|
10128
|
-
/**
|
|
10129
|
-
* "inst_" plus 26 characters.
|
|
10130
|
-
*/
|
|
10131
|
-
instance_id: string;
|
|
10132
|
-
object: "subject_state";
|
|
10133
|
-
/**
|
|
10134
|
-
* The key of the package of the contract in force; unset with none.
|
|
10135
|
-
*/
|
|
10136
|
-
package: string;
|
|
10137
|
-
/**
|
|
10138
|
-
* The seat cap; unset with none.
|
|
10139
|
-
*/
|
|
10140
|
-
seat_limit: number;
|
|
10141
|
-
subject: EntitlementSubject;
|
|
10142
|
-
suspended: boolean;
|
|
10143
|
-
/**
|
|
10144
|
-
* dunning, contract_ended, client_block or subject_deleted; unset when not suspended.
|
|
10145
|
-
*/
|
|
10146
|
-
suspension_cause: string;
|
|
10147
|
-
/**
|
|
10148
|
-
* Increases on every change; 0 for a subject with no state stored.
|
|
10149
|
-
*/
|
|
10150
|
-
version: number;
|
|
10151
|
-
}
|
|
10152
|
-
/**
|
|
10153
|
-
* SubjectStateFeature is one feature's value in a state, by its type. The gateway writes it as
|
|
10154
|
-
* billing.subject_state.changed carries it: { type, value } for a boolean (true or false) or a numeric
|
|
10155
|
-
* feature (a decimal string), and { type, allowance, per, limit, overage, exhausted } for a metered
|
|
10156
|
-
* one, the metered fields inline.
|
|
10157
|
-
*/
|
|
10158
|
-
export interface SubjectStateFeature {
|
|
10159
|
-
/**
|
|
10160
|
-
* A decimal.
|
|
10161
|
-
*/
|
|
10162
|
-
allowance?: string;
|
|
10163
|
-
/**
|
|
10164
|
-
* True when the usage period's usage has reached the allowance: under a hard limit the next use is
|
|
10165
|
-
* denied. Recomputed, with a new version, when usage crosses the allowance either way.
|
|
10166
|
-
*/
|
|
10167
|
-
exhausted?: boolean;
|
|
10168
|
-
/**
|
|
10169
|
-
* hard or soft.
|
|
10170
|
-
*/
|
|
10171
|
-
limit?: string;
|
|
10172
|
-
/**
|
|
10173
|
-
* bill or block.
|
|
10174
|
-
*/
|
|
10175
|
-
overage?: string;
|
|
10176
|
-
/**
|
|
10177
|
-
* period: the allowance is per usage period.
|
|
10178
|
-
*/
|
|
10179
|
-
per?: string;
|
|
10180
|
-
/**
|
|
10181
|
-
* boolean, numeric or metered.
|
|
10182
|
-
*/
|
|
10183
|
-
type: string;
|
|
10184
|
-
/**
|
|
10185
|
-
* A boolean or numeric feature's value; null for no limit. A metered feature carries its fields
|
|
10186
|
-
* instead.
|
|
10187
|
-
*/
|
|
10188
|
-
value?: boolean | string;
|
|
10189
|
-
}
|
|
10190
10194
|
export interface Subscription {
|
|
10191
10195
|
allow_private_ips?: boolean;
|
|
10192
10196
|
created_at?: string;
|
|
@@ -10199,7 +10203,7 @@ export interface Subscription {
|
|
|
10199
10203
|
metadata?: Record<string, string>;
|
|
10200
10204
|
object?: string;
|
|
10201
10205
|
organization_id?: string;
|
|
10202
|
-
scope?: "
|
|
10206
|
+
scope?: "instance" | "organization" | "workspace";
|
|
10203
10207
|
/**
|
|
10204
10208
|
* Secret is the plaintext Standard Webhooks signing secret ("whsec_…"). Present only in
|
|
10205
10209
|
* create/rotate-secret responses; never readable again.
|
|
@@ -10210,6 +10214,11 @@ export interface Subscription {
|
|
|
10210
10214
|
status?: "active" | "paused" | "failing" | "disabled";
|
|
10211
10215
|
updated_at?: string;
|
|
10212
10216
|
url?: string;
|
|
10217
|
+
/**
|
|
10218
|
+
* WorkspaceID is the workspace a workspace-scope subscription is bound to, in the Platform Plane
|
|
10219
|
+
* instance (pontive-spec 11, Webhook levels).
|
|
10220
|
+
*/
|
|
10221
|
+
workspace_id?: string;
|
|
10213
10222
|
}
|
|
10214
10223
|
/**
|
|
10215
10224
|
* SubscriptionInput is a subscription as a client sends it, at creation or in add_subscription.
|
|
@@ -13043,19 +13052,6 @@ export interface UpdateBillingSettingsParams {
|
|
|
13043
13052
|
*/
|
|
13044
13053
|
if_match?: string;
|
|
13045
13054
|
}
|
|
13046
|
-
/**
|
|
13047
|
-
* The parameters of `GetSubjectState`.
|
|
13048
|
-
*/
|
|
13049
|
-
export interface GetSubjectStateParams {
|
|
13050
|
-
/**
|
|
13051
|
-
* user, organization or external
|
|
13052
|
-
*/
|
|
13053
|
-
subject_type: string;
|
|
13054
|
-
/**
|
|
13055
|
-
* A user's or organization's id, or the client's own external id
|
|
13056
|
-
*/
|
|
13057
|
-
subject_id: string;
|
|
13058
|
-
}
|
|
13059
13055
|
/**
|
|
13060
13056
|
* The parameters of `ListTimeMachines`.
|
|
13061
13057
|
*/
|
|
@@ -14754,7 +14750,7 @@ export interface ListWebhookEventTypesParams {
|
|
|
14754
14750
|
*/
|
|
14755
14751
|
type?: string;
|
|
14756
14752
|
/**
|
|
14757
|
-
* Filter by scope (
|
|
14753
|
+
* Filter by scope (instance|organization|workspace)
|
|
14758
14754
|
*/
|
|
14759
14755
|
scope?: string;
|
|
14760
14756
|
/**
|
|
@@ -14782,6 +14778,10 @@ export interface ListWebhookEventsParams {
|
|
|
14782
14778
|
* Filter by organization (org_…)
|
|
14783
14779
|
*/
|
|
14784
14780
|
organization_id?: string;
|
|
14781
|
+
/**
|
|
14782
|
+
* Filter by workspace (ws_…): a workspace-level event, in the Platform Plane instance
|
|
14783
|
+
*/
|
|
14784
|
+
workspace_id?: string;
|
|
14785
14785
|
/**
|
|
14786
14786
|
* RFC 3339: created at or after
|
|
14787
14787
|
*/
|
|
@@ -14808,7 +14808,7 @@ export interface ListWebhookEventsParams {
|
|
|
14808
14808
|
*/
|
|
14809
14809
|
export interface ListWebhookSubscriptionsParams {
|
|
14810
14810
|
/**
|
|
14811
|
-
* Filter by scope (
|
|
14811
|
+
* Filter by scope (instance|organization|workspace)
|
|
14812
14812
|
*/
|
|
14813
14813
|
scope?: string;
|
|
14814
14814
|
/**
|
|
@@ -14819,6 +14819,10 @@ export interface ListWebhookSubscriptionsParams {
|
|
|
14819
14819
|
* Filter organization-scope subscriptions by organization (org_…)
|
|
14820
14820
|
*/
|
|
14821
14821
|
organization_id?: string;
|
|
14822
|
+
/**
|
|
14823
|
+
* Filter workspace-scope subscriptions by workspace (ws_…)
|
|
14824
|
+
*/
|
|
14825
|
+
workspace_id?: string;
|
|
14822
14826
|
/**
|
|
14823
14827
|
* Sort field; prefix with - for descending. Allowed: created_at, updated_at, status, url. Default:
|
|
14824
14828
|
* -created_at
|
package/dist/management.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./client-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./client-BkRsOrbo.cjs");exports.APIPromise=r.APIPromise;exports.AuthenticationError=r.AuthenticationError;exports.BadRequestError=r.BadRequestError;exports.ConflictError=r.ConflictError;exports.InternalServerError=r.InternalServerError;exports.NotFoundError=r.NotFoundError;exports.Page=r.Page;exports.PagePromise=r.PagePromise;exports.PermissionDeniedError=r.PermissionDeniedError;exports.Pontive=r.Pontive;exports.PontiveAPIError=r.PontiveAPIError;exports.PontiveConnectionError=r.PontiveConnectionError;exports.PreconditionFailedError=r.PreconditionFailedError;exports.RateLimitError=r.RateLimitError;exports.UnprocessableEntityError=r.UnprocessableEntityError;exports.secretKeyRegion=r.secretKeyRegion;
|
|
2
2
|
//# sourceMappingURL=management.cjs.map
|
package/dist/management.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a, B as s, C as i, I as n, N as t, P as E, b as P, c, d, e as m, f as g, g as l, R as v, U as A, s as I } from "./client-
|
|
1
|
+
import { A as e, a, B as s, C as i, I as n, N as t, P as E, b as P, c, d, e as m, f as g, g as l, R as v, U as A, s as I } from "./client-DhAfqKrD.js";
|
|
2
2
|
export {
|
|
3
3
|
e as APIPromise,
|
|
4
4
|
a as AuthenticationError,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Env } from '../env.cjs';
|
|
2
|
+
import { PontiveNamespaces } from './generated/namespaces.cjs';
|
|
3
|
+
/** The platform API's host, unless overridden. */
|
|
4
|
+
export declare const PLATFORM_URL = "https://api.pontive.com";
|
|
5
|
+
/**
|
|
6
|
+
* How a {@link PontivePlatform} client authenticates and where it sends its
|
|
7
|
+
* calls. Every field is optional: one left out falls back to its environment
|
|
8
|
+
* variable, so `new PontivePlatform()` works with `PONTIVE_WORKSPACE_KEY` or
|
|
9
|
+
* `PONTIVE_ACCESS_TOKEN` set.
|
|
10
|
+
*/
|
|
11
|
+
export interface PontivePlatformOptions {
|
|
12
|
+
/** A workspace secret key, `pontive_wsk_…`: CI, Terraform, provisioning. Default: `PONTIVE_WORKSPACE_KEY`. */
|
|
13
|
+
workspaceKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A personal access token, `pontive_pat_…`, for your own scripts, or any
|
|
16
|
+
* bearer token (a function returning one) the caller manages. Default:
|
|
17
|
+
* `PONTIVE_ACCESS_TOKEN`.
|
|
18
|
+
*/
|
|
19
|
+
token?: string | (() => string | Promise<string>);
|
|
20
|
+
/** Overrides the platform API's base, `https://api.pontive.com`. Default: `PONTIVE_PLATFORM_URL`. */
|
|
21
|
+
platformUrl?: string;
|
|
22
|
+
/** How many times a failed call is retried: a 429, a 5xx or a network error, when it is safe to repeat. Default 2. */
|
|
23
|
+
maxRetries?: number;
|
|
24
|
+
/** Milliseconds each attempt may take. Default 60000. */
|
|
25
|
+
timeout?: number;
|
|
26
|
+
/** The `fetch` to send with. Default: the global one. */
|
|
27
|
+
fetch?: typeof fetch;
|
|
28
|
+
/** The environment to fall back to. Default: `process.env`. */
|
|
29
|
+
env?: Env;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A client for Pontive's platform API, `api.pontive.com`: the workspace, its
|
|
33
|
+
* projects, instances, members, domains and webhooks, and the instances'
|
|
34
|
+
* secret keys (pontive-spec 48). Namespaces follow the API:
|
|
35
|
+
* `platform.projects`, `platform.instances`, `platform.workspaces.webhooks`, …
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* const platform = new PontivePlatform({ workspaceKey: process.env.PONTIVE_WORKSPACE_KEY });
|
|
39
|
+
* const instance = await platform.instances.create({ project_id: "proj_…", name: "preview-42" });
|
|
40
|
+
* const key = await platform.instances.createSecretKey(instance.id, { name: "ci", role: "developer" });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* A workspace key or personal access token reaches one workspace, with its
|
|
44
|
+
* role there. Server-side only: the constructor refuses a credential in a
|
|
45
|
+
* browser.
|
|
46
|
+
*/
|
|
47
|
+
export declare class PontivePlatform extends PontiveNamespaces {
|
|
48
|
+
constructor(options?: PontivePlatformOptions);
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Env } from '../env.js';
|
|
2
|
+
import { PontiveNamespaces } from './generated/namespaces.js';
|
|
3
|
+
/** The platform API's host, unless overridden. */
|
|
4
|
+
export declare const PLATFORM_URL = "https://api.pontive.com";
|
|
5
|
+
/**
|
|
6
|
+
* How a {@link PontivePlatform} client authenticates and where it sends its
|
|
7
|
+
* calls. Every field is optional: one left out falls back to its environment
|
|
8
|
+
* variable, so `new PontivePlatform()` works with `PONTIVE_WORKSPACE_KEY` or
|
|
9
|
+
* `PONTIVE_ACCESS_TOKEN` set.
|
|
10
|
+
*/
|
|
11
|
+
export interface PontivePlatformOptions {
|
|
12
|
+
/** A workspace secret key, `pontive_wsk_…`: CI, Terraform, provisioning. Default: `PONTIVE_WORKSPACE_KEY`. */
|
|
13
|
+
workspaceKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A personal access token, `pontive_pat_…`, for your own scripts, or any
|
|
16
|
+
* bearer token (a function returning one) the caller manages. Default:
|
|
17
|
+
* `PONTIVE_ACCESS_TOKEN`.
|
|
18
|
+
*/
|
|
19
|
+
token?: string | (() => string | Promise<string>);
|
|
20
|
+
/** Overrides the platform API's base, `https://api.pontive.com`. Default: `PONTIVE_PLATFORM_URL`. */
|
|
21
|
+
platformUrl?: string;
|
|
22
|
+
/** How many times a failed call is retried: a 429, a 5xx or a network error, when it is safe to repeat. Default 2. */
|
|
23
|
+
maxRetries?: number;
|
|
24
|
+
/** Milliseconds each attempt may take. Default 60000. */
|
|
25
|
+
timeout?: number;
|
|
26
|
+
/** The `fetch` to send with. Default: the global one. */
|
|
27
|
+
fetch?: typeof fetch;
|
|
28
|
+
/** The environment to fall back to. Default: `process.env`. */
|
|
29
|
+
env?: Env;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A client for Pontive's platform API, `api.pontive.com`: the workspace, its
|
|
33
|
+
* projects, instances, members, domains and webhooks, and the instances'
|
|
34
|
+
* secret keys (pontive-spec 48). Namespaces follow the API:
|
|
35
|
+
* `platform.projects`, `platform.instances`, `platform.workspaces.webhooks`, …
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* const platform = new PontivePlatform({ workspaceKey: process.env.PONTIVE_WORKSPACE_KEY });
|
|
39
|
+
* const instance = await platform.instances.create({ project_id: "proj_…", name: "preview-42" });
|
|
40
|
+
* const key = await platform.instances.createSecretKey(instance.id, { name: "ci", role: "developer" });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* A workspace key or personal access token reaches one workspace, with its
|
|
44
|
+
* role there. Server-side only: the constructor refuses a credential in a
|
|
45
|
+
* browser.
|
|
46
|
+
*/
|
|
47
|
+
export declare class PontivePlatform extends PontiveNamespaces {
|
|
48
|
+
constructor(options?: PontivePlatformOptions);
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../management/core.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../management/core.js';
|