@pontive/server 1.27.0 → 1.29.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/README.md CHANGED
@@ -161,12 +161,32 @@ const page = await pontive.users.list({ limit: 50 }); // or one page: page.data,
161
161
  header such as the `ETag` an `if_match` update needs.
162
162
  - **Billing** is typed like the rest: `pontive.billing.customers.create({ name:
163
163
  "Acme" })` takes a `CreateCustomerRequest` and resolves to a `Customer`.
164
- - Not in this client: the platform API (`api.pontive.com`: workspaces,
165
- projects, instances).
166
-
167
164
  The client is generated from the management API's OpenAPI documents;
168
165
  `src/management/generated` is not edited by hand.
169
166
 
167
+ ### The platform API
168
+
169
+ `PontivePlatform` calls `api.pontive.com`: your workspace, its projects,
170
+ instances, members, invitations, domains and webhooks, and each instance's
171
+ secret keys. It takes a **workspace secret key** (`pontive_wsk_…`, for CI,
172
+ Terraform and provisioning; made by a workspace owner or admin under
173
+ *Workspace → Settings → API keys*) or a **personal access token**
174
+ (`pontive_pat_…`, for your own scripts; *Account → Personal access tokens*).
175
+ Either reaches one workspace, with its role there.
176
+
177
+ ```ts
178
+ import { PontivePlatform, Pontive } from "@pontive/server";
179
+
180
+ const platform = new PontivePlatform(); // PONTIVE_WORKSPACE_KEY or PONTIVE_ACCESS_TOKEN
181
+ const instance = await platform.instances.create({ project_id: "proj_…", environment: "non_production", name: "preview-42" });
182
+ const key = await platform.instances.createSecretKey(instance.id!, { name: "ci", role: "developer" });
183
+ const pontive = new Pontive({ secretKey: key.value }); // that instance's management API
184
+ ```
185
+
186
+ `platformUrl` / `PONTIVE_PLATFORM_URL` points it at another installation.
187
+ Creating or deleting a workspace, its ownership, its keys and personal access
188
+ tokens stay in the dashboard and are not in this client.
189
+
170
190
  ## Using Pontive with a coding agent
171
191
 
172
192
  Copy this block into your app's `AGENTS.md` (read by Codex, Cursor, Lovable, Claude Code and others).
@@ -11,27 +11,27 @@ const $ = {
11
11
  region: "PONTIVE_REGION",
12
12
  keyless: "PONTIVE_KEYLESS"
13
13
  };
