@vibiz/sdk 0.3.10 → 0.3.14
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 +1 -1
- package/dist/client.d.ts +35 -3
- package/dist/index.js +47 -9
- package/dist/one-key.d.ts +1 -1
- package/dist/types.d.ts +75 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vibiz/sdk
|
|
2
2
|
|
|
3
|
-
The typed client for the [
|
|
3
|
+
The typed client for the [thelastapi](https://app.vibiz.app/docs) API: projects, hosting and
|
|
4
4
|
deploys, databases, sign-in, email, AI, usage, payments and more, with the same calls the `vibiz`
|
|
5
5
|
CLI makes.
|
|
6
6
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionInfo, ActionResult, ActionRun, ActionRunList, ActionRunsQuery, ActionUsage, AdminMetrics, AiJob, AiKeyProvider, AiModelInfo, AiProviderKey, AiProviderKeyInput, AiProviderKeyList, AiSettings, AnalyticsPeriod, AnalyticsReport, ApiKey, AppKeyInfo, AppStoreAccount, AppStoreConnectLink, AppStoreSetup, AppStoreSetupInput, AppStoreState, AuthEnvironment, AuthProviderId, AuthProviderInput, AuthSettings, AuthSettingsPatch, Automation, AutomationEnrollment, AutomationInput, AutomationTrigger, Billing, BillingCharge, BillingCheckout, BillingEntry, BillingEntryKind, BillingList, BillingUpdate, Broadcast, BroadcastInput, BroadcastRecipient, BroadcastReview, BroadcastStatus, ChatChunk, ChatCompletion, ChatRequest, Checkout, CheckoutBrandPatch, CheckoutInput, Company, CompanyAddressFields, CompanyCatalog, CompanyDraft, CompanyEnvironment, CompanyLink, Connector, ConnectorApproval, ConnectorCall, ConnectorCallInput, ConnectorCheck, ConnectorEnvironment, ConnectorImport, ConnectorInput, ConnectorPatch, ConnectorResponse, ContactPropertyValue, ContactStatus, DashboardLink, DeployFile, Deployment, DeploymentFiles, DesignSectionRead, DesignSpec, DevEnvironment, DnsRecord, DnsRecordInput, DnsRecordList, Domain, DomainBuyInput, DomainList, DomainOwnerContact, DomainOwnerDetails, DomainQuote, DomainSearch, DomainUse, DomainUseInput, EmailContact, EmailContactInput, EmailContactList, EmailContactPatch, EmailForwarding, EmailForwardingLog, EmailForwardingRule, EmailImportInput, EmailImportReport, EmailList, EmailMarketing, EmailMarketingPatch, EmailPage, EmailPreview, EmailSegment, EmailTestResult, EnvTargetInfo, EnvVarInfo, ExportInput, FileEnvironment, FileList, FileListOptions, FileUploadOptions, HealthList, HealthRun, HealthStatus, HostKind, ImageRequest, ImageResult, InboxSettings, KeyAccess, LedgerEntry, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MetricsReport, MissionControl, MissionControlLayout, Operation, OwnAccountLink, OwnedDomain, OwnedDomainList, OwnerStripe, OwnerStripeApply, OwnerStripeDisconnect, OwnerStripeLink, Payment, PaymentPrice, PaymentPriceInput, PaymentProduct, PaymentSubscription, PaymentsAccount, PaymentsEnvironment, PaymentsList, PaymentsSimulation, PhoneAnsweringInput, PhoneCall, PhoneCallInput, PhoneCallList, PhoneMessage, PhoneMessageList, PhoneNumber, PhoneNumberList, PhoneQuote, PhoneRegistrationInput, PhoneRegistrationRequirements, PhoneSearch, PhoneSendInput, PhoneThreadList, Project, ProjectExport, ProjectHealth, ProjectSearch, ReplayDetail, ReplayFrames, ReplayFramesOptions, ReplayInsights, ReplayListOptions, ReplayPeriod, ReplayStatus, ReplaySummary, Resource, ResourceType, SearchConnectionList, SearchPageList, SecretLink, SegmentFilter, SendEmailInput, SendEmailOutput, SocialAccount, SocialAccountAnalytics, SocialAdCampaign, SocialAdChange, SocialAdChangeInput, SocialCampaignCreateInput, SocialConnectLink, SocialEnvironment, SocialMedia, SocialOverview, SocialPost, SocialPostAnalytics, SocialPostInput, SpeechRequest, Transcription, UsageOptions, UsagePeriod, UsageReport, VersionDiff, VersionList, VersionRestore, VibizFile, WebDesignInput, WebhookDelivery, WebhookEventType, Withdrawal } from './types.js';
|
|
1
|
+
import type { ActionInfo, ActionResult, ActionRun, ActionRunList, ActionRunsQuery, ActionUsage, AdminMetrics, AiJob, AiKeyProvider, AiModelInfo, AiProviderKey, AiProviderKeyInput, AiProviderKeyList, AiSettings, AnalyticsPeriod, AnalyticsReport, ApiKey, AppKeyInfo, AppStoreAccount, AppStoreConnectLink, AppStoreSetup, AppStoreSetupInput, AppStoreState, AuthEnvironment, AuthProviderId, AuthProviderInput, AuthSettings, AuthSettingsPatch, Automation, AutomationEnrollment, AutomationInput, AutomationTrigger, Billing, BillingCharge, BillingCheckout, BillingEntry, BillingEntryKind, BillingList, BillingUpdate, Broadcast, BroadcastInput, BroadcastRecipient, BroadcastReview, BroadcastStatus, ChatChunk, ChatCompletion, ChatRequest, Checkout, CheckoutBrandPatch, CheckoutInput, Company, CompanyAddressFields, CompanyCatalog, CompanyDraft, CompanyEnvironment, CompanyLink, Connector, ConnectorApproval, ConnectorCall, ConnectorCallInput, ConnectorCheck, ConnectorEnvironment, ConnectorImport, ConnectorInput, ConnectorPatch, ConnectorResponse, ContactPropertyValue, ContactStatus, DashboardLink, DeployFile, Deployment, DeploymentFiles, DesignSectionRead, DesignSpec, DevEnvironment, DnsRecord, DnsRecordInput, DnsRecordList, Domain, DomainBuyInput, DomainList, DomainOwnerContact, DomainOwnerDetails, DomainQuote, DomainSearch, DomainUse, DomainUseInput, EmailContact, EmailContactInput, EmailContactList, EmailContactPatch, EmailForwarding, EmailForwardingLog, EmailForwardingRule, EmailImportInput, EmailImportReport, EmailList, EmailMarketing, EmailMarketingPatch, EmailPage, EmailPreview, EmailSegment, EmailTestResult, EnvTargetInfo, EnvVarInfo, ExportInput, FileEnvironment, FileList, FileListOptions, FileUploadOptions, HealthList, HealthRun, HealthStatus, HostKind, ImageRequest, ImageResult, InboxSettings, KeyAccess, KeyPermission, KeyPresetChoice, LedgerEntry, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MetricsReport, MissionControl, MissionControlLayout, Operation, OwnAccountLink, OwnedDomain, OwnedDomainList, OwnerStripe, OwnerStripeApply, OwnerStripeDisconnect, OwnerStripeLink, Payment, PaymentPrice, PaymentPriceInput, PaymentProduct, PaymentSubscription, PaymentsAccount, PaymentsEnvironment, PaymentsList, PaymentsSimulation, PhoneAnsweringInput, PhoneCall, PhoneCallInput, PhoneCallList, PhoneMessage, PhoneMessageList, PhoneNumber, PhoneNumberList, PhoneQuote, PhoneRegistrationInput, PhoneRegistrationRequirements, PhoneSearch, PhoneSendInput, PhoneThreadList, Project, ProjectExport, ProjectHealth, ProjectSearch, ReplayDetail, ReplayFrames, ReplayFramesOptions, ReplayInsights, ReplayListOptions, ReplayPeriod, ReplayStatus, ReplaySummary, Resource, ResourceType, SearchConnectionList, SearchPageList, SecretLink, SegmentFilter, SendEmailInput, SendEmailOutput, SocialAccount, SocialAccountAnalytics, SocialAdCampaign, SocialAdChange, SocialAdChangeInput, SocialCampaignCreateInput, SocialConnectLink, SocialEnvironment, SocialMedia, SocialOverview, SocialPost, SocialPostAnalytics, SocialPostInput, SpeechRequest, Transcription, UsageOptions, UsagePeriod, UsageReport, VersionDiff, VersionList, VersionRestore, VibizFile, WebDesignInput, WebhookDelivery, WebhookEventType, Withdrawal } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* An error status with no Vibiz error body: a proxy, a load balancer or the
|
|
4
4
|
* network answered instead of the API. Say so, and what to do.
|
|
@@ -9,6 +9,14 @@ export declare class VibizApiError extends Error {
|
|
|
9
9
|
readonly code: string;
|
|
10
10
|
readonly details?: unknown | undefined;
|
|
11
11
|
constructor(status: number, code: string, message: string, details?: unknown | undefined);
|
|
12
|
+
private detail;
|
|
13
|
+
/**
|
|
14
|
+
* The permission a Limited key was refused for (`database.production:read`,
|
|
15
|
+
* or `*` when it needs Full access); undefined for other errors.
|
|
16
|
+
*/
|
|
17
|
+
get permission(): string | undefined;
|
|
18
|
+
/** The console link that opens this key with that permission ready to allow (give it to the user). */
|
|
19
|
+
get grantUrl(): string | undefined;
|
|
12
20
|
}
|
|
13
21
|
export interface VibizOptions {
|
|
14
22
|
apiKey: string;
|
|
@@ -734,6 +742,11 @@ export declare class Vibiz {
|
|
|
734
742
|
}) => Promise<SearchConnectionList>;
|
|
735
743
|
/** Owner: the Bing Webmaster API key, for every project. */
|
|
736
744
|
connectBing: (apiKey: string) => Promise<SearchConnectionList>;
|
|
745
|
+
/**
|
|
746
|
+
* Owner: push pages Google hasn't crawled yet to Google's Indexing API
|
|
747
|
+
* (off by default; up to 200 a day per Google Cloud project).
|
|
748
|
+
*/
|
|
749
|
+
setGooglePush: (enabled: boolean) => Promise<SearchConnectionList>;
|
|
737
750
|
/** Owner: disconnect a Google account or the Bing key. */
|
|
738
751
|
disconnect: (id: string) => Promise<{
|
|
739
752
|
object: "search_connection";
|
|
@@ -1056,11 +1069,14 @@ export declare class Vibiz {
|
|
|
1056
1069
|
n?: number;
|
|
1057
1070
|
size?: string;
|
|
1058
1071
|
aspect_ratio?: "16:9" | "9:16" | "1:1";
|
|
1072
|
+
/** Video: a still to animate (image to video), a public https URL. */
|
|
1073
|
+
image_url?: string;
|
|
1059
1074
|
/** With a `fal/<endpoint>` model (your own fal key): raw input for that endpoint. */
|
|
1060
1075
|
fal_input?: Record<string, unknown>;
|
|
1061
1076
|
};
|
|
1062
1077
|
}, opts?: {
|
|
1063
1078
|
idempotencyKey?: string;
|
|
1079
|
+
project?: string;
|
|
1064
1080
|
}) => Promise<AiJob>;
|
|
1065
1081
|
get: (id: string) => Promise<AiJob>;
|
|
1066
1082
|
cancel: (id: string) => Promise<AiJob>;
|
|
@@ -1424,15 +1440,25 @@ export declare class Vibiz {
|
|
|
1424
1440
|
/**
|
|
1425
1441
|
* The secret is returned once, here. Full access (`owner`) by default;
|
|
1426
1442
|
* `access: 'agent'` makes it Limited (builds and runs, never reads
|
|
1427
|
-
* production secrets nor moves live money)
|
|
1443
|
+
* production secrets nor moves live money), `preset: 'read_all'` Limited
|
|
1444
|
+
* that reads everything, `grants` Limited with those permissions
|
|
1445
|
+
* (`permissions()`). A Limited caller never gives more than it has.
|
|
1428
1446
|
*/
|
|
1429
1447
|
create: (name: string, opts?: {
|
|
1430
1448
|
access?: KeyAccess;
|
|
1449
|
+
preset?: KeyPresetChoice;
|
|
1450
|
+
grants?: string[];
|
|
1431
1451
|
}) => Promise<ApiKey & {
|
|
1432
1452
|
secret: string;
|
|
1433
1453
|
}>;
|
|
1434
|
-
/** Full access (`owner`) or Limited (`agent`), afterwards. Needs
|
|
1454
|
+
/** Full access (`owner`) or Limited (`agent`), afterwards. Needs `keys:write`, and not this key. */
|
|
1435
1455
|
setAccess: (id: string, access: KeyAccess) => Promise<ApiKey>;
|
|
1456
|
+
/** Full access, Read everything or Limited (`full`, `read_all`, `limited`), afterwards. */
|
|
1457
|
+
setPreset: (id: string, preset: KeyPresetChoice) => Promise<ApiKey>;
|
|
1458
|
+
/** A Limited key with exactly these permissions (replaces its list). */
|
|
1459
|
+
setGrants: (id: string, grants: string[]) => Promise<ApiKey>;
|
|
1460
|
+
/** Every permission a Limited key can be given, with its plain-words label. */
|
|
1461
|
+
permissions: () => Promise<KeyPermission[]>;
|
|
1436
1462
|
revoke: (id: string) => Promise<ApiKey>;
|
|
1437
1463
|
};
|
|
1438
1464
|
/** A short-lived link to the hosted usage dashboard (admin scope needs an admin key). */
|
|
@@ -1494,9 +1520,15 @@ export interface WhoAmI {
|
|
|
1494
1520
|
prefix: string;
|
|
1495
1521
|
kind: 'key' | 'console';
|
|
1496
1522
|
access: 'owner' | 'agent';
|
|
1523
|
+
/** `full`, `read_all`, `custom` or `limited`. */
|
|
1524
|
+
preset?: 'full' | 'read_all' | 'custom' | 'limited';
|
|
1525
|
+
/** A Limited key's permissions. */
|
|
1526
|
+
grants?: string[];
|
|
1497
1527
|
created_at: string;
|
|
1498
1528
|
};
|
|
1499
1529
|
role: 'tenant' | 'admin';
|
|
1530
|
+
/** Where the owner changes this key's permissions. */
|
|
1531
|
+
access_url?: string;
|
|
1500
1532
|
}
|
|
1501
1533
|
/**
|
|
1502
1534
|
* Header values must be Latin-1, so an id outside printable ASCII (`用户-7`,
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function noBodyMessage(status) {
|
|
|
5
5
|
if (status === 413) return "Too large (413): send less at once.";
|
|
6
6
|
if (status === 429) return "Too many requests (429): wait a moment and retry.";
|
|
7
7
|
if (status >= 500) {
|
|
8
|
-
return `The
|
|
8
|
+
return `The thelastapi API did not answer properly (${status}). It is usually brief: retry in a minute.`;
|
|
9
9
|
}
|
|
10
10
|
return `The request failed with ${status} and no explanation from the API.`;
|
|
11
11
|
}
|
|
@@ -20,13 +20,28 @@ var VibizApiError = class extends Error {
|
|
|
20
20
|
status;
|
|
21
21
|
code;
|
|
22
22
|
details;
|
|
23
|
+
detail(k) {
|
|
24
|
+
const d = this.details;
|
|
25
|
+
return d && typeof d[k] === "string" ? d[k] : void 0;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The permission a Limited key was refused for (`database.production:read`,
|
|
29
|
+
* or `*` when it needs Full access); undefined for other errors.
|
|
30
|
+
*/
|
|
31
|
+
get permission() {
|
|
32
|
+
return this.detail("permission");
|
|
33
|
+
}
|
|
34
|
+
/** The console link that opens this key with that permission ready to allow (give it to the user). */
|
|
35
|
+
get grantUrl() {
|
|
36
|
+
return this.detail("grant_url");
|
|
37
|
+
}
|
|
23
38
|
};
|
|
24
39
|
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
25
40
|
var Vibiz = class {
|
|
26
41
|
constructor(options) {
|
|
27
42
|
this.options = options;
|
|
28
43
|
if (!options.baseUrl) {
|
|
29
|
-
throw new Error("No
|
|
44
|
+
throw new Error("No thelastapi API URL: pass baseUrl (CLI: --api, or VIBIZ_API_URL).");
|
|
30
45
|
}
|
|
31
46
|
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
32
47
|
this.fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -39,6 +54,7 @@ var Vibiz = class {
|
|
|
39
54
|
if (init.body !== void 0) headers["content-type"] = "application/json";
|
|
40
55
|
if (init.raw) headers["content-type"] = init.contentType ?? "application/octet-stream";
|
|
41
56
|
if (init.idempotencyKey) headers["idempotency-key"] = init.idempotencyKey;
|
|
57
|
+
if (init.project) headers["x-vibiz-project"] = init.project;
|
|
42
58
|
if (this.options.user) headers["x-vibiz-user"] = endUserHeader(this.options.user);
|
|
43
59
|
if (this.options.client) headers["x-vibiz-client"] = this.options.client;
|
|
44
60
|
return this.fetchImpl(`${this.baseUrl}/v1${path}`, {
|
|
@@ -860,6 +876,14 @@ var Vibiz = class {
|
|
|
860
876
|
method: "POST",
|
|
861
877
|
body: { api_key: apiKey }
|
|
862
878
|
}),
|
|
879
|
+
/**
|
|
880
|
+
* Owner: push pages Google hasn't crawled yet to Google's Indexing API
|
|
881
|
+
* (off by default; up to 200 a day per Google Cloud project).
|
|
882
|
+
*/
|
|
883
|
+
setGooglePush: (enabled) => this.request("/search/settings", {
|
|
884
|
+
method: "PATCH",
|
|
885
|
+
body: { google_push: enabled }
|
|
886
|
+
}),
|
|
863
887
|
/** Owner: disconnect a Google account or the Bing key. */
|
|
864
888
|
disconnect: (id) => this.request(
|
|
865
889
|
`/search/connections/${id}`,
|
|
@@ -1520,17 +1544,31 @@ var Vibiz = class {
|
|
|
1520
1544
|
/**
|
|
1521
1545
|
* The secret is returned once, here. Full access (`owner`) by default;
|
|
1522
1546
|
* `access: 'agent'` makes it Limited (builds and runs, never reads
|
|
1523
|
-
* production secrets nor moves live money)
|
|
1547
|
+
* production secrets nor moves live money), `preset: 'read_all'` Limited
|
|
1548
|
+
* that reads everything, `grants` Limited with those permissions
|
|
1549
|
+
* (`permissions()`). A Limited caller never gives more than it has.
|
|
1524
1550
|
*/
|
|
1525
1551
|
create: (name, opts = {}) => this.request("/api-keys", {
|
|
1526
1552
|
method: "POST",
|
|
1527
|
-
body: { name, ...opts
|
|
1553
|
+
body: { name, ...opts }
|
|
1528
1554
|
}),
|
|
1529
|
-
/** Full access (`owner`) or Limited (`agent`), afterwards. Needs
|
|
1555
|
+
/** Full access (`owner`) or Limited (`agent`), afterwards. Needs `keys:write`, and not this key. */
|
|
1530
1556
|
setAccess: (id, access) => this.request(`/api-keys/${encodeURIComponent(id)}`, {
|
|
1531
1557
|
method: "PATCH",
|
|
1532
1558
|
body: { access }
|
|
1533
1559
|
}),
|
|
1560
|
+
/** Full access, Read everything or Limited (`full`, `read_all`, `limited`), afterwards. */
|
|
1561
|
+
setPreset: (id, preset) => this.request(`/api-keys/${encodeURIComponent(id)}`, {
|
|
1562
|
+
method: "PATCH",
|
|
1563
|
+
body: { preset }
|
|
1564
|
+
}),
|
|
1565
|
+
/** A Limited key with exactly these permissions (replaces its list). */
|
|
1566
|
+
setGrants: (id, grants) => this.request(`/api-keys/${encodeURIComponent(id)}`, {
|
|
1567
|
+
method: "PATCH",
|
|
1568
|
+
body: { grants }
|
|
1569
|
+
}),
|
|
1570
|
+
/** Every permission a Limited key can be given, with its plain-words label. */
|
|
1571
|
+
permissions: () => this.request("/api-keys/permissions").then((r) => r.data),
|
|
1534
1572
|
revoke: (id) => this.request(`/api-keys/${id}`, { method: "DELETE" })
|
|
1535
1573
|
};
|
|
1536
1574
|
/** A short-lived link to the hosted usage dashboard (admin scope needs an admin key). */
|
|
@@ -1701,7 +1739,7 @@ function deployPathProblem(path) {
|
|
|
1701
1739
|
return "looks like a credential (a private key or a token file), which is never deployed";
|
|
1702
1740
|
if (PRIVATE_DIRS.includes(part)) return `is inside ${part}, a home or config folder`;
|
|
1703
1741
|
if (IGNORED.has(part))
|
|
1704
|
-
return part === "vibiz.json" ? "is vibiz.json, the local link to the project, which is never deployed" : `is inside ${part}, which is never deployed (dependencies, VCS data or build output:
|
|
1742
|
+
return part === "vibiz.json" ? "is vibiz.json, the local link to the project, which is never deployed" : `is inside ${part}, which is never deployed (dependencies, VCS data or build output: thelastapi installs and builds the app itself)`;
|
|
1705
1743
|
}
|
|
1706
1744
|
return null;
|
|
1707
1745
|
}
|
|
@@ -1941,14 +1979,14 @@ function formatMinor(minor, currency) {
|
|
|
1941
1979
|
}
|
|
1942
1980
|
|
|
1943
1981
|
// packages/sdk/src/one-key.ts
|
|
1944
|
-
var APP_SDK_VERSION = "0.3.
|
|
1982
|
+
var APP_SDK_VERSION = "0.3.14";
|
|
1945
1983
|
var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
|
|
1946
1984
|
function oneKeyMessage(url, host) {
|
|
1947
1985
|
const where = host ?? "your host";
|
|
1948
|
-
return `Add one key to ${where} and your app can use everything on
|
|
1986
|
+
return `Add one key to ${where} and your app can use everything on thelastapi (${ONE_KEY_GIVES}): copy VIBIZ_APP_KEY here: ${url} , paste it into ${host ? `${host}'s` : "your host's"} production environment variables, and redeploy.`;
|
|
1949
1987
|
}
|
|
1950
1988
|
function connectHostMessage(kind, host) {
|
|
1951
|
-
return `Or connect ${host ?? "the host"} once (vibiz hosts add ${kind ?? "<host>"} <app>) and
|
|
1989
|
+
return `Or connect ${host ?? "the host"} once (vibiz hosts add ${kind ?? "<host>"} <app>) and thelastapi keeps every variable in sync.`;
|
|
1952
1990
|
}
|
|
1953
1991
|
export {
|
|
1954
1992
|
APP_SDK_VERSION,
|
package/dist/one-key.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (`npm install --save-exact @vibiz/app@<this>`). A test keeps it, the skills
|
|
11
11
|
* and the docs equal to packages/app/package.json.
|
|
12
12
|
*/
|
|
13
|
-
export declare const APP_SDK_VERSION = "0.3.
|
|
13
|
+
export declare const APP_SDK_VERSION = "0.3.14";
|
|
14
14
|
/** Everything one app key reaches. */
|
|
15
15
|
export declare const ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
|
|
16
16
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -156,6 +156,24 @@ export interface DomainQuote {
|
|
|
156
156
|
key_url?: string;
|
|
157
157
|
next_step: string;
|
|
158
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* The `details` of a Limited key's refusal (code `forbidden`, reason
|
|
161
|
+
* `owner_only`): which permission, and the link that allows it.
|
|
162
|
+
*/
|
|
163
|
+
export interface MissingPermissionDetails {
|
|
164
|
+
reason: 'owner_only';
|
|
165
|
+
/** `database.production:read`, or `*` when it needs Full access. */
|
|
166
|
+
permission?: string;
|
|
167
|
+
permission_label?: string;
|
|
168
|
+
key_id?: string;
|
|
169
|
+
/** The key's page with the permission ready to allow ("Allow this" / "Allow everything"). */
|
|
170
|
+
grant_url?: string;
|
|
171
|
+
/** The key's page. */
|
|
172
|
+
key_url?: string;
|
|
173
|
+
/** Where a person does the action by hand. */
|
|
174
|
+
console_url?: string;
|
|
175
|
+
next_step: string;
|
|
176
|
+
}
|
|
159
177
|
/** The legal registrant domains are registered to, saved once per account. */
|
|
160
178
|
export interface DomainOwnerContact {
|
|
161
179
|
first_name: string;
|
|
@@ -1722,9 +1740,24 @@ export interface ApiKey {
|
|
|
1722
1740
|
prefix: string;
|
|
1723
1741
|
kind?: 'key' | 'console';
|
|
1724
1742
|
access?: KeyAccess;
|
|
1743
|
+
/** `full`, `read_all` (Read everything), `custom` (some permissions) or `limited` (none). */
|
|
1744
|
+
preset?: 'full' | 'read_all' | 'custom' | 'limited';
|
|
1745
|
+
/** A Limited key's permissions (docs/KEYS.md "Permissions"). */
|
|
1746
|
+
grants?: string[];
|
|
1725
1747
|
created_at: string;
|
|
1726
1748
|
revoked_at: string | null;
|
|
1727
1749
|
}
|
|
1750
|
+
/** What a key's access is set to: Full access, Read everything, or Limited with nothing extra. */
|
|
1751
|
+
export type KeyPresetChoice = 'full' | 'read_all' | 'limited';
|
|
1752
|
+
/** One permission a Limited key can be given (`GET /v1/api-keys/permissions`). */
|
|
1753
|
+
export interface KeyPermission {
|
|
1754
|
+
/** `<area>:<read|write>`, e.g. `database.production:read`. */
|
|
1755
|
+
id: string;
|
|
1756
|
+
/** The console group it shows under. */
|
|
1757
|
+
area: string;
|
|
1758
|
+
/** What it lets the key do, in plain words. */
|
|
1759
|
+
label: string;
|
|
1760
|
+
}
|
|
1728
1761
|
export interface AppKeyInfo {
|
|
1729
1762
|
object: 'app_key';
|
|
1730
1763
|
environment: 'production' | 'development';
|
|
@@ -4365,6 +4398,7 @@ export interface ProjectSearch {
|
|
|
4365
4398
|
pages_known: number;
|
|
4366
4399
|
indexed: number;
|
|
4367
4400
|
not_indexed: number;
|
|
4401
|
+
not_crawled: number;
|
|
4368
4402
|
not_inspected: number;
|
|
4369
4403
|
};
|
|
4370
4404
|
clicks_28d: number;
|
|
@@ -4383,6 +4417,15 @@ export interface ProjectSearch {
|
|
|
4383
4417
|
url: string;
|
|
4384
4418
|
})[];
|
|
4385
4419
|
search_console_url: string | null;
|
|
4420
|
+
/** Pushing pages to Google to crawl (Indexing API), opt-in per account. */
|
|
4421
|
+
push: {
|
|
4422
|
+
enabled: boolean;
|
|
4423
|
+
pushed_today: number;
|
|
4424
|
+
pushed_total: number;
|
|
4425
|
+
/** Pushed pages Google has indexed since. */
|
|
4426
|
+
indexed_after_push: number;
|
|
4427
|
+
note: string | null;
|
|
4428
|
+
};
|
|
4386
4429
|
};
|
|
4387
4430
|
/** The account's own Bing Webmaster, best effort (IndexNow already tells Bing about pages). */
|
|
4388
4431
|
bing: {
|
|
@@ -4393,6 +4436,28 @@ export interface ProjectSearch {
|
|
|
4393
4436
|
sitemap_submitted_at: string | null;
|
|
4394
4437
|
clicks_28d: number | null;
|
|
4395
4438
|
impressions_28d: number | null;
|
|
4439
|
+
/** Pages in Bing's index (its crawl stats, newest day); null until read. */
|
|
4440
|
+
indexed: number | null;
|
|
4441
|
+
crawled_28d: number | null;
|
|
4442
|
+
crawl_errors: number | null;
|
|
4443
|
+
blocked_by_robots: number | null;
|
|
4444
|
+
indexed_daily: {
|
|
4445
|
+
date: string;
|
|
4446
|
+
indexed: number;
|
|
4447
|
+
}[];
|
|
4448
|
+
top_queries: {
|
|
4449
|
+
query: string;
|
|
4450
|
+
clicks: number;
|
|
4451
|
+
impressions: number;
|
|
4452
|
+
position: number | null;
|
|
4453
|
+
}[];
|
|
4454
|
+
last_sync_at: string | null;
|
|
4455
|
+
webmaster_url: string | null;
|
|
4456
|
+
/** Pages sent through Bing Webmaster's URL submission. */
|
|
4457
|
+
submitted_today: number;
|
|
4458
|
+
submitted_total: number;
|
|
4459
|
+
/** Bing's quota left today (null until the site's first submission today). */
|
|
4460
|
+
quota_left: number | null;
|
|
4396
4461
|
note: string | null;
|
|
4397
4462
|
};
|
|
4398
4463
|
}
|
|
@@ -4439,6 +4504,14 @@ export interface SearchConnection {
|
|
|
4439
4504
|
/** Sites set up on it; Google allows `site_limit` (1,000) per account. */
|
|
4440
4505
|
sites: number;
|
|
4441
4506
|
site_limit: number | null;
|
|
4507
|
+
/** Google only: pushing pages to crawl (Indexing API), opt-in. */
|
|
4508
|
+
push: {
|
|
4509
|
+
enabled: boolean;
|
|
4510
|
+
pushed_today: number;
|
|
4511
|
+
paused_until: string | null;
|
|
4512
|
+
/** Why pushing stopped and what to do (null when fine). */
|
|
4513
|
+
note: string | null;
|
|
4514
|
+
} | null;
|
|
4442
4515
|
status: 'connected' | 'error';
|
|
4443
4516
|
error: string | null;
|
|
4444
4517
|
error_at: string | null;
|
|
@@ -4449,6 +4522,8 @@ export interface SearchConnectionList {
|
|
|
4449
4522
|
data: SearchConnection[];
|
|
4450
4523
|
/** Whether this Stack can connect Google (its OAuth client is set). */
|
|
4451
4524
|
google_available: boolean;
|
|
4525
|
+
/** Pushing pages to Google (Indexing API) is on for the account. */
|
|
4526
|
+
google_push: boolean;
|
|
4452
4527
|
console_url?: string;
|
|
4453
4528
|
}
|
|
4454
4529
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibiz/sdk",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Typed client for the
|
|
3
|
+
"version": "0.3.14",
|
|
4
|
+
"description": "Typed client for the thelastapi API: projects, hosting, databases, sign-in, email, AI, payments and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vibiz",
|
|
7
7
|
"sdk",
|