@farthershore/client 0.0.0-stage → 0.1.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/CHANGELOG.md +34 -0
- package/README.md +251 -2
- package/dist/index.js +6997 -0
- package/dist/types/api.generated.d.ts +1356 -0
- package/dist/types/credentials.d.ts +78 -0
- package/dist/types/envelope.d.ts +48 -0
- package/dist/types/errors.d.ts +86 -0
- package/dist/types/helpers/abort.d.ts +7 -0
- package/dist/types/helpers/paginate.d.ts +32 -0
- package/dist/types/helpers/poll.d.ts +26 -0
- package/dist/types/helpers/refs.d.ts +84 -0
- package/dist/types/helpers/wait-for-frontend-build.d.ts +43 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/operations/agents.d.ts +48 -0
- package/dist/types/operations/agreements.d.ts +44 -0
- package/dist/types/operations/analytics.d.ts +25 -0
- package/dist/types/operations/audit-notifications.d.ts +33 -0
- package/dist/types/operations/auth.d.ts +16 -0
- package/dist/types/operations/backends.d.ts +53 -0
- package/dist/types/operations/billing.d.ts +15 -0
- package/dist/types/operations/businesses.d.ts +92 -0
- package/dist/types/operations/change-sets.d.ts +43 -0
- package/dist/types/operations/consumers.d.ts +49 -0
- package/dist/types/operations/define.d.ts +91 -0
- package/dist/types/operations/environments.d.ts +19 -0
- package/dist/types/operations/frontend.d.ts +13 -0
- package/dist/types/operations/index.d.ts +1036 -0
- package/dist/types/operations/maker-tokens.d.ts +30 -0
- package/dist/types/operations/organizations.d.ts +71 -0
- package/dist/types/operations/personas.d.ts +46 -0
- package/dist/types/operations/plans-usage.d.ts +18 -0
- package/dist/types/operations/platform.d.ts +47 -0
- package/dist/types/operations/portal.d.ts +49 -0
- package/dist/types/operations/promo-codes.d.ts +19 -0
- package/dist/types/operations/variables.d.ts +25 -0
- package/dist/types/operations/webhooks.d.ts +67 -0
- package/dist/types/surface-types.d.ts +54 -0
- package/dist/types/surface.d.ts +35 -0
- package/dist/types/transport.d.ts +119 -0
- package/dist/types/types.d.ts +469 -0
- package/dist/types/version.d.ts +8 -0
- package/package.json +53 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MakerTokenPermissionCatalog } from "../types.js";
|
|
2
|
+
type TokenRef = {
|
|
3
|
+
tokenId: string;
|
|
4
|
+
};
|
|
5
|
+
type ApprovalRef = {
|
|
6
|
+
approvalId: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const makerTokenOperations: {
|
|
9
|
+
"makerTokens.permissionCatalog.read": import("./define.js").OperationEntry<void, MakerTokenPermissionCatalog>;
|
|
10
|
+
"makerTokens.list": import("./define.js").OperationEntry<{
|
|
11
|
+
limit?: number;
|
|
12
|
+
offset?: number;
|
|
13
|
+
} | undefined, unknown>;
|
|
14
|
+
"makerTokens.create": import("./define.js").OperationEntry<{
|
|
15
|
+
name: string;
|
|
16
|
+
requestedPermissions: readonly string[];
|
|
17
|
+
businessScope?: unknown;
|
|
18
|
+
}, unknown>;
|
|
19
|
+
"makerTokens.update": import("./define.js").OperationEntry<TokenRef & {
|
|
20
|
+
requestedPermissions: readonly string[];
|
|
21
|
+
}, unknown>;
|
|
22
|
+
"makerTokens.approvalList": import("./define.js").OperationEntry<void, unknown>;
|
|
23
|
+
"makerTokens.approve": import("./define.js").OperationEntry<ApprovalRef & {
|
|
24
|
+
grantedPermissions?: readonly string[];
|
|
25
|
+
}, unknown>;
|
|
26
|
+
"makerTokens.deny": import("./define.js").OperationEntry<ApprovalRef, unknown>;
|
|
27
|
+
"makerTokens.rotate": import("./define.js").OperationEntry<TokenRef, unknown>;
|
|
28
|
+
"makerTokens.revoke": import("./define.js").OperationEntry<TokenRef, void>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ListQuery } from "./define.js";
|
|
2
|
+
type OrganizationRef = {
|
|
3
|
+
organizationId: string;
|
|
4
|
+
};
|
|
5
|
+
type RoleRef = OrganizationRef & {
|
|
6
|
+
roleKey: string;
|
|
7
|
+
};
|
|
8
|
+
type MemberRef = OrganizationRef & {
|
|
9
|
+
memberUserId: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const organizationOperations: {
|
|
12
|
+
"organizations.list": import("./define.js").OperationEntry<void, unknown>;
|
|
13
|
+
"organizations.create": import("./define.js").OperationEntry<{
|
|
14
|
+
name: string;
|
|
15
|
+
type: "team" | "company";
|
|
16
|
+
}, unknown>;
|
|
17
|
+
"organizations.delete": import("./define.js").OperationEntry<OrganizationRef, void>;
|
|
18
|
+
"organizations.overview.read": import("./define.js").OperationEntry<OrganizationRef, unknown>;
|
|
19
|
+
"organizations.bulletin.read": import("./define.js").OperationEntry<OrganizationRef & {
|
|
20
|
+
kind?: string;
|
|
21
|
+
status?: string;
|
|
22
|
+
cursor?: string;
|
|
23
|
+
limit?: number;
|
|
24
|
+
}, unknown>;
|
|
25
|
+
"organizations.role.list": import("./define.js").OperationEntry<OrganizationRef & {
|
|
26
|
+
query?: ListQuery;
|
|
27
|
+
}, unknown>;
|
|
28
|
+
"organizations.role.show": import("./define.js").OperationEntry<RoleRef, unknown>;
|
|
29
|
+
"organizations.role.create": import("./define.js").OperationEntry<OrganizationRef & {
|
|
30
|
+
key: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
permissions: string[];
|
|
34
|
+
}, unknown>;
|
|
35
|
+
"organizations.role.update": import("./define.js").OperationEntry<OrganizationRef & {
|
|
36
|
+
roleKey: string;
|
|
37
|
+
} & {
|
|
38
|
+
name?: string;
|
|
39
|
+
description?: string | null;
|
|
40
|
+
permissions?: string[];
|
|
41
|
+
}, unknown>;
|
|
42
|
+
"organizations.role.delete": import("./define.js").OperationEntry<RoleRef, void>;
|
|
43
|
+
"organizations.member.list": import("./define.js").OperationEntry<OrganizationRef & {
|
|
44
|
+
query?: ListQuery;
|
|
45
|
+
limit?: number;
|
|
46
|
+
offset?: number;
|
|
47
|
+
}, unknown>;
|
|
48
|
+
"organizations.member.update": import("./define.js").OperationEntry<OrganizationRef & {
|
|
49
|
+
memberUserId: string;
|
|
50
|
+
} & {
|
|
51
|
+
roleKey: string;
|
|
52
|
+
}, unknown>;
|
|
53
|
+
"organizations.member.remove": import("./define.js").OperationEntry<MemberRef, void>;
|
|
54
|
+
"organizations.ownership.transfer": import("./define.js").OperationEntry<OrganizationRef & {
|
|
55
|
+
newOwnerUserId: string;
|
|
56
|
+
}, unknown>;
|
|
57
|
+
"organizations.invitation.create": import("./define.js").OperationEntry<OrganizationRef & {
|
|
58
|
+
email: string;
|
|
59
|
+
roleKey: string;
|
|
60
|
+
}, unknown>;
|
|
61
|
+
"organizations.invitation.list": import("./define.js").OperationEntry<void, unknown>;
|
|
62
|
+
"organizations.invitation.listSent": import("./define.js").OperationEntry<OrganizationRef, unknown>;
|
|
63
|
+
"organizations.invitation.revoke": import("./define.js").OperationEntry<OrganizationRef & {
|
|
64
|
+
invitationId: string;
|
|
65
|
+
}, void>;
|
|
66
|
+
"organizations.invitation.accept": import("./define.js").OperationEntry<{
|
|
67
|
+
invitationId: string;
|
|
68
|
+
token: string;
|
|
69
|
+
}, unknown>;
|
|
70
|
+
};
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PersonaHandoff, PersonaLocalPreviewLease } from "../types.js";
|
|
2
|
+
type EnvironmentRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
environmentId: string;
|
|
5
|
+
};
|
|
6
|
+
type PersonaRef = EnvironmentRef & {
|
|
7
|
+
personaId: string;
|
|
8
|
+
};
|
|
9
|
+
type LeaseInput = PersonaRef & {
|
|
10
|
+
/** The process-held lease; it travels in the body, never a URL. */
|
|
11
|
+
localProxyLease: string;
|
|
12
|
+
/** The exact localhost origin the CLI proxy serves. */
|
|
13
|
+
localOrigin: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const personaOperations: {
|
|
16
|
+
"personas.bootstrap": import("./define.js").OperationEntry<EnvironmentRef & {
|
|
17
|
+
planKey?: string;
|
|
18
|
+
compiledPlanId?: string;
|
|
19
|
+
scopes?: string[];
|
|
20
|
+
displayName?: string;
|
|
21
|
+
subscriberId?: string;
|
|
22
|
+
accountRole?: "owner" | "admin" | "member";
|
|
23
|
+
roleKeys?: string[];
|
|
24
|
+
}, unknown>;
|
|
25
|
+
"personas.read": import("./define.js").OperationEntry<EnvironmentRef, unknown>;
|
|
26
|
+
"personas.login": import("./define.js").OperationEntry<PersonaRef, PersonaHandoff>;
|
|
27
|
+
"personas.rotate": import("./define.js").OperationEntry<PersonaRef, unknown>;
|
|
28
|
+
"personas.delete": import("./define.js").OperationEntry<PersonaRef, unknown>;
|
|
29
|
+
"personas.localPreview.issue": import("./define.js").OperationEntry<EnvironmentRef & {
|
|
30
|
+
personaId: string;
|
|
31
|
+
} & {
|
|
32
|
+
localOrigin: string;
|
|
33
|
+
}, PersonaLocalPreviewLease>;
|
|
34
|
+
"personas.localPreview.renew": import("./define.js").OperationEntry<LeaseInput, {
|
|
35
|
+
data: {
|
|
36
|
+
localProxyLease: string;
|
|
37
|
+
localProxyLeaseExpiresAt: string;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
"personas.localPreview.revoke": import("./define.js").OperationEntry<LeaseInput, {
|
|
41
|
+
data: {
|
|
42
|
+
revoked: boolean;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type ManagementScoped = {
|
|
2
|
+
businessId: string;
|
|
3
|
+
/** An environment id; omit (or `null`) for production. */
|
|
4
|
+
environmentId?: string | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const plansUsageOperations: {
|
|
7
|
+
"plans.read": import("./define.js").OperationEntry<ManagementScoped & {
|
|
8
|
+
limit?: number;
|
|
9
|
+
offset?: number;
|
|
10
|
+
}, unknown>;
|
|
11
|
+
"usage.read": import("./define.js").OperationEntry<ManagementScoped, unknown>;
|
|
12
|
+
"usage.limits": import("./define.js").OperationEntry<{
|
|
13
|
+
businessId: string;
|
|
14
|
+
limit?: number;
|
|
15
|
+
offset?: number;
|
|
16
|
+
}, unknown>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type RequestBody } from "./define.js";
|
|
2
|
+
type BusinessRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
};
|
|
5
|
+
type Cursor = {
|
|
6
|
+
cursor?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const platformOperations: {
|
|
10
|
+
"platform.resourceCounts.report": import("./define.js").OperationEntry<BusinessRef & {
|
|
11
|
+
resource: string;
|
|
12
|
+
body: RequestBody;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
"platform.denials.read": import("./define.js").OperationEntry<BusinessRef & {
|
|
15
|
+
requestId: string;
|
|
16
|
+
}, unknown>;
|
|
17
|
+
"platform.dependents.read": import("./define.js").OperationEntry<BusinessRef & {
|
|
18
|
+
route: string;
|
|
19
|
+
since?: string;
|
|
20
|
+
environmentId?: string;
|
|
21
|
+
}, unknown>;
|
|
22
|
+
"platform.workflowControl.replay": import("./define.js").OperationEntry<{
|
|
23
|
+
body: RequestBody;
|
|
24
|
+
}, unknown>;
|
|
25
|
+
"platform.workflowControl.rollback": import("./define.js").OperationEntry<{
|
|
26
|
+
body: RequestBody;
|
|
27
|
+
}, unknown>;
|
|
28
|
+
"automationRules.read": import("./define.js").OperationEntry<BusinessRef & Cursor & {
|
|
29
|
+
env?: string;
|
|
30
|
+
}, unknown>;
|
|
31
|
+
"automationRules.get": import("./define.js").OperationEntry<BusinessRef & {
|
|
32
|
+
ruleId: string;
|
|
33
|
+
}, unknown>;
|
|
34
|
+
"automationRules.create": import("./define.js").OperationEntry<BusinessRef & {
|
|
35
|
+
body: RequestBody;
|
|
36
|
+
}, unknown>;
|
|
37
|
+
"automationRules.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
38
|
+
ruleId: string;
|
|
39
|
+
body: RequestBody;
|
|
40
|
+
}, unknown>;
|
|
41
|
+
"automationRules.delete": import("./define.js").OperationEntry<BusinessRef & {
|
|
42
|
+
ruleId: string;
|
|
43
|
+
}, void>;
|
|
44
|
+
"knowledge.guide.read": import("./define.js").OperationEntry<Cursor | undefined, unknown>;
|
|
45
|
+
"knowledge.business.read": import("./define.js").OperationEntry<BusinessRef & Cursor, unknown>;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type RequestBody } from "./define.js";
|
|
2
|
+
type BusinessRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
};
|
|
5
|
+
type Page = {
|
|
6
|
+
limit?: number;
|
|
7
|
+
offset?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const portalOperations: {
|
|
10
|
+
"portal.serviceAccounts.list": import("./define.js").OperationEntry<BusinessRef & Page, unknown>;
|
|
11
|
+
"portal.serviceAccounts.create": import("./define.js").OperationEntry<BusinessRef & {
|
|
12
|
+
body: RequestBody;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
"portal.serviceAccounts.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
15
|
+
serviceAccountId: string;
|
|
16
|
+
body: RequestBody;
|
|
17
|
+
}, unknown>;
|
|
18
|
+
"portal.serviceAccounts.approvals": import("./define.js").OperationEntry<BusinessRef & Page, unknown>;
|
|
19
|
+
"portal.serviceAccounts.approve": import("./define.js").OperationEntry<BusinessRef & {
|
|
20
|
+
approvalId: string;
|
|
21
|
+
body: RequestBody;
|
|
22
|
+
}, unknown>;
|
|
23
|
+
"portal.serviceAccounts.deny": import("./define.js").OperationEntry<BusinessRef & {
|
|
24
|
+
approvalId: string;
|
|
25
|
+
}, unknown>;
|
|
26
|
+
"portal.serviceAccounts.rotate": import("./define.js").OperationEntry<BusinessRef & {
|
|
27
|
+
serviceAccountId: string;
|
|
28
|
+
}, unknown>;
|
|
29
|
+
"portal.serviceAccounts.revoke": import("./define.js").OperationEntry<BusinessRef & {
|
|
30
|
+
serviceAccountId: string;
|
|
31
|
+
}, void>;
|
|
32
|
+
"portal.usageLimits.list": import("./define.js").OperationEntry<BusinessRef & Page, {
|
|
33
|
+
data: unknown[];
|
|
34
|
+
pagination: {
|
|
35
|
+
limit: number;
|
|
36
|
+
offset: number;
|
|
37
|
+
hasMore: boolean;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
"portal.usageLimits.set": import("./define.js").OperationEntry<BusinessRef & {
|
|
41
|
+
/** Update this limit; omit to create one. */
|
|
42
|
+
limitId?: string;
|
|
43
|
+
body: RequestBody;
|
|
44
|
+
}, unknown>;
|
|
45
|
+
"portal.usageLimits.remove": import("./define.js").OperationEntry<BusinessRef & {
|
|
46
|
+
limitId: string;
|
|
47
|
+
}, unknown>;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CreatePromoCodeInput, PromoCode, PromoCodeStatus } from "../types.js";
|
|
2
|
+
type BusinessRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
};
|
|
5
|
+
type PromoCodeRef = BusinessRef & {
|
|
6
|
+
promoCodeId: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const promoCodeOperations: {
|
|
9
|
+
"promoCodes.read": import("./define.js").OperationEntry<BusinessRef, PromoCode[]>;
|
|
10
|
+
"promoCodes.create": import("./define.js").OperationEntry<BusinessRef & CreatePromoCodeInput, PromoCode>;
|
|
11
|
+
"promoCodes.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
12
|
+
promoCodeId: string;
|
|
13
|
+
} & Partial<CreatePromoCodeInput> & {
|
|
14
|
+
status?: PromoCodeStatus;
|
|
15
|
+
}, PromoCode>;
|
|
16
|
+
"promoCodes.archive": import("./define.js").OperationEntry<PromoCodeRef, PromoCode>;
|
|
17
|
+
"promoCodes.reactivate": import("./define.js").OperationEntry<PromoCodeRef, PromoCode>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BusinessVariableRow, SecretMutationOperation } from "../types.js";
|
|
2
|
+
type VariableRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
/** Omit for the production scope. */
|
|
6
|
+
environmentId?: string;
|
|
7
|
+
};
|
|
8
|
+
type WriteInput = VariableRef & {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const variableOperations: {
|
|
12
|
+
"variables.read": import("./define.js").OperationEntry<{
|
|
13
|
+
businessId: string;
|
|
14
|
+
environmentId?: string;
|
|
15
|
+
}, BusinessVariableRow[]>;
|
|
16
|
+
"variables.create": import("./define.js").OperationEntry<WriteInput, SecretMutationOperation>;
|
|
17
|
+
"variables.rotate": import("./define.js").OperationEntry<WriteInput, SecretMutationOperation>;
|
|
18
|
+
"variables.revoke": import("./define.js").OperationEntry<VariableRef, SecretMutationOperation>;
|
|
19
|
+
"variables.delete": import("./define.js").OperationEntry<VariableRef, SecretMutationOperation>;
|
|
20
|
+
"variables.operation.read": import("./define.js").OperationEntry<{
|
|
21
|
+
businessId: string;
|
|
22
|
+
operationId: string;
|
|
23
|
+
}, SecretMutationOperation>;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { PaginatedResult, WebhookDelivery, WebhookEndpoint, WebhookTestResult } from "../types.js";
|
|
2
|
+
type BusinessRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
};
|
|
5
|
+
type WebhookRef = BusinessRef & {
|
|
6
|
+
webhookId: string;
|
|
7
|
+
};
|
|
8
|
+
type TestInput = WebhookRef & {
|
|
9
|
+
/** A catalog event type to sample; omitted = `webhook.test`. */
|
|
10
|
+
type?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const webhookOperations: {
|
|
13
|
+
"webhooks.read": import("./define.js").OperationEntry<BusinessRef & {
|
|
14
|
+
limit?: number | string;
|
|
15
|
+
offset?: number;
|
|
16
|
+
}, PaginatedResult<WebhookEndpoint>>;
|
|
17
|
+
"webhooks.create": import("./define.js").OperationEntry<BusinessRef & {
|
|
18
|
+
url: string;
|
|
19
|
+
events: string[];
|
|
20
|
+
/** One environment's events; null or omitted = every environment. */
|
|
21
|
+
environmentId?: string | null;
|
|
22
|
+
}, {
|
|
23
|
+
data: WebhookEndpoint;
|
|
24
|
+
}>;
|
|
25
|
+
"webhooks.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
26
|
+
webhookId: string;
|
|
27
|
+
} & {
|
|
28
|
+
url?: string;
|
|
29
|
+
events?: string[];
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
environmentId?: string | null;
|
|
32
|
+
}, {
|
|
33
|
+
data: WebhookEndpoint;
|
|
34
|
+
}>;
|
|
35
|
+
"webhooks.delete": import("./define.js").OperationEntry<WebhookRef, {
|
|
36
|
+
data: {
|
|
37
|
+
deleted: boolean;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
"webhooks.test": import("./define.js").OperationEntry<TestInput, WebhookTestResult>;
|
|
41
|
+
"webhooks.trigger": import("./define.js").OperationEntry<BusinessRef & {
|
|
42
|
+
webhookId: string;
|
|
43
|
+
} & {
|
|
44
|
+
/** The catalog event type to send a sample of (required). */
|
|
45
|
+
type: string;
|
|
46
|
+
}, WebhookTestResult>;
|
|
47
|
+
"webhooks.rotateSecret": import("./define.js").OperationEntry<WebhookRef, {
|
|
48
|
+
data: WebhookEndpoint & {
|
|
49
|
+
secret: string;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
"webhooks.eventType.read": import("./define.js").OperationEntry<BusinessRef, {
|
|
53
|
+
data: {
|
|
54
|
+
events: Array<{
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
}>;
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
"webhooks.delivery.read": import("./define.js").OperationEntry<BusinessRef & {
|
|
61
|
+
webhookId: string;
|
|
62
|
+
} & {
|
|
63
|
+
limit?: number | string;
|
|
64
|
+
offset?: number | string;
|
|
65
|
+
}, PaginatedResult<WebhookDelivery>>;
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CallOptions, OperationEntry } from "./operations/define.js";
|
|
2
|
+
import type { MethodPath, OperationTable } from "./operations/index.js";
|
|
3
|
+
/** Static metadata every namespaced method carries as `method.meta`. */
|
|
4
|
+
export type OperationMeta = {
|
|
5
|
+
/** Dotted method path, e.g. `"runtimeTokens.revoke"`. */
|
|
6
|
+
readonly path: string;
|
|
7
|
+
/** The opKey, or `null` for a call without one. */
|
|
8
|
+
readonly op: string | null;
|
|
9
|
+
readonly summary: string;
|
|
10
|
+
readonly description: string;
|
|
11
|
+
readonly sideEffect: "read" | "write";
|
|
12
|
+
/** Removes or revokes something, or irreversibly changes live behaviour. */
|
|
13
|
+
readonly destructive: boolean;
|
|
14
|
+
/** The response is the only time a secret is shown. */
|
|
15
|
+
readonly oneTimeSecret: boolean;
|
|
16
|
+
/** Accepts `{ dryRun: true }` (answers a preview instead of applying). */
|
|
17
|
+
readonly preview: boolean;
|
|
18
|
+
/** The read that reconciles an `OUTCOME_UNKNOWN` of this write. */
|
|
19
|
+
readonly reconcile: {
|
|
20
|
+
readonly op: string;
|
|
21
|
+
} | null;
|
|
22
|
+
/** How the method's list pages (see `paginate`). */
|
|
23
|
+
readonly pagination: "offset" | "cursor" | null;
|
|
24
|
+
/** The largest page the server returns (`null`: not declared). */
|
|
25
|
+
readonly maxPageSize: number | null;
|
|
26
|
+
/** The exact platform permission the operation requires. */
|
|
27
|
+
readonly permission: string | null;
|
|
28
|
+
};
|
|
29
|
+
type MethodFn<I, O> = [I] extends [void] ? (input?: undefined, options?: CallOptions) => Promise<O> : undefined extends I ? (input?: I, options?: CallOptions) => Promise<O> : {} extends I ? (input?: I, options?: CallOptions) => Promise<O> : (input: I, options?: CallOptions) => Promise<O>;
|
|
30
|
+
/** A namespaced method: `(input, options?) => Promise<output>` plus `meta`. */
|
|
31
|
+
export type MethodOf<E> = E extends OperationEntry<infer I, infer O> ? MethodFn<I, O> & {
|
|
32
|
+
readonly meta: OperationMeta;
|
|
33
|
+
} : never;
|
|
34
|
+
/** The method at a dotted path. */
|
|
35
|
+
export type Method<P extends MethodPath> = MethodOf<OperationTable[P]>;
|
|
36
|
+
/** Input of the method at a dotted path. */
|
|
37
|
+
export type MethodInput<P extends MethodPath> = OperationTable[P] extends OperationEntry<infer I, unknown> ? I : never;
|
|
38
|
+
/** Output of the method at a dotted path. */
|
|
39
|
+
export type MethodOutput<P extends MethodPath> = OperationTable[P] extends OperationEntry<never, infer O> ? O : never;
|
|
40
|
+
type Nest<Path extends string, V> = Path extends `${infer Head}.${infer Rest}` ? {
|
|
41
|
+
readonly [K in Head]: Nest<Rest, V>;
|
|
42
|
+
} : {
|
|
43
|
+
readonly [K in Path]: V;
|
|
44
|
+
};
|
|
45
|
+
type UnionToIntersection<U> = (U extends unknown ? (value: U) => void : never) extends (value: infer I) => void ? I : never;
|
|
46
|
+
/**
|
|
47
|
+
* The namespaced API derived straight from the operation table. The
|
|
48
|
+
* documented {@link FartherShoreApi} interface is generated from the same
|
|
49
|
+
* table and pinned equal to this type.
|
|
50
|
+
*/
|
|
51
|
+
export type DerivedApi = UnionToIntersection<{
|
|
52
|
+
[P in MethodPath]: Nest<P, Method<P>>;
|
|
53
|
+
}[MethodPath]>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FartherShoreApi } from "./api.generated.js";
|
|
2
|
+
import type { CallOptions } from "./operations/define.js";
|
|
3
|
+
import { type MethodPath } from "./operations/index.js";
|
|
4
|
+
import type { OperationMeta } from "./surface-types.js";
|
|
5
|
+
import type { Transport } from "./transport.js";
|
|
6
|
+
/** Local refusal of `dryRun` on an operation that has no preview. */
|
|
7
|
+
export declare const DRY_RUN_NOT_SUPPORTED = "DRY_RUN_NOT_SUPPORTED";
|
|
8
|
+
/** `fs.call()` was given an opKey the surface does not implement. */
|
|
9
|
+
export declare const UNKNOWN_OPERATION = "UNKNOWN_OPERATION";
|
|
10
|
+
export type CreateFartherShoreOptions = {
|
|
11
|
+
/** The authenticated transport (`createTransport`). */
|
|
12
|
+
transport: Transport;
|
|
13
|
+
};
|
|
14
|
+
/** The namespaced client: the operations plus discovery. */
|
|
15
|
+
export type FartherShore = FartherShoreApi & {
|
|
16
|
+
/** Run an operation by opKey (its primary method). */
|
|
17
|
+
call(op: string, input?: unknown, options?: CallOptions): Promise<unknown>;
|
|
18
|
+
/** Metadata of every method, sorted by path. */
|
|
19
|
+
listOperations(): readonly OperationMeta[];
|
|
20
|
+
};
|
|
21
|
+
/** The method path an opKey's primary method lives at. */
|
|
22
|
+
export declare function primaryPathFor(op: string): string;
|
|
23
|
+
/** Metadata of every method of the surface, sorted by path (no client needed). */
|
|
24
|
+
export declare function listOperations(): readonly OperationMeta[];
|
|
25
|
+
/**
|
|
26
|
+
* Build the namespaced client on a transport.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const fs = createFartherShore({ transport });
|
|
30
|
+
* const tokens = await fs.runtimeTokens.read({ businessId });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function createFartherShore(options: CreateFartherShoreOptions): FartherShore;
|
|
34
|
+
/** Every method path the surface implements. */
|
|
35
|
+
export declare const METHOD_PATHS: MethodPath[];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { CredentialSource } from "./credentials.js";
|
|
2
|
+
export declare const SURFACE_HEADER = "x-fs-surface";
|
|
3
|
+
export declare const CLIENT_HEADER = "x-fs-client";
|
|
4
|
+
/** Per-attempt deadline; it bounds the response body read too. */
|
|
5
|
+
export declare const REQUEST_TIMEOUT_MS = 30000;
|
|
6
|
+
/**
|
|
7
|
+
* Per-request retry choice:
|
|
8
|
+
* - omitted — derived from the method (GET/HEAD read, everything else write;
|
|
9
|
+
* a verified read-only `dryRun` preview reads);
|
|
10
|
+
* - `"read"` — the request is read-only (a POST query or preview): retried on
|
|
11
|
+
* transient failures, never reported as an unknown outcome;
|
|
12
|
+
* - `"write"` — treat as a write even for GET/HEAD;
|
|
13
|
+
* - `"none"` — one attempt; failures keep the derived classification, so a
|
|
14
|
+
* lost write is still `OUTCOME_UNKNOWN`.
|
|
15
|
+
*/
|
|
16
|
+
export type RetryMode = "read" | "write" | "none";
|
|
17
|
+
export type TransportRequestOptions = {
|
|
18
|
+
/** Append `dry_run=true` (supported previews answer `wouldHave`). */
|
|
19
|
+
dryRun?: boolean;
|
|
20
|
+
retry?: RetryMode;
|
|
21
|
+
/**
|
|
22
|
+
* Classify the request as read-only while combining with `retry: "none"`
|
|
23
|
+
* (single attempt, read classification). Same as `retry: "read"` otherwise.
|
|
24
|
+
*/
|
|
25
|
+
readOnly?: boolean;
|
|
26
|
+
/** Cancels the request (and any retry wait); never retried. */
|
|
27
|
+
signal?: AbortSignal;
|
|
28
|
+
/** Extra request headers (they cannot replace authentication). */
|
|
29
|
+
headers?: Readonly<Record<string, string>>;
|
|
30
|
+
};
|
|
31
|
+
/** Options for {@link Transport.raw}. */
|
|
32
|
+
export type RawRequestOptions = Omit<TransportRequestOptions, "readOnly"> & {
|
|
33
|
+
query?: Readonly<Record<string, string | number | boolean | readonly string[] | undefined>>;
|
|
34
|
+
body?: unknown;
|
|
35
|
+
};
|
|
36
|
+
/** The parsed answer of {@link Transport.raw}. */
|
|
37
|
+
export type RawResponse = {
|
|
38
|
+
status: number;
|
|
39
|
+
headers: Headers | undefined;
|
|
40
|
+
/** Parsed JSON, the text body when it is not JSON, `undefined` for 204. */
|
|
41
|
+
data: unknown;
|
|
42
|
+
};
|
|
43
|
+
export type RetryOptions = {
|
|
44
|
+
/**
|
|
45
|
+
* Total attempts for a retryable request: a whole number (default 3; values
|
|
46
|
+
* below 1 mean 1). `NaN`, `Infinity` and fractions throw a `TypeError`.
|
|
47
|
+
*/
|
|
48
|
+
attempts?: number;
|
|
49
|
+
/** Backoff sleep (test seam). */
|
|
50
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
export type CreateTransportOptions = {
|
|
53
|
+
/** API origin, e.g. `https://api.example.com` (no trailing slash). */
|
|
54
|
+
baseUrl: string;
|
|
55
|
+
/** Injected fetch; defaults to `globalThis.fetch` at call time. */
|
|
56
|
+
fetch?: typeof fetch;
|
|
57
|
+
credentials: CredentialSource;
|
|
58
|
+
/** Organization id or slug selected for a user-bound credential. */
|
|
59
|
+
organizationId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Rejects an organization other than this one (directory links): a grant
|
|
62
|
+
* that names another organization fails with
|
|
63
|
+
* `AUTH_ORGANIZATION_LINK_MISMATCH` before the request is sent.
|
|
64
|
+
*/
|
|
65
|
+
requiredOrganizationId?: string;
|
|
66
|
+
/** Sent as `x-fs-surface` on every request (e.g. `"cli"`, `"mcp"`). */
|
|
67
|
+
surface: string;
|
|
68
|
+
/** Appended to the `x-fs-client` header, e.g. `"farthershore-cli/1.2.3"`. */
|
|
69
|
+
clientInfo?: string;
|
|
70
|
+
retry?: RetryOptions;
|
|
71
|
+
};
|
|
72
|
+
export type OrganizationSummary = {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
role: string;
|
|
77
|
+
};
|
|
78
|
+
export type OrganizationsResponse = {
|
|
79
|
+
userId: string;
|
|
80
|
+
organizations: OrganizationSummary[];
|
|
81
|
+
};
|
|
82
|
+
export type Transport = {
|
|
83
|
+
/** The API origin this transport targets. */
|
|
84
|
+
readonly baseUrl: string;
|
|
85
|
+
/** The credential source kind (never the credential itself). */
|
|
86
|
+
readonly credentialKind: string;
|
|
87
|
+
/** Authenticated JSON request; 204 resolves `undefined`. */
|
|
88
|
+
request<T>(method: string, path: string, body?: unknown, options?: TransportRequestOptions): Promise<T>;
|
|
89
|
+
/** Authenticated request with a binary body; JSON answer. */
|
|
90
|
+
requestRaw<T>(method: string, path: string, body: Uint8Array, contentType: string, options?: TransportRequestOptions): Promise<T>;
|
|
91
|
+
/** Authenticated request whose answer is text (CSV exports). */
|
|
92
|
+
requestText(method: string, path: string, options?: TransportRequestOptions): Promise<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Untyped request for arbitrary API paths: query object, JSON body, extra
|
|
95
|
+
* headers. Non-2xx answers throw {@link FartherShoreError}.
|
|
96
|
+
*/
|
|
97
|
+
raw(method: string, path: string, options?: RawRequestOptions): Promise<RawResponse>;
|
|
98
|
+
/** The organization this credential acts in, resolving it if needed. */
|
|
99
|
+
selectedOrganizationId(options?: {
|
|
100
|
+
signal?: AbortSignal;
|
|
101
|
+
/** `"none"`: one attempt per request made to resolve it. */
|
|
102
|
+
retry?: "none";
|
|
103
|
+
}): Promise<string | undefined>;
|
|
104
|
+
/** Organizations a user credential can act in. */
|
|
105
|
+
listOrganizations(options?: {
|
|
106
|
+
signal?: AbortSignal;
|
|
107
|
+
/** `"none"`: one attempt. */
|
|
108
|
+
retry?: "none";
|
|
109
|
+
}): Promise<OrganizationsResponse>;
|
|
110
|
+
};
|
|
111
|
+
/** Settle with `promise`, or reject as soon as `signal` aborts. */
|
|
112
|
+
export declare function untilAborted<T>(promise: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
|
|
113
|
+
/** Raw requests do not follow redirects; the refusal's code. */
|
|
114
|
+
export declare const REDIRECT_NOT_FOLLOWED = "REDIRECT_NOT_FOLLOWED";
|
|
115
|
+
/**
|
|
116
|
+
* Create the authenticated transport. It holds the credential source in its
|
|
117
|
+
* closure; no method returns or exposes an access token.
|
|
118
|
+
*/
|
|
119
|
+
export declare function createTransport(options: CreateTransportOptions): Transport;
|