@graph8/sdk 0.13.0 → 0.14.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 +62 -6
- package/dist/index.d.mts +350 -13
- package/dist/index.d.ts +350 -13
- package/dist/index.js +341 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +338 -36
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +327 -7
- package/dist/react.d.ts +327 -7
- package/dist/react.js +333 -36
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +333 -36
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1216,10 +1216,284 @@ var createAppsClient = (apiKey, apiUrl) => {
|
|
|
1216
1216
|
};
|
|
1217
1217
|
};
|
|
1218
1218
|
|
|
1219
|
-
// src/
|
|
1219
|
+
// src/appPlatform.ts
|
|
1220
1220
|
var DEFAULT_API18 = "https://be.graph8.com";
|
|
1221
|
-
var
|
|
1221
|
+
var MIN_TAIL_LINES = 1;
|
|
1222
|
+
var MAX_TAIL_LINES = 2e3;
|
|
1223
|
+
var createAppPlatformClient = (apiKey, apiUrl) => {
|
|
1222
1224
|
const baseUrl = apiUrl || DEFAULT_API18;
|
|
1225
|
+
const unwrap = (resp) => resp.data ?? resp;
|
|
1226
|
+
return {
|
|
1227
|
+
// ---- source binding -------------------------------------------------
|
|
1228
|
+
/**
|
|
1229
|
+
* Bind the repository an app builds from.
|
|
1230
|
+
*
|
|
1231
|
+
* `repo_url` must be fetchable -- `https://`, `ssh://` or `git@`, with no
|
|
1232
|
+
* whitespace. A `file://` or bare path is refused with 422, because a build
|
|
1233
|
+
* that can read the builder's filesystem is a build that can read ours.
|
|
1234
|
+
*
|
|
1235
|
+
* `credential_ref` is a POINTER into your secret manager, not a token.
|
|
1236
|
+
*/
|
|
1237
|
+
async setSource(appId, params) {
|
|
1238
|
+
const resp = await request(
|
|
1239
|
+
baseUrl,
|
|
1240
|
+
`/api/v1/apps/${appId}/source`,
|
|
1241
|
+
apiKey,
|
|
1242
|
+
{
|
|
1243
|
+
method: "PUT",
|
|
1244
|
+
body: {
|
|
1245
|
+
repo_url: params.repo_url,
|
|
1246
|
+
provider: params.provider,
|
|
1247
|
+
default_branch: params.default_branch ?? null,
|
|
1248
|
+
credential_ref: params.credential_ref ?? null
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
);
|
|
1252
|
+
return unwrap(resp);
|
|
1253
|
+
},
|
|
1254
|
+
/** Unbind the source. Returns the full app with every source field null. */
|
|
1255
|
+
async clearSource(appId) {
|
|
1256
|
+
const resp = await request(
|
|
1257
|
+
baseUrl,
|
|
1258
|
+
`/api/v1/apps/${appId}/source`,
|
|
1259
|
+
apiKey,
|
|
1260
|
+
{ method: "DELETE" }
|
|
1261
|
+
);
|
|
1262
|
+
return unwrap(resp);
|
|
1263
|
+
},
|
|
1264
|
+
// ---- deployments ----------------------------------------------------
|
|
1265
|
+
/** Every deployment for this app, newest first. Never 404s for an app with none. */
|
|
1266
|
+
async listDeployments(appId) {
|
|
1267
|
+
return request(baseUrl, `/api/v1/apps/${appId}/deployments`, apiKey);
|
|
1268
|
+
},
|
|
1269
|
+
/**
|
|
1270
|
+
* Queue a deployment. Returns `201` with `status: "queued"` -- nothing builds
|
|
1271
|
+
* as a side effect of this call; the build controller picks it up.
|
|
1272
|
+
*
|
|
1273
|
+
* NOT idempotent: two identical calls create two deployments.
|
|
1274
|
+
*/
|
|
1275
|
+
async deploy(appId, params) {
|
|
1276
|
+
const body = { source_ref: params.source_ref };
|
|
1277
|
+
if (params.schema_version_id) body.schema_version_id = params.schema_version_id;
|
|
1278
|
+
const resp = await request(
|
|
1279
|
+
baseUrl,
|
|
1280
|
+
`/api/v1/apps/${appId}/deployments`,
|
|
1281
|
+
apiKey,
|
|
1282
|
+
{ method: "POST", body }
|
|
1283
|
+
);
|
|
1284
|
+
return unwrap(resp);
|
|
1285
|
+
},
|
|
1286
|
+
/** Fetch one deployment. The polling endpoint for a build loop. */
|
|
1287
|
+
async getDeployment(appId, deploymentId) {
|
|
1288
|
+
const resp = await request(
|
|
1289
|
+
baseUrl,
|
|
1290
|
+
`/api/v1/apps/${appId}/deployments/${deploymentId}`,
|
|
1291
|
+
apiKey
|
|
1292
|
+
);
|
|
1293
|
+
return unwrap(resp);
|
|
1294
|
+
},
|
|
1295
|
+
/**
|
|
1296
|
+
* The deployment currently serving traffic, or `null`.
|
|
1297
|
+
*
|
|
1298
|
+
* `null` is a real answer with a 200, not a 404: "this app has never shipped"
|
|
1299
|
+
* is information, while a 404 would read as "no such app".
|
|
1300
|
+
*/
|
|
1301
|
+
async activeDeployment(appId) {
|
|
1302
|
+
const resp = await request(
|
|
1303
|
+
baseUrl,
|
|
1304
|
+
`/api/v1/apps/${appId}/deployments/active`,
|
|
1305
|
+
apiKey
|
|
1306
|
+
);
|
|
1307
|
+
return resp.data ?? null;
|
|
1308
|
+
},
|
|
1309
|
+
/**
|
|
1310
|
+
* Promote a built deployment to serve traffic. Anything it displaces moves to
|
|
1311
|
+
* `rolled_back` in the same transaction, so there is never a moment with two
|
|
1312
|
+
* live deployments.
|
|
1313
|
+
*
|
|
1314
|
+
* `409` when the state machine forbids it -- a deployment cannot become
|
|
1315
|
+
* `deployed` without having been built, and a `failed` one cannot be revived.
|
|
1316
|
+
* A retry is a new deployment, not a resurrection.
|
|
1317
|
+
*/
|
|
1318
|
+
async promote(appId, deploymentId, imageDigest) {
|
|
1319
|
+
const resp = await request(
|
|
1320
|
+
baseUrl,
|
|
1321
|
+
`/api/v1/apps/${appId}/deployments/${deploymentId}/promote`,
|
|
1322
|
+
apiKey,
|
|
1323
|
+
{ method: "POST", body: { image_digest: imageDigest } }
|
|
1324
|
+
);
|
|
1325
|
+
return unwrap(resp);
|
|
1326
|
+
},
|
|
1327
|
+
/** Roll back a deployment that is currently serving. Only a `deployed` one may be. */
|
|
1328
|
+
async rollback(appId, deploymentId) {
|
|
1329
|
+
const resp = await request(
|
|
1330
|
+
baseUrl,
|
|
1331
|
+
`/api/v1/apps/${appId}/deployments/${deploymentId}/rollback`,
|
|
1332
|
+
apiKey,
|
|
1333
|
+
{ method: "POST", body: {} }
|
|
1334
|
+
);
|
|
1335
|
+
return unwrap(resp);
|
|
1336
|
+
},
|
|
1337
|
+
// ---- logs -----------------------------------------------------------
|
|
1338
|
+
/**
|
|
1339
|
+
* Why a build failed. Returns every step of the build pod in the order
|
|
1340
|
+
* Kubernetes runs them; a step that has not started yet is omitted rather
|
|
1341
|
+
* than returned empty.
|
|
1342
|
+
*
|
|
1343
|
+
* An empty `containers` list is not an error -- build pods are reaped an hour
|
|
1344
|
+
* after they finish, so logs for an older deployment are genuinely gone.
|
|
1345
|
+
* `last_error_sanitized` on the deployment is what survives.
|
|
1346
|
+
*
|
|
1347
|
+
* `503` means graph8 could not reach the cluster, which is deliberately
|
|
1348
|
+
* different from an empty `200`: one means we could not look, the other means
|
|
1349
|
+
* your build produced no output.
|
|
1350
|
+
*/
|
|
1351
|
+
async deploymentLogs(appId, deploymentId, tailLines) {
|
|
1352
|
+
const resp = await request(
|
|
1353
|
+
baseUrl,
|
|
1354
|
+
`/api/v1/apps/${appId}/deployments/${deploymentId}/logs`,
|
|
1355
|
+
apiKey,
|
|
1356
|
+
{ query: tailLines === void 0 ? void 0 : { tail_lines: tailLines } }
|
|
1357
|
+
);
|
|
1358
|
+
return unwrap(resp);
|
|
1359
|
+
},
|
|
1360
|
+
/**
|
|
1361
|
+
* What the running app is printing. The app's own pods only -- the per-app
|
|
1362
|
+
* egress proxy shares the namespace and is deliberately excluded.
|
|
1363
|
+
*
|
|
1364
|
+
* Empty until a deployment reaches `deployed`.
|
|
1365
|
+
*/
|
|
1366
|
+
async logs(appId, tailLines) {
|
|
1367
|
+
const resp = await request(
|
|
1368
|
+
baseUrl,
|
|
1369
|
+
`/api/v1/apps/${appId}/logs`,
|
|
1370
|
+
apiKey,
|
|
1371
|
+
{ query: tailLines === void 0 ? void 0 : { tail_lines: tailLines } }
|
|
1372
|
+
);
|
|
1373
|
+
return unwrap(resp);
|
|
1374
|
+
},
|
|
1375
|
+
// ---- domains --------------------------------------------------------
|
|
1376
|
+
/** Every hostname claimed for this app, whatever its verification state. */
|
|
1377
|
+
async listDomains(appId) {
|
|
1378
|
+
return request(baseUrl, `/api/v1/apps/${appId}/domains`, apiKey);
|
|
1379
|
+
},
|
|
1380
|
+
/**
|
|
1381
|
+
* Claim a hostname and get the TXT record that proves you own it.
|
|
1382
|
+
*
|
|
1383
|
+
* Returns `201`, and the domain is NESTED at `data.domain` -- this is the one
|
|
1384
|
+
* route on the surface whose payload is not the record itself. Hostnames are
|
|
1385
|
+
* globally unique, so a host another app holds is refused.
|
|
1386
|
+
*/
|
|
1387
|
+
async claimDomain(appId, hostname) {
|
|
1388
|
+
const resp = await request(
|
|
1389
|
+
baseUrl,
|
|
1390
|
+
`/api/v1/apps/${appId}/domains`,
|
|
1391
|
+
apiKey,
|
|
1392
|
+
{ method: "POST", body: { hostname } }
|
|
1393
|
+
);
|
|
1394
|
+
return unwrap(resp);
|
|
1395
|
+
},
|
|
1396
|
+
/**
|
|
1397
|
+
* Check DNS for the TXT record and advance the domain to `verified`.
|
|
1398
|
+
*
|
|
1399
|
+
* Idempotent: verifying an already-verified domain re-checks and stays
|
|
1400
|
+
* verified, so it is safe to re-run after a DNS change. Send no body -- the
|
|
1401
|
+
* record in DNS is the payload.
|
|
1402
|
+
*/
|
|
1403
|
+
async verifyDomain(appId, hostname) {
|
|
1404
|
+
const resp = await request(
|
|
1405
|
+
baseUrl,
|
|
1406
|
+
`/api/v1/apps/${appId}/domains/${encodeURIComponent(hostname)}/verify`,
|
|
1407
|
+
apiKey,
|
|
1408
|
+
{ method: "POST", body: {} }
|
|
1409
|
+
);
|
|
1410
|
+
return unwrap(resp);
|
|
1411
|
+
},
|
|
1412
|
+
/**
|
|
1413
|
+
* Release a claimed hostname.
|
|
1414
|
+
*
|
|
1415
|
+
* A HARD delete. Hostnames are globally unique, so a row left behind in any
|
|
1416
|
+
* status keeps the host burned for every other builder. Releasing one you
|
|
1417
|
+
* already released is a `404`, because after the first call the claim
|
|
1418
|
+
* genuinely does not exist.
|
|
1419
|
+
*
|
|
1420
|
+
* Returns the NORMALIZED hostname, which may differ from what you passed.
|
|
1421
|
+
*/
|
|
1422
|
+
async releaseDomain(appId, hostname) {
|
|
1423
|
+
const resp = await request(
|
|
1424
|
+
baseUrl,
|
|
1425
|
+
`/api/v1/apps/${appId}/domains/${encodeURIComponent(hostname)}`,
|
|
1426
|
+
apiKey,
|
|
1427
|
+
{ method: "DELETE" }
|
|
1428
|
+
);
|
|
1429
|
+
return unwrap(resp);
|
|
1430
|
+
},
|
|
1431
|
+
// ---- secrets --------------------------------------------------------
|
|
1432
|
+
/**
|
|
1433
|
+
* Which secrets this app declares, and when each was last rotated.
|
|
1434
|
+
*
|
|
1435
|
+
* NEVER returns a value. graph8 stores a POINTER into your secret manager and
|
|
1436
|
+
* has no column for the secret itself.
|
|
1437
|
+
*/
|
|
1438
|
+
async listSecrets(appId) {
|
|
1439
|
+
return request(baseUrl, `/api/v1/apps/${appId}/secrets`, apiKey);
|
|
1440
|
+
},
|
|
1441
|
+
/**
|
|
1442
|
+
* Declare a secret, or rotate the pointer to it.
|
|
1443
|
+
*
|
|
1444
|
+
* `providerRef` is a REFERENCE, and the server rejects anything that looks
|
|
1445
|
+
* like a credential -- a value starting `bearer `, `sk-`, `ghp_`, `xox` and
|
|
1446
|
+
* friends is a 422. That refusal is the feature: it catches the mistake of
|
|
1447
|
+
* pasting the secret where its address belongs.
|
|
1448
|
+
*/
|
|
1449
|
+
async putSecret(appId, secretKey, providerRef) {
|
|
1450
|
+
const resp = await request(
|
|
1451
|
+
baseUrl,
|
|
1452
|
+
`/api/v1/apps/${appId}/secrets/${encodeURIComponent(secretKey)}`,
|
|
1453
|
+
apiKey,
|
|
1454
|
+
{ method: "PUT", body: { provider_ref: providerRef ?? null } }
|
|
1455
|
+
);
|
|
1456
|
+
return unwrap(resp);
|
|
1457
|
+
},
|
|
1458
|
+
/** Undeclare a secret. A key the app never declared is a 404, so a typo is
|
|
1459
|
+
* never reported as a successful removal. */
|
|
1460
|
+
async deleteSecret(appId, secretKey) {
|
|
1461
|
+
const resp = await request(
|
|
1462
|
+
baseUrl,
|
|
1463
|
+
`/api/v1/apps/${appId}/secrets/${encodeURIComponent(secretKey)}`,
|
|
1464
|
+
apiKey,
|
|
1465
|
+
{ method: "DELETE" }
|
|
1466
|
+
);
|
|
1467
|
+
return unwrap(resp);
|
|
1468
|
+
},
|
|
1469
|
+
// ---- schema versions ------------------------------------------------
|
|
1470
|
+
/**
|
|
1471
|
+
* Publish a custom-object schema version. Returns `201`.
|
|
1472
|
+
*
|
|
1473
|
+
* Takes only the `objects` list, not a whole `graph8.app.yaml`: the rest of
|
|
1474
|
+
* that file is app metadata the control plane already holds, and accepting it
|
|
1475
|
+
* here would create a second place for it to disagree.
|
|
1476
|
+
*/
|
|
1477
|
+
async publishSchemaVersion(appId, objects) {
|
|
1478
|
+
const resp = await request(
|
|
1479
|
+
baseUrl,
|
|
1480
|
+
`/api/v1/apps/${appId}/schema-versions`,
|
|
1481
|
+
apiKey,
|
|
1482
|
+
{ method: "POST", body: { objects } }
|
|
1483
|
+
);
|
|
1484
|
+
return unwrap(resp);
|
|
1485
|
+
},
|
|
1486
|
+
/** Every schema version this app has published. Empty array, never 404. */
|
|
1487
|
+
async listSchemaVersions(appId) {
|
|
1488
|
+
return request(baseUrl, `/api/v1/apps/${appId}/schema-versions`, apiKey);
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
|
|
1493
|
+
// src/fields.ts
|
|
1494
|
+
var DEFAULT_API19 = "https://be.graph8.com";
|
|
1495
|
+
var createFieldsClient = (apiKey, apiUrl) => {
|
|
1496
|
+
const baseUrl = apiUrl || DEFAULT_API19;
|
|
1223
1497
|
return {
|
|
1224
1498
|
/** List contact fields (base + custom). Pass listId to include list-specific custom fields. */
|
|
1225
1499
|
async listContactFields(listId) {
|
|
@@ -1261,9 +1535,9 @@ var createFieldsClient = (apiKey, apiUrl) => {
|
|
|
1261
1535
|
};
|
|
1262
1536
|
|
|
1263
1537
|
// src/objects.ts
|
|
1264
|
-
var
|
|
1538
|
+
var DEFAULT_API20 = "https://be.graph8.com";
|
|
1265
1539
|
var createObjectsClient = (apiKey, apiUrl) => {
|
|
1266
|
-
const baseUrl = apiUrl ||
|
|
1540
|
+
const baseUrl = apiUrl || DEFAULT_API20;
|
|
1267
1541
|
const encode = (value) => encodeURIComponent(value);
|
|
1268
1542
|
return {
|
|
1269
1543
|
/** List the custom object types in your workspace. */
|
|
@@ -1324,12 +1598,12 @@ var createObjectsClient = (apiKey, apiUrl) => {
|
|
|
1324
1598
|
* Values are versioned rather than overwritten, so the previous value stays
|
|
1325
1599
|
* readable through `history`.
|
|
1326
1600
|
*/
|
|
1327
|
-
async updateRecord(objectSlug, recordId, values) {
|
|
1601
|
+
async updateRecord(objectSlug, recordId, values, options) {
|
|
1328
1602
|
const resp = await request(
|
|
1329
1603
|
baseUrl,
|
|
1330
1604
|
`/api/v1/objects/${encode(objectSlug)}/records/${encode(recordId)}`,
|
|
1331
1605
|
apiKey,
|
|
1332
|
-
{ method: "PATCH", body: { values } }
|
|
1606
|
+
{ method: "PATCH", body: { values, ...options?.expectedRevision === void 0 ? {} : { expected_revision: options.expectedRevision } } }
|
|
1333
1607
|
);
|
|
1334
1608
|
return resp.data ?? resp;
|
|
1335
1609
|
},
|
|
@@ -1346,6 +1620,16 @@ var createObjectsClient = (apiKey, apiUrl) => {
|
|
|
1346
1620
|
);
|
|
1347
1621
|
return resp.data ?? resp;
|
|
1348
1622
|
},
|
|
1623
|
+
/** Restore archived values under current constraints. Conflicts leave the record archived. */
|
|
1624
|
+
async restoreRecord(objectSlug, recordId) {
|
|
1625
|
+
const resp = await request(
|
|
1626
|
+
baseUrl,
|
|
1627
|
+
`/api/v1/objects/${encode(objectSlug)}/records/${encode(recordId)}/restore`,
|
|
1628
|
+
apiKey,
|
|
1629
|
+
{ method: "POST" }
|
|
1630
|
+
);
|
|
1631
|
+
return resp.data ?? resp;
|
|
1632
|
+
},
|
|
1349
1633
|
/**
|
|
1350
1634
|
* A record's value timeline, newest first. An entry whose `active_until` is
|
|
1351
1635
|
* null is the value currently in force.
|
|
@@ -1363,9 +1647,9 @@ var createObjectsClient = (apiKey, apiUrl) => {
|
|
|
1363
1647
|
};
|
|
1364
1648
|
|
|
1365
1649
|
// src/deals.ts
|
|
1366
|
-
var
|
|
1650
|
+
var DEFAULT_API21 = "https://be.graph8.com";
|
|
1367
1651
|
var createDealsClient = (apiKey, apiUrl) => {
|
|
1368
|
-
const baseUrl = apiUrl ||
|
|
1652
|
+
const baseUrl = apiUrl || DEFAULT_API21;
|
|
1369
1653
|
return {
|
|
1370
1654
|
/** List all deal pipelines and their stages. */
|
|
1371
1655
|
async pipelines() {
|
|
@@ -1409,9 +1693,9 @@ var createDealsClient = (apiKey, apiUrl) => {
|
|
|
1409
1693
|
};
|
|
1410
1694
|
|
|
1411
1695
|
// src/inbox.ts
|
|
1412
|
-
var
|
|
1696
|
+
var DEFAULT_API22 = "https://be.graph8.com";
|
|
1413
1697
|
var createInboxClient = (apiKey, apiUrl) => {
|
|
1414
|
-
const baseUrl = apiUrl ||
|
|
1698
|
+
const baseUrl = apiUrl || DEFAULT_API22;
|
|
1415
1699
|
return {
|
|
1416
1700
|
/** List inbox threads across email, SMS, and LinkedIn. */
|
|
1417
1701
|
async list(params = {}) {
|
|
@@ -1464,9 +1748,9 @@ var createInboxClient = (apiKey, apiUrl) => {
|
|
|
1464
1748
|
};
|
|
1465
1749
|
|
|
1466
1750
|
// src/quotes.ts
|
|
1467
|
-
var
|
|
1751
|
+
var DEFAULT_API23 = "https://be.graph8.com";
|
|
1468
1752
|
var createQuotesClient = (apiKey, apiUrl) => {
|
|
1469
|
-
const baseUrl = apiUrl ||
|
|
1753
|
+
const baseUrl = apiUrl || DEFAULT_API23;
|
|
1470
1754
|
return {
|
|
1471
1755
|
/** List quotes org-wide with optional filters and pagination. */
|
|
1472
1756
|
async list(params = {}) {
|
|
@@ -1538,9 +1822,9 @@ var createQuotesClient = (apiKey, apiUrl) => {
|
|
|
1538
1822
|
};
|
|
1539
1823
|
|
|
1540
1824
|
// src/pipelines.ts
|
|
1541
|
-
var
|
|
1825
|
+
var DEFAULT_API24 = "https://be.graph8.com";
|
|
1542
1826
|
var createPipelinesClient = (apiKey, apiUrl) => {
|
|
1543
|
-
const baseUrl = apiUrl ||
|
|
1827
|
+
const baseUrl = apiUrl || DEFAULT_API24;
|
|
1544
1828
|
return {
|
|
1545
1829
|
/** List all stage-checklist pipelines with stages, evidence, scripts. */
|
|
1546
1830
|
async list() {
|
|
@@ -1622,9 +1906,9 @@ var createPipelinesClient = (apiKey, apiUrl) => {
|
|
|
1622
1906
|
};
|
|
1623
1907
|
|
|
1624
1908
|
// src/workflows.ts
|
|
1625
|
-
var
|
|
1909
|
+
var DEFAULT_API25 = "https://be.graph8.com";
|
|
1626
1910
|
var createWorkflowsClient = (apiKey, apiUrl) => {
|
|
1627
|
-
const baseUrl = apiUrl ||
|
|
1911
|
+
const baseUrl = apiUrl || DEFAULT_API25;
|
|
1628
1912
|
return {
|
|
1629
1913
|
/** List workflows org-wide. */
|
|
1630
1914
|
async list(params = {}) {
|
|
@@ -1740,9 +2024,9 @@ var createWorkflowsClient = (apiKey, apiUrl) => {
|
|
|
1740
2024
|
};
|
|
1741
2025
|
|
|
1742
2026
|
// src/skills.ts
|
|
1743
|
-
var
|
|
2027
|
+
var DEFAULT_API26 = "https://be.graph8.com";
|
|
1744
2028
|
var createSkillsClient = (apiKey, apiUrl) => {
|
|
1745
|
-
const baseUrl = apiUrl ||
|
|
2029
|
+
const baseUrl = apiUrl || DEFAULT_API26;
|
|
1746
2030
|
return {
|
|
1747
2031
|
/** List skills. */
|
|
1748
2032
|
async list(params = {}) {
|
|
@@ -1829,9 +2113,9 @@ var createSkillsClient = (apiKey, apiUrl) => {
|
|
|
1829
2113
|
};
|
|
1830
2114
|
|
|
1831
2115
|
// src/intent.ts
|
|
1832
|
-
var
|
|
2116
|
+
var DEFAULT_API27 = "https://be.graph8.com";
|
|
1833
2117
|
var createIntentClient = (apiKey, apiUrl) => {
|
|
1834
|
-
const baseUrl = apiUrl ||
|
|
2118
|
+
const baseUrl = apiUrl || DEFAULT_API27;
|
|
1835
2119
|
const get = (path) => request(baseUrl, `/api/v1${path}`, apiKey);
|
|
1836
2120
|
const post = (path, body = {}) => request(baseUrl, `/api/v1${path}`, apiKey, { method: "POST", body });
|
|
1837
2121
|
const del = (path) => request(baseUrl, `/api/v1${path}`, apiKey, { method: "DELETE" });
|
|
@@ -1906,9 +2190,9 @@ var createIntentClient = (apiKey, apiUrl) => {
|
|
|
1906
2190
|
};
|
|
1907
2191
|
|
|
1908
2192
|
// src/studio.ts
|
|
1909
|
-
var
|
|
2193
|
+
var DEFAULT_API28 = "https://be.graph8.com";
|
|
1910
2194
|
var createStudioClient = (apiKey, apiUrl) => {
|
|
1911
|
-
const baseUrl = apiUrl ||
|
|
2195
|
+
const baseUrl = apiUrl || DEFAULT_API28;
|
|
1912
2196
|
const get = (path, params = {}) => request(baseUrl, `/api/v1${path}`, apiKey, { query: params });
|
|
1913
2197
|
const post = (path, body = {}) => request(baseUrl, `/api/v1${path}`, apiKey, { method: "POST", body });
|
|
1914
2198
|
const patch = (path, body = {}) => request(baseUrl, `/api/v1${path}`, apiKey, { method: "PATCH", body });
|
|
@@ -1963,9 +2247,9 @@ var createStudioClient = (apiKey, apiUrl) => {
|
|
|
1963
2247
|
};
|
|
1964
2248
|
|
|
1965
2249
|
// src/meetings.ts
|
|
1966
|
-
var
|
|
2250
|
+
var DEFAULT_API29 = "https://be.graph8.com";
|
|
1967
2251
|
var createMeetingsClient = (apiKey, apiUrl) => {
|
|
1968
|
-
const baseUrl = apiUrl ||
|
|
2252
|
+
const baseUrl = apiUrl || DEFAULT_API29;
|
|
1969
2253
|
return {
|
|
1970
2254
|
/** List meetings with optional filters. Returns summary rows without transcript / analysis. */
|
|
1971
2255
|
async list(params = {}) {
|
|
@@ -1980,9 +2264,9 @@ var createMeetingsClient = (apiKey, apiUrl) => {
|
|
|
1980
2264
|
};
|
|
1981
2265
|
|
|
1982
2266
|
// src/audiences.ts
|
|
1983
|
-
var
|
|
2267
|
+
var DEFAULT_API30 = "https://be.graph8.com";
|
|
1984
2268
|
var createAudiencesClient = (apiKey, apiUrl) => {
|
|
1985
|
-
const baseUrl = apiUrl ||
|
|
2269
|
+
const baseUrl = apiUrl || DEFAULT_API30;
|
|
1986
2270
|
const base = "/api/v1/audience-syncs";
|
|
1987
2271
|
return {
|
|
1988
2272
|
/** List all audience syncs for the organization. */
|
|
@@ -2030,9 +2314,9 @@ var createAudiencesClient = (apiKey, apiUrl) => {
|
|
|
2030
2314
|
};
|
|
2031
2315
|
|
|
2032
2316
|
// src/search.ts
|
|
2033
|
-
var
|
|
2317
|
+
var DEFAULT_API31 = "https://be.graph8.com";
|
|
2034
2318
|
var createSearchClient = (apiKey, apiUrl) => {
|
|
2035
|
-
const baseUrl = apiUrl ||
|
|
2319
|
+
const baseUrl = apiUrl || DEFAULT_API31;
|
|
2036
2320
|
const body = (p) => ({ filters: [], page: 1, limit: 25, ...p });
|
|
2037
2321
|
return {
|
|
2038
2322
|
/** Search open-data contacts by filter. */
|
|
@@ -2063,9 +2347,9 @@ var createSearchClient = (apiKey, apiUrl) => {
|
|
|
2063
2347
|
};
|
|
2064
2348
|
|
|
2065
2349
|
// src/agency.ts
|
|
2066
|
-
var
|
|
2350
|
+
var DEFAULT_API32 = "https://be.graph8.com";
|
|
2067
2351
|
var createAgencyClient = (apiKey, apiUrl) => {
|
|
2068
|
-
const baseUrl = apiUrl ||
|
|
2352
|
+
const baseUrl = apiUrl || DEFAULT_API32;
|
|
2069
2353
|
return {
|
|
2070
2354
|
/** Describe the agency credential: agency org + authorized client count. */
|
|
2071
2355
|
async me() {
|
|
@@ -2080,9 +2364,9 @@ var createAgencyClient = (apiKey, apiUrl) => {
|
|
|
2080
2364
|
};
|
|
2081
2365
|
|
|
2082
2366
|
// src/marketplace.ts
|
|
2083
|
-
var
|
|
2367
|
+
var DEFAULT_API33 = "https://be.graph8.com";
|
|
2084
2368
|
var createMarketplaceClient = (apiKey, apiUrl) => {
|
|
2085
|
-
const baseUrl = apiUrl ||
|
|
2369
|
+
const baseUrl = apiUrl || DEFAULT_API33;
|
|
2086
2370
|
const base = "/api/v1/marketplace";
|
|
2087
2371
|
return {
|
|
2088
2372
|
/** Your own marketplace SDR profile. */
|
|
@@ -2132,9 +2416,9 @@ var createMarketplaceClient = (apiKey, apiUrl) => {
|
|
|
2132
2416
|
};
|
|
2133
2417
|
|
|
2134
2418
|
// src/snippet.ts
|
|
2135
|
-
var
|
|
2419
|
+
var DEFAULT_API34 = "https://be.graph8.com";
|
|
2136
2420
|
var createSnippetClient = (apiKey, apiUrl) => {
|
|
2137
|
-
const baseUrl = apiUrl ||
|
|
2421
|
+
const baseUrl = apiUrl || DEFAULT_API34;
|
|
2138
2422
|
return {
|
|
2139
2423
|
/** Get your org's tracking snippet (write key + React/script-tag embeds + config). */
|
|
2140
2424
|
async get() {
|
|
@@ -2146,7 +2430,7 @@ var createSnippetClient = (apiKey, apiUrl) => {
|
|
|
2146
2430
|
|
|
2147
2431
|
// src/core.ts
|
|
2148
2432
|
var DEFAULT_HOST = "https://t.graph8.com";
|
|
2149
|
-
var
|
|
2433
|
+
var DEFAULT_API35 = "https://be.graph8.com";
|
|
2150
2434
|
var G8 = class {
|
|
2151
2435
|
constructor() {
|
|
2152
2436
|
/** @internal */
|
|
@@ -2190,6 +2474,8 @@ var G8 = class {
|
|
|
2190
2474
|
/** @internal */
|
|
2191
2475
|
this._apps = null;
|
|
2192
2476
|
/** @internal */
|
|
2477
|
+
this._appPlatform = null;
|
|
2478
|
+
/** @internal */
|
|
2193
2479
|
this._objects = null;
|
|
2194
2480
|
/** @internal */
|
|
2195
2481
|
this._deals = null;
|
|
@@ -2233,7 +2519,7 @@ var G8 = class {
|
|
|
2233
2519
|
debug: config.debug
|
|
2234
2520
|
});
|
|
2235
2521
|
}
|
|
2236
|
-
const apiUrl = config.apiUrl ||
|
|
2522
|
+
const apiUrl = config.apiUrl || DEFAULT_API35;
|
|
2237
2523
|
const writeKey = config.writeKey || "";
|
|
2238
2524
|
const apiKey = config.apiKey || "";
|
|
2239
2525
|
if (writeKey) {
|
|
@@ -2257,6 +2543,7 @@ var G8 = class {
|
|
|
2257
2543
|
this._tasks = createTasksClient(apiKey, apiUrl);
|
|
2258
2544
|
this._fields = createFieldsClient(apiKey, apiUrl);
|
|
2259
2545
|
this._apps = createAppsClient(apiKey, apiUrl);
|
|
2546
|
+
this._appPlatform = createAppPlatformClient(apiKey, apiUrl);
|
|
2260
2547
|
this._objects = createObjectsClient(apiKey, apiUrl);
|
|
2261
2548
|
this._deals = createDealsClient(apiKey, apiUrl);
|
|
2262
2549
|
this._inbox = createInboxClient(apiKey, apiUrl);
|
|
@@ -2383,6 +2670,18 @@ var G8 = class {
|
|
|
2383
2670
|
this._assertKey("apps");
|
|
2384
2671
|
return this._apps;
|
|
2385
2672
|
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Ship a hosted app: bind a source, deploy, promote, attach a hostname, read
|
|
2675
|
+
* build logs (requires API key). PREVIEW.
|
|
2676
|
+
*
|
|
2677
|
+
* Separate from `apps` on purpose. `apps` is the app's IDENTITY -- create it,
|
|
2678
|
+
* see who installed it, what it cost. This is its LIFECYCLE, and the two have
|
|
2679
|
+
* different blast radii: a mistake here takes a customer's app down.
|
|
2680
|
+
*/
|
|
2681
|
+
get appPlatform() {
|
|
2682
|
+
this._assertKey("appPlatform");
|
|
2683
|
+
return this._appPlatform;
|
|
2684
|
+
}
|
|
2386
2685
|
/** Custom object types, their schema, and their records (requires API key). PREVIEW. */
|
|
2387
2686
|
get objects() {
|
|
2388
2687
|
this._assertKey("objects");
|
|
@@ -2639,9 +2938,12 @@ export {
|
|
|
2639
2938
|
DEFAULT_APP_API,
|
|
2640
2939
|
G8Error,
|
|
2641
2940
|
KNOWN_WEBHOOK_EVENTS,
|
|
2941
|
+
MAX_TAIL_LINES,
|
|
2942
|
+
MIN_TAIL_LINES,
|
|
2642
2943
|
WebhookSignatureError,
|
|
2643
2944
|
backoffDelayMs,
|
|
2644
2945
|
constructEvent,
|
|
2946
|
+
createAppPlatformClient,
|
|
2645
2947
|
createAppRequester,
|
|
2646
2948
|
createGraph8AppClient,
|
|
2647
2949
|
createGraph8ServiceClient,
|