14
- function b() {
14
+ function y() {
15
15
  try {
16
16
  return globalThis.process?.env ?? {};
17
17
  } catch {
18
18
  return {};
19
19
  }
20
20
  }
21
- const y = (i) => i && i.trim() ? i.trim() : void 0;
22
- function bt(i, e = b()) {
21
+ const b = (i) => i && i.trim() ? i.trim() : void 0;
22
+ function yt(i, e = y()) {
23
23
  return {
24
24
  ...i,
25
- issuer: i.issuer || y(e[$.issuer]),
26
- clientId: i.clientId || y(e[$.clientId]),
27
- clientSecret: i.clientSecret || y(e[$.clientSecret]),
28
- sessionSecret: i.sessionSecret || y(e[$.sessionSecret])
25
+ issuer: i.issuer || b(e[$.issuer]),
26
+ clientId: i.clientId || b(e[$.clientId]),
27
+ clientSecret: i.clientSecret || b(e[$.clientSecret]),
28
+ sessionSecret: i.sessionSecret || b(e[$.sessionSecret])
29
29
  };
30
30
  }
31
- function M(i = b()) {
31
+ function M(i = y()) {
32
32
  return i.NODE_ENV === "development";
33
33
  }
34
- function Pt(i, e = b()) {
34
+ function Pt(i, e = y()) {
35
35
  return M(e) && !i.issuer && e[$.keyless]?.trim() !== "0";
36
36
  }
37
37
  class c extends Error {
@@ -96,7 +96,7 @@ class A extends Error {
96
96
  super(e, t), this.name = "PontiveConnectionError";
97
97
  }
98
98
  }
99
- const j = "1.27.0", S = 6e4;
99
+ const j = "1.29.0", S = 6e4;
100
100
  class W {
101
101
  constructor(e) {
102
102
  this.config = e;
@@ -1100,7 +1100,7 @@ class oe {
1100
1100
  class ae {
1101
1101
  /** @internal */
1102
1102
  constructor(e) {
1103
- this.core = e, this.accountLinking = new he(e), this.authflows = new ne(e), this.connections = new ce(e), this.identityPolicy = new ue(e), this.migrationSources = new pe(e), this.passwordPolicy = new le(e), this.sharedCredentials = new de(e), this.trustedIssuers = new me(e);
1103
+ this.core = e, this.accountLinking = new he(e), this.authflows = new ne(e), this.connections = new ce(e), this.loginIdPolicy = new ue(e), this.migrationSources = new pe(e), this.passwordPolicy = new le(e), this.sharedCredentials = new de(e), this.trustedIssuers = new me(e);
1104
1104
  }
1105
1105
  core;
1106
1106
  /**
@@ -1116,9 +1116,9 @@ class ae {
1116
1116
  */
1117
1117
  connections;
1118
1118
  /**
1119
- * The identity policy: which identifiers users have, and the email policy.
1119
+ * The login ID policy: the rules for the email, phone and username users sign in with.
1120
1120
  */
1121
- identityPolicy;
1121
+ loginIdPolicy;
1122
1122
  /**
1123
1123
  * Systems users are migrated from, lazily or by import.
1124
1124
  */
@@ -1313,15 +1313,15 @@ class ue {
1313
1313
  }
1314
1314
  core;
1315
1315
  /**
1316
- * Get identity policy.
1316
+ * Get login ID policy.
1317
1317
  *
1318
- * Get the instance's identity policy (email, phone, and username rules). If none has been configured,
1318
+ * Get the instance's login ID policy (email, phone, and username rules). If none has been configured,
1319
1319
  * the default policy is returned.
1320
1320
  *
1321
- * `GET /v1/authn/identity-policy` (GetIdentityPolicy)
1321
+ * `GET /v1/authn/login-id-policy` (GetLoginIDPolicy)
1322
1322
  */
1323
1323
  get(e) {
1324
- return this.core.request({ host: "api", method: "GET", path: "/v1/authn/identity-policy" }, e);
1324
+ return this.core.request({ host: "api", method: "GET", path: "/v1/authn/login-id-policy" }, e);
1325
1325
  }
1326
1326
  /**
1327
1327
  * Preview email rules.
@@ -1330,21 +1330,21 @@ class ue {
1330
1330
  * (email.enforce_at_signin), with a count per rule. Changes nothing. Ask before turning enforcement
1331
1331
  * on, or tightening a rule while it is on, to see who would be locked out.
1332
1332
  *
1333
- * `POST /v1/authn/identity-policy/email/preview` (PreviewEmailPolicy)
1333
+ * `POST /v1/authn/login-id-policy/email/preview` (PreviewEmailPolicy)
1334
1334
  */
1335
1335
  previewEmailPolicy(e, t) {
1336
- return this.core.request({ host: "api", method: "POST", path: "/v1/authn/identity-policy/email/preview", body: e }, t);
1336
+ return this.core.request({ host: "api", method: "POST", path: "/v1/authn/login-id-policy/email/preview", body: e }, t);
1337
1337
  }
1338
1338
  /**
1339
- * Update identity policy.
1339
+ * Update login ID policy.
1340
1340
  *
1341
- * Patch the instance's identity policy. Omitted sub-policies and fields are left unchanged.
1341
+ * Patch the instance's login ID policy. Omitted sub-policies and fields are left unchanged.
1342
1342
  *
1343
- * `PATCH /v1/authn/identity-policy` (UpdateIdentityPolicy)
1343
+ * `PATCH /v1/authn/login-id-policy` (UpdateLoginIDPolicy)
1344
1344
  */
1345
1345
  update(e, t, r) {
1346
1346
  const { if_match: o } = t ?? {};
1347
- return this.core.request({ host: "api", method: "PATCH", path: "/v1/authn/identity-policy", headers: { "If-Match": o }, body: e }, r);
1347
+ return this.core.request({ host: "api", method: "PATCH", path: "/v1/authn/login-id-policy", headers: { "If-Match": o }, body: e }, r);
1348
1348
  }
1349
1349
  }
1350
1350
  class pe {
@@ -2031,7 +2031,7 @@ class Ee {
2031
2031
  class $e {
2032
2032
  /** @internal */
2033
2033
  constructor(e) {
2034
- this.core = e, this.catalog = new ye(e), this.catalogRules = new be(e), this.checkoutSessions = new Pe(e), this.contracts = new Se(e), this.creditNotes = new Oe(e), this.currencies = new Ge(e), this.customers = new fe(e), this.disputes = new we(e), this.dunning = new Ae(e), this.entitlements = new Ce(e), this.eventTypes = new ke(e), this.events = new Ie(e), this.exchangeRates = new ze(e), this.features = new Le(e), this.grants = new De(e), this.invoices = new Me(e), this.ledger = new _e(e), this.meters = new Re(e), this.packages = new xe(e), this.paymentConnections = new Ne(e), this.paymentMethods = new Ue(e), this.payments = new He(e), this.pricingUnits = new Be(e), this.products = new Ve(e), this.rateCards = new Ke(e), this.refunds = new Fe(e), this.settings = new je(e), this.tax = new We(e), this.timeMachines = new Ye(e), this.usage = new Je(e);
2034
+ this.core = e, this.catalog = new be(e), this.catalogRules = new ye(e), this.checkoutSessions = new Pe(e), this.contracts = new Se(e), this.creditNotes = new Oe(e), this.currencies = new Ge(e), this.customers = new fe(e), this.disputes = new we(e), this.dunning = new Ae(e), this.entitlements = new Ce(e), this.eventTypes = new ke(e), this.events = new Ie(e), this.exchangeRates = new ze(e), this.features = new Le(e), this.grants = new De(e), this.invoices = new Me(e), this.ledger = new _e(e), this.meters = new Re(e), this.packages = new xe(e), this.paymentConnections = new Ne(e), this.paymentMethods = new Ue(e), this.payments = new He(e), this.pricingUnits = new Be(e), this.products = new Ve(e), this.rateCards = new Ke(e), this.refunds = new Fe(e), this.settings = new je(e), this.tax = new We(e), this.timeMachines = new Ye(e), this.usage = new Je(e);
2035
2035
  }
2036
2036
  core;
2037
2037
  catalog;
@@ -2065,7 +2065,7 @@ class $e {
2065
2065
  timeMachines;
2066
2066
  usage;
2067
2067
  }
2068
- class ye {
2068
+ class be {
2069
2069
  /** @internal */
2070
2070
  constructor(e) {
2071
2071
  this.core = e;
@@ -2101,7 +2101,7 @@ class ye {
2101
2101
  return this.core.request({ host: "api", method: "POST", path: "/v1/billing/catalog/import", body: e, idempotent: !0 }, t);
2102
2102
  }
2103
2103
  }
2104
- class be {
2104
+ class ye {
2105
2105
  /** @internal */
2106
2106
  constructor(e) {
2107
2107
  this.core = e;
@@ -6621,7 +6621,7 @@ function $t() {
6621
6621
  }
6622
6622
  class St extends te {
6623
6623
  constructor(e = {}) {
6624
- const t = e.env ?? b(), r = e.secretKey ?? E(t.PONTIVE_SECRET_KEY), o = e.issuer ?? E(t.PONTIVE_ISSUER), a = !!(e.clientId && e.clientSecret);
6624
+ const t = e.env ?? y(), r = e.secretKey ?? E(t.PONTIVE_SECRET_KEY), o = e.issuer ?? E(t.PONTIVE_ISSUER), a = !!(e.clientId && e.clientSecret);
6625
6625
  if (!e.token && !r && !a)
6626
6626
  throw new Error("pontive: no credential: pass secretKey, token, or clientId and clientSecret, or set PONTIVE_SECRET_KEY");
6627
6627
  if ((r || e.clientSecret) && $t())
@@ -6677,11 +6677,12 @@ export {
6677
6677
  c as e,
6678
6678
  A as f,
6679
6679
  H as g,
6680
- $ as h,
6680
+ W as h,
6681
6681
  M as i,
6682
+ $ as j,
6682
6683
  Pt as k,
6683
- b as p,
6684
+ y as p,
6684
6685
  Tt as s,
6685
- bt as w
6686
+ yt as w
6686
6687
  };
6687
- //# sourceMappingURL=client-B3NStbMW.js.map
6688
+ //# sourceMappingURL=client-B5zZyWMn.js.map