@rendobar/sdk 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +71 -2
- package/dist/index.d.cts +82 -1
- package/dist/index.d.mts +82 -1
- package/dist/index.mjs +71 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -702,10 +702,67 @@ function createOrgsResource(request) {
|
|
|
702
702
|
body,
|
|
703
703
|
signal: options?.signal
|
|
704
704
|
});
|
|
705
|
-
}
|
|
705
|
+
},
|
|
706
|
+
/**
|
|
707
|
+
* Organization membership. Replaces `client.team.*`, which named a
|
|
708
|
+
* resource the API does not have: there is no team, only an organization
|
|
709
|
+
* with members and invitations.
|
|
710
|
+
*/
|
|
711
|
+
members: {
|
|
712
|
+
/** Invite someone to the current organization. Owner or admin only. */
|
|
713
|
+
async invite(params, options) {
|
|
714
|
+
return request("/orgs/current/members", {
|
|
715
|
+
method: "POST",
|
|
716
|
+
body: params,
|
|
717
|
+
signal: options?.signal
|
|
718
|
+
});
|
|
719
|
+
},
|
|
720
|
+
/** Change a member's role. Owner or admin only. */
|
|
721
|
+
async changeRole(params, options) {
|
|
722
|
+
return request(`/orgs/current/members/${params.memberId}`, {
|
|
723
|
+
method: "PATCH",
|
|
724
|
+
body: { role: params.role },
|
|
725
|
+
signal: options?.signal
|
|
726
|
+
});
|
|
727
|
+
},
|
|
728
|
+
/** Remove a member, or pass your own member id to leave. */
|
|
729
|
+
async remove(params, options) {
|
|
730
|
+
return request(`/orgs/current/members/${params.memberId}`, {
|
|
731
|
+
method: "DELETE",
|
|
732
|
+
signal: options?.signal
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
/** Pending invitations to the current organization. */
|
|
737
|
+
invitations: {
|
|
738
|
+
/** Cancel a pending invitation. Owner or admin only. */
|
|
739
|
+
async revoke(params, options) {
|
|
740
|
+
return request(`/orgs/current/invitations/${params.invitationId}`, {
|
|
741
|
+
method: "DELETE",
|
|
742
|
+
signal: options?.signal
|
|
743
|
+
});
|
|
744
|
+
} }
|
|
706
745
|
};
|
|
707
746
|
}
|
|
708
747
|
//#endregion
|
|
748
|
+
//#region src/resources/account.ts
|
|
749
|
+
/**
|
|
750
|
+
* What this account is allowed to do.
|
|
751
|
+
*
|
|
752
|
+
* `orgs.current()` also carries plan limits, alongside the subscription and
|
|
753
|
+
* balance. This is the same ceilings with none of that, so a client that only
|
|
754
|
+
* needs to validate input before submitting does not have to read billing data
|
|
755
|
+
* it has no business seeing. It is also the only one of the two an OAuth token
|
|
756
|
+
* can reach.
|
|
757
|
+
*/
|
|
758
|
+
function createAccountResource(request) {
|
|
759
|
+
return {
|
|
760
|
+
/** Plan limits and enabled features. Validate input against these before submitting. */
|
|
761
|
+
async capabilities(options) {
|
|
762
|
+
return request("/account/capabilities", { signal: options?.signal });
|
|
763
|
+
} };
|
|
764
|
+
}
|
|
765
|
+
//#endregion
|
|
709
766
|
//#region src/resources/assets.ts
|
|
710
767
|
function createAssetsResource(request) {
|
|
711
768
|
return {
|
|
@@ -737,8 +794,16 @@ function createAssetsResource(request) {
|
|
|
737
794
|
}
|
|
738
795
|
//#endregion
|
|
739
796
|
//#region src/resources/team.ts
|
|
797
|
+
/**
|
|
798
|
+
* DEPRECATED. Use `client.orgs.members` and `client.orgs.invitations`.
|
|
799
|
+
*
|
|
800
|
+
* These wrap `/team/*`, which names a resource the API does not have: there is
|
|
801
|
+
* no team, only an organization with members and invitations. The endpoints
|
|
802
|
+
* still work and will keep working until the next major.
|
|
803
|
+
*/
|
|
740
804
|
function createTeamResource(request) {
|
|
741
805
|
return {
|
|
806
|
+
/** @deprecated Use `client.orgs.members.invite()`. */
|
|
742
807
|
async invite(params, options) {
|
|
743
808
|
return request("/team/invite", {
|
|
744
809
|
method: "POST",
|
|
@@ -746,13 +811,15 @@ function createTeamResource(request) {
|
|
|
746
811
|
signal: options?.signal
|
|
747
812
|
});
|
|
748
813
|
},
|
|
814
|
+
/** @deprecated Use `client.orgs.members.changeRole()`. */
|
|
749
815
|
async changeRole(params, options) {
|
|
750
816
|
await request("/team/role", {
|
|
751
|
-
method: "
|
|
817
|
+
method: "PATCH",
|
|
752
818
|
body: params,
|
|
753
819
|
signal: options?.signal
|
|
754
820
|
});
|
|
755
821
|
},
|
|
822
|
+
/** @deprecated Use `client.orgs.members.remove()`. */
|
|
756
823
|
async remove(params, options) {
|
|
757
824
|
await request("/team/remove", {
|
|
758
825
|
method: "POST",
|
|
@@ -760,6 +827,7 @@ function createTeamResource(request) {
|
|
|
760
827
|
signal: options?.signal
|
|
761
828
|
});
|
|
762
829
|
},
|
|
830
|
+
/** @deprecated Use `client.orgs.invitations.revoke()`. */
|
|
763
831
|
async revokeInvitation(params, options) {
|
|
764
832
|
await request("/team/revoke-invitation", {
|
|
765
833
|
method: "POST",
|
|
@@ -931,6 +999,7 @@ function createClient(config = {}) {
|
|
|
931
999
|
webhooks: createWebhooksResource(request),
|
|
932
1000
|
apiKeys: createApiKeysResource(request),
|
|
933
1001
|
orgs: createOrgsResource(request),
|
|
1002
|
+
account: createAccountResource(request),
|
|
934
1003
|
assets: createAssetsResource(request),
|
|
935
1004
|
team: createTeamResource(request),
|
|
936
1005
|
realtime: createRealtimeClient(baseUrl, {
|
package/dist/index.d.cts
CHANGED
|
@@ -2696,7 +2696,45 @@ declare const jobTypeSchema: ZodObject<{
|
|
|
2696
2696
|
tag: ZodString;
|
|
2697
2697
|
summary: ZodString;
|
|
2698
2698
|
acceptsMedia: ZodArray<ZodString>;
|
|
2699
|
+
useCases: ZodArray<ZodString>;
|
|
2700
|
+
chainsWith: ZodArray<ZodString>;
|
|
2699
2701
|
}, $strip>;
|
|
2702
|
+
/**
|
|
2703
|
+
* What the caller is allowed to do. Deliberately carries no balance, price or
|
|
2704
|
+
* subscription data: this is the one capability surface an OAuth token can
|
|
2705
|
+
* reach, and the billing routes it cannot are where money belongs.
|
|
2706
|
+
*
|
|
2707
|
+
* Written out rather than derived from PLAN_LIMITS / PLAN_FEATURES so the
|
|
2708
|
+
* published spec names every field and a generated client gets
|
|
2709
|
+
* `capabilities.features.gpu`, not a string map. `account-capabilities.test.ts`
|
|
2710
|
+
* fails the build if these keys and the plan constants ever diverge.
|
|
2711
|
+
*/
|
|
2712
|
+
declare const accountCapabilitiesSchema: ZodObject<{
|
|
2713
|
+
plan: ZodObject<{
|
|
2714
|
+
slug: ZodString;
|
|
2715
|
+
name: ZodString;
|
|
2716
|
+
}, $strip>;
|
|
2717
|
+
limits: ZodObject<{
|
|
2718
|
+
concurrentJobs: ZodNumber;
|
|
2719
|
+
maxQueuedJobs: ZodNumber;
|
|
2720
|
+
apiRequestsPerMinute: ZodNumber;
|
|
2721
|
+
maxJobTimeout: ZodNumber;
|
|
2722
|
+
maxInputFileSize: ZodNumber;
|
|
2723
|
+
maxJobInputSize: ZodNumber;
|
|
2724
|
+
storageQuota: ZodNumber;
|
|
2725
|
+
outputRetentionDays: ZodNumber;
|
|
2726
|
+
maxUploadSessionFiles: ZodNumber;
|
|
2727
|
+
}, $strip>;
|
|
2728
|
+
features: ZodObject<{
|
|
2729
|
+
rawFfmpeg: ZodBoolean;
|
|
2730
|
+
mcp: ZodBoolean;
|
|
2731
|
+
webhooks: ZodBoolean;
|
|
2732
|
+
priorityQueue: ZodBoolean;
|
|
2733
|
+
customRunners: ZodBoolean;
|
|
2734
|
+
gpu: ZodBoolean;
|
|
2735
|
+
}, $strip>;
|
|
2736
|
+
}, $strip>;
|
|
2737
|
+
type AccountCapabilities = output<typeof accountCapabilitiesSchema>;
|
|
2700
2738
|
declare const billingStateSchema: ZodObject<{
|
|
2701
2739
|
balance: ZodObject<{
|
|
2702
2740
|
amount: ZodNumber;
|
|
@@ -3548,6 +3586,49 @@ declare function createClient(config?: ClientConfig): {
|
|
|
3548
3586
|
updateSettings(body: Partial<Pick<OrgSettings, "billingEmailsEnabled" | "defaultRegion" | "regionPinned">>, options?: {
|
|
3549
3587
|
signal?: AbortSignal;
|
|
3550
3588
|
}): Promise<OrgSettings>;
|
|
3589
|
+
members: {
|
|
3590
|
+
invite(params: {
|
|
3591
|
+
email: string;
|
|
3592
|
+
role: "admin" | "member";
|
|
3593
|
+
}, options?: {
|
|
3594
|
+
signal?: AbortSignal;
|
|
3595
|
+
}): Promise<{
|
|
3596
|
+
id: string;
|
|
3597
|
+
email: string;
|
|
3598
|
+
role: string;
|
|
3599
|
+
expiresAt: number;
|
|
3600
|
+
}>;
|
|
3601
|
+
changeRole(params: {
|
|
3602
|
+
memberId: string;
|
|
3603
|
+
role: "admin" | "member";
|
|
3604
|
+
}, options?: {
|
|
3605
|
+
signal?: AbortSignal;
|
|
3606
|
+
}): Promise<{
|
|
3607
|
+
memberId: string;
|
|
3608
|
+
role: string;
|
|
3609
|
+
}>;
|
|
3610
|
+
remove(params: {
|
|
3611
|
+
memberId: string;
|
|
3612
|
+
}, options?: {
|
|
3613
|
+
signal?: AbortSignal;
|
|
3614
|
+
}): Promise<{
|
|
3615
|
+
removed: boolean;
|
|
3616
|
+
}>;
|
|
3617
|
+
};
|
|
3618
|
+
invitations: {
|
|
3619
|
+
revoke(params: {
|
|
3620
|
+
invitationId: string;
|
|
3621
|
+
}, options?: {
|
|
3622
|
+
signal?: AbortSignal;
|
|
3623
|
+
}): Promise<{
|
|
3624
|
+
revoked: boolean;
|
|
3625
|
+
}>;
|
|
3626
|
+
};
|
|
3627
|
+
};
|
|
3628
|
+
account: {
|
|
3629
|
+
capabilities(options?: {
|
|
3630
|
+
signal?: AbortSignal;
|
|
3631
|
+
}): Promise<AccountCapabilities>;
|
|
3551
3632
|
};
|
|
3552
3633
|
assets: {
|
|
3553
3634
|
list(params?: ListAssetsParams, options?: {
|
|
@@ -3967,4 +4048,4 @@ type AssetListPage = {
|
|
|
3967
4048
|
meta: AssetListMeta;
|
|
3968
4049
|
};
|
|
3969
4050
|
//#endregion
|
|
3970
|
-
export { ApiError, type ApiKey, type AssetResponse as Asset, type AssetDownloadResponse, type AssetInitResponse, type AssetListMeta, type AssetListPage, type BalanceDepletedData, type BalanceLowData, type BillingInvoice, type BillingState, type ClientConfig, type Cost, type CreateJobParams, type CreateUploadOptions, type CreateWebhookParams, type FfmpegParams, type FileType, type GenModelTier, type ImageEditParams, type ImageGenerateParams, type JobResponse as Job, type JobCancelledData, type JobCompletedData, type JobCreatedData, type JobCreatedResponse, type JobError, type JobFailedData, JobFailedError, type JobListPage, type JobStartedData, type JobStats, type JobStep, type JobSubscribeOptions, type JobSubscription, type JobTimings, type JobType, type ListAssetsParams, type ListDeliveriesParams, type ListJobsParams, type LogEntryData, type OrgCurrentResponse, type OrgEvent, type OrgSettings, type Organization, type Output, type OutputFile, type PaginationMeta, type PaymentMethod, type RealtimeConnectOptions, type RealtimeConnection, type RendobarClient, type RetryDeliveryResult, type StatsParams, type TestEventData, type Transaction, type TransactionListParams, type UpdateWebhookParams, type UploadProgress, type UsageParams, type UsageSummary, type WaitOptions, WaitTimeoutError, type WebhookDelivery, type WebhookEndpoint, type WebhookEventDataMap, type WebhookPayload, createClient, isApiError, jobData, outputUrl };
|
|
4051
|
+
export { type AccountCapabilities, ApiError, type ApiKey, type AssetResponse as Asset, type AssetDownloadResponse, type AssetInitResponse, type AssetListMeta, type AssetListPage, type BalanceDepletedData, type BalanceLowData, type BillingInvoice, type BillingState, type ClientConfig, type Cost, type CreateJobParams, type CreateUploadOptions, type CreateWebhookParams, type FfmpegParams, type FileType, type GenModelTier, type ImageEditParams, type ImageGenerateParams, type JobResponse as Job, type JobCancelledData, type JobCompletedData, type JobCreatedData, type JobCreatedResponse, type JobError, type JobFailedData, JobFailedError, type JobListPage, type JobStartedData, type JobStats, type JobStep, type JobSubscribeOptions, type JobSubscription, type JobTimings, type JobType, type ListAssetsParams, type ListDeliveriesParams, type ListJobsParams, type LogEntryData, type OrgCurrentResponse, type OrgEvent, type OrgSettings, type Organization, type Output, type OutputFile, type PaginationMeta, type PaymentMethod, type RealtimeConnectOptions, type RealtimeConnection, type RendobarClient, type RetryDeliveryResult, type StatsParams, type TestEventData, type Transaction, type TransactionListParams, type UpdateWebhookParams, type UploadProgress, type UsageParams, type UsageSummary, type WaitOptions, WaitTimeoutError, type WebhookDelivery, type WebhookEndpoint, type WebhookEventDataMap, type WebhookPayload, createClient, isApiError, jobData, outputUrl };
|
package/dist/index.d.mts
CHANGED
|
@@ -2696,7 +2696,45 @@ declare const jobTypeSchema: ZodObject<{
|
|
|
2696
2696
|
tag: ZodString;
|
|
2697
2697
|
summary: ZodString;
|
|
2698
2698
|
acceptsMedia: ZodArray<ZodString>;
|
|
2699
|
+
useCases: ZodArray<ZodString>;
|
|
2700
|
+
chainsWith: ZodArray<ZodString>;
|
|
2699
2701
|
}, $strip>;
|
|
2702
|
+
/**
|
|
2703
|
+
* What the caller is allowed to do. Deliberately carries no balance, price or
|
|
2704
|
+
* subscription data: this is the one capability surface an OAuth token can
|
|
2705
|
+
* reach, and the billing routes it cannot are where money belongs.
|
|
2706
|
+
*
|
|
2707
|
+
* Written out rather than derived from PLAN_LIMITS / PLAN_FEATURES so the
|
|
2708
|
+
* published spec names every field and a generated client gets
|
|
2709
|
+
* `capabilities.features.gpu`, not a string map. `account-capabilities.test.ts`
|
|
2710
|
+
* fails the build if these keys and the plan constants ever diverge.
|
|
2711
|
+
*/
|
|
2712
|
+
declare const accountCapabilitiesSchema: ZodObject<{
|
|
2713
|
+
plan: ZodObject<{
|
|
2714
|
+
slug: ZodString;
|
|
2715
|
+
name: ZodString;
|
|
2716
|
+
}, $strip>;
|
|
2717
|
+
limits: ZodObject<{
|
|
2718
|
+
concurrentJobs: ZodNumber;
|
|
2719
|
+
maxQueuedJobs: ZodNumber;
|
|
2720
|
+
apiRequestsPerMinute: ZodNumber;
|
|
2721
|
+
maxJobTimeout: ZodNumber;
|
|
2722
|
+
maxInputFileSize: ZodNumber;
|
|
2723
|
+
maxJobInputSize: ZodNumber;
|
|
2724
|
+
storageQuota: ZodNumber;
|
|
2725
|
+
outputRetentionDays: ZodNumber;
|
|
2726
|
+
maxUploadSessionFiles: ZodNumber;
|
|
2727
|
+
}, $strip>;
|
|
2728
|
+
features: ZodObject<{
|
|
2729
|
+
rawFfmpeg: ZodBoolean;
|
|
2730
|
+
mcp: ZodBoolean;
|
|
2731
|
+
webhooks: ZodBoolean;
|
|
2732
|
+
priorityQueue: ZodBoolean;
|
|
2733
|
+
customRunners: ZodBoolean;
|
|
2734
|
+
gpu: ZodBoolean;
|
|
2735
|
+
}, $strip>;
|
|
2736
|
+
}, $strip>;
|
|
2737
|
+
type AccountCapabilities = output<typeof accountCapabilitiesSchema>;
|
|
2700
2738
|
declare const billingStateSchema: ZodObject<{
|
|
2701
2739
|
balance: ZodObject<{
|
|
2702
2740
|
amount: ZodNumber;
|
|
@@ -3548,6 +3586,49 @@ declare function createClient(config?: ClientConfig): {
|
|
|
3548
3586
|
updateSettings(body: Partial<Pick<OrgSettings, "billingEmailsEnabled" | "defaultRegion" | "regionPinned">>, options?: {
|
|
3549
3587
|
signal?: AbortSignal;
|
|
3550
3588
|
}): Promise<OrgSettings>;
|
|
3589
|
+
members: {
|
|
3590
|
+
invite(params: {
|
|
3591
|
+
email: string;
|
|
3592
|
+
role: "admin" | "member";
|
|
3593
|
+
}, options?: {
|
|
3594
|
+
signal?: AbortSignal;
|
|
3595
|
+
}): Promise<{
|
|
3596
|
+
id: string;
|
|
3597
|
+
email: string;
|
|
3598
|
+
role: string;
|
|
3599
|
+
expiresAt: number;
|
|
3600
|
+
}>;
|
|
3601
|
+
changeRole(params: {
|
|
3602
|
+
memberId: string;
|
|
3603
|
+
role: "admin" | "member";
|
|
3604
|
+
}, options?: {
|
|
3605
|
+
signal?: AbortSignal;
|
|
3606
|
+
}): Promise<{
|
|
3607
|
+
memberId: string;
|
|
3608
|
+
role: string;
|
|
3609
|
+
}>;
|
|
3610
|
+
remove(params: {
|
|
3611
|
+
memberId: string;
|
|
3612
|
+
}, options?: {
|
|
3613
|
+
signal?: AbortSignal;
|
|
3614
|
+
}): Promise<{
|
|
3615
|
+
removed: boolean;
|
|
3616
|
+
}>;
|
|
3617
|
+
};
|
|
3618
|
+
invitations: {
|
|
3619
|
+
revoke(params: {
|
|
3620
|
+
invitationId: string;
|
|
3621
|
+
}, options?: {
|
|
3622
|
+
signal?: AbortSignal;
|
|
3623
|
+
}): Promise<{
|
|
3624
|
+
revoked: boolean;
|
|
3625
|
+
}>;
|
|
3626
|
+
};
|
|
3627
|
+
};
|
|
3628
|
+
account: {
|
|
3629
|
+
capabilities(options?: {
|
|
3630
|
+
signal?: AbortSignal;
|
|
3631
|
+
}): Promise<AccountCapabilities>;
|
|
3551
3632
|
};
|
|
3552
3633
|
assets: {
|
|
3553
3634
|
list(params?: ListAssetsParams, options?: {
|
|
@@ -3967,4 +4048,4 @@ type AssetListPage = {
|
|
|
3967
4048
|
meta: AssetListMeta;
|
|
3968
4049
|
};
|
|
3969
4050
|
//#endregion
|
|
3970
|
-
export { ApiError, type ApiKey, type AssetResponse as Asset, type AssetDownloadResponse, type AssetInitResponse, type AssetListMeta, type AssetListPage, type BalanceDepletedData, type BalanceLowData, type BillingInvoice, type BillingState, type ClientConfig, type Cost, type CreateJobParams, type CreateUploadOptions, type CreateWebhookParams, type FfmpegParams, type FileType, type GenModelTier, type ImageEditParams, type ImageGenerateParams, type JobResponse as Job, type JobCancelledData, type JobCompletedData, type JobCreatedData, type JobCreatedResponse, type JobError, type JobFailedData, JobFailedError, type JobListPage, type JobStartedData, type JobStats, type JobStep, type JobSubscribeOptions, type JobSubscription, type JobTimings, type JobType, type ListAssetsParams, type ListDeliveriesParams, type ListJobsParams, type LogEntryData, type OrgCurrentResponse, type OrgEvent, type OrgSettings, type Organization, type Output, type OutputFile, type PaginationMeta, type PaymentMethod, type RealtimeConnectOptions, type RealtimeConnection, type RendobarClient, type RetryDeliveryResult, type StatsParams, type TestEventData, type Transaction, type TransactionListParams, type UpdateWebhookParams, type UploadProgress, type UsageParams, type UsageSummary, type WaitOptions, WaitTimeoutError, type WebhookDelivery, type WebhookEndpoint, type WebhookEventDataMap, type WebhookPayload, createClient, isApiError, jobData, outputUrl };
|
|
4051
|
+
export { type AccountCapabilities, ApiError, type ApiKey, type AssetResponse as Asset, type AssetDownloadResponse, type AssetInitResponse, type AssetListMeta, type AssetListPage, type BalanceDepletedData, type BalanceLowData, type BillingInvoice, type BillingState, type ClientConfig, type Cost, type CreateJobParams, type CreateUploadOptions, type CreateWebhookParams, type FfmpegParams, type FileType, type GenModelTier, type ImageEditParams, type ImageGenerateParams, type JobResponse as Job, type JobCancelledData, type JobCompletedData, type JobCreatedData, type JobCreatedResponse, type JobError, type JobFailedData, JobFailedError, type JobListPage, type JobStartedData, type JobStats, type JobStep, type JobSubscribeOptions, type JobSubscription, type JobTimings, type JobType, type ListAssetsParams, type ListDeliveriesParams, type ListJobsParams, type LogEntryData, type OrgCurrentResponse, type OrgEvent, type OrgSettings, type Organization, type Output, type OutputFile, type PaginationMeta, type PaymentMethod, type RealtimeConnectOptions, type RealtimeConnection, type RendobarClient, type RetryDeliveryResult, type StatsParams, type TestEventData, type Transaction, type TransactionListParams, type UpdateWebhookParams, type UploadProgress, type UsageParams, type UsageSummary, type WaitOptions, WaitTimeoutError, type WebhookDelivery, type WebhookEndpoint, type WebhookEventDataMap, type WebhookPayload, createClient, isApiError, jobData, outputUrl };
|
package/dist/index.mjs
CHANGED
|
@@ -701,10 +701,67 @@ function createOrgsResource(request) {
|
|
|
701
701
|
body,
|
|
702
702
|
signal: options?.signal
|
|
703
703
|
});
|
|
704
|
-
}
|
|
704
|
+
},
|
|
705
|
+
/**
|
|
706
|
+
* Organization membership. Replaces `client.team.*`, which named a
|
|
707
|
+
* resource the API does not have: there is no team, only an organization
|
|
708
|
+
* with members and invitations.
|
|
709
|
+
*/
|
|
710
|
+
members: {
|
|
711
|
+
/** Invite someone to the current organization. Owner or admin only. */
|
|
712
|
+
async invite(params, options) {
|
|
713
|
+
return request("/orgs/current/members", {
|
|
714
|
+
method: "POST",
|
|
715
|
+
body: params,
|
|
716
|
+
signal: options?.signal
|
|
717
|
+
});
|
|
718
|
+
},
|
|
719
|
+
/** Change a member's role. Owner or admin only. */
|
|
720
|
+
async changeRole(params, options) {
|
|
721
|
+
return request(`/orgs/current/members/${params.memberId}`, {
|
|
722
|
+
method: "PATCH",
|
|
723
|
+
body: { role: params.role },
|
|
724
|
+
signal: options?.signal
|
|
725
|
+
});
|
|
726
|
+
},
|
|
727
|
+
/** Remove a member, or pass your own member id to leave. */
|
|
728
|
+
async remove(params, options) {
|
|
729
|
+
return request(`/orgs/current/members/${params.memberId}`, {
|
|
730
|
+
method: "DELETE",
|
|
731
|
+
signal: options?.signal
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
/** Pending invitations to the current organization. */
|
|
736
|
+
invitations: {
|
|
737
|
+
/** Cancel a pending invitation. Owner or admin only. */
|
|
738
|
+
async revoke(params, options) {
|
|
739
|
+
return request(`/orgs/current/invitations/${params.invitationId}`, {
|
|
740
|
+
method: "DELETE",
|
|
741
|
+
signal: options?.signal
|
|
742
|
+
});
|
|
743
|
+
} }
|
|
705
744
|
};
|
|
706
745
|
}
|
|
707
746
|
//#endregion
|
|
747
|
+
//#region src/resources/account.ts
|
|
748
|
+
/**
|
|
749
|
+
* What this account is allowed to do.
|
|
750
|
+
*
|
|
751
|
+
* `orgs.current()` also carries plan limits, alongside the subscription and
|
|
752
|
+
* balance. This is the same ceilings with none of that, so a client that only
|
|
753
|
+
* needs to validate input before submitting does not have to read billing data
|
|
754
|
+
* it has no business seeing. It is also the only one of the two an OAuth token
|
|
755
|
+
* can reach.
|
|
756
|
+
*/
|
|
757
|
+
function createAccountResource(request) {
|
|
758
|
+
return {
|
|
759
|
+
/** Plan limits and enabled features. Validate input against these before submitting. */
|
|
760
|
+
async capabilities(options) {
|
|
761
|
+
return request("/account/capabilities", { signal: options?.signal });
|
|
762
|
+
} };
|
|
763
|
+
}
|
|
764
|
+
//#endregion
|
|
708
765
|
//#region src/resources/assets.ts
|
|
709
766
|
function createAssetsResource(request) {
|
|
710
767
|
return {
|
|
@@ -736,8 +793,16 @@ function createAssetsResource(request) {
|
|
|
736
793
|
}
|
|
737
794
|
//#endregion
|
|
738
795
|
//#region src/resources/team.ts
|
|
796
|
+
/**
|
|
797
|
+
* DEPRECATED. Use `client.orgs.members` and `client.orgs.invitations`.
|
|
798
|
+
*
|
|
799
|
+
* These wrap `/team/*`, which names a resource the API does not have: there is
|
|
800
|
+
* no team, only an organization with members and invitations. The endpoints
|
|
801
|
+
* still work and will keep working until the next major.
|
|
802
|
+
*/
|
|
739
803
|
function createTeamResource(request) {
|
|
740
804
|
return {
|
|
805
|
+
/** @deprecated Use `client.orgs.members.invite()`. */
|
|
741
806
|
async invite(params, options) {
|
|
742
807
|
return request("/team/invite", {
|
|
743
808
|
method: "POST",
|
|
@@ -745,13 +810,15 @@ function createTeamResource(request) {
|
|
|
745
810
|
signal: options?.signal
|
|
746
811
|
});
|
|
747
812
|
},
|
|
813
|
+
/** @deprecated Use `client.orgs.members.changeRole()`. */
|
|
748
814
|
async changeRole(params, options) {
|
|
749
815
|
await request("/team/role", {
|
|
750
|
-
method: "
|
|
816
|
+
method: "PATCH",
|
|
751
817
|
body: params,
|
|
752
818
|
signal: options?.signal
|
|
753
819
|
});
|
|
754
820
|
},
|
|
821
|
+
/** @deprecated Use `client.orgs.members.remove()`. */
|
|
755
822
|
async remove(params, options) {
|
|
756
823
|
await request("/team/remove", {
|
|
757
824
|
method: "POST",
|
|
@@ -759,6 +826,7 @@ function createTeamResource(request) {
|
|
|
759
826
|
signal: options?.signal
|
|
760
827
|
});
|
|
761
828
|
},
|
|
829
|
+
/** @deprecated Use `client.orgs.invitations.revoke()`. */
|
|
762
830
|
async revokeInvitation(params, options) {
|
|
763
831
|
await request("/team/revoke-invitation", {
|
|
764
832
|
method: "POST",
|
|
@@ -930,6 +998,7 @@ function createClient(config = {}) {
|
|
|
930
998
|
webhooks: createWebhooksResource(request),
|
|
931
999
|
apiKeys: createApiKeysResource(request),
|
|
932
1000
|
orgs: createOrgsResource(request),
|
|
1001
|
+
account: createAccountResource(request),
|
|
933
1002
|
assets: createAssetsResource(request),
|
|
934
1003
|
team: createTeamResource(request),
|
|
935
1004
|
realtime: createRealtimeClient(baseUrl, {
|