@gigadrive/sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,6 +29,28 @@ const { items: organizations } = await client.organizations.list();
29
29
  const { items: applications } = await client.applications.list();
30
30
  ```
31
31
 
32
+ ## Organizations and product entitlements
33
+
34
+ Organizations are the top-level account containers for Gigadrive products.
35
+ Beyond listing orgs, the SDK can create organizations, inspect members, and
36
+ check product entitlements (read-only; the SDK does not activate or change plans):
37
+
38
+ ```ts
39
+ // Create an organization (user-backed token + platform:organizations:write)
40
+ const org = await client.organizations.create({ name: 'Acme Corp' });
41
+
42
+ // Fetch one organization and its members
43
+ const details = await client.organizations.get(org.id);
44
+ const { items: members } = await client.organizations.members.list(org.id);
45
+
46
+ // Inspect product access / entitlements (read-only)
47
+ const { items: products } = await client.organizations.products.list(org.id);
48
+ const office = await client.organizations.products.get(org.id, 'office');
49
+ const check = await client.organizations.products.checkEntitlement(org.id, 'office');
50
+
51
+ console.log(details.name, members.length, office.hasAccess, check.hasAccess, products.length);
52
+ ```
53
+
32
54
  ## Authentication
33
55
 
34
56
  Authentication is handled for you — tokens are fetched, cached, and refreshed
package/dist/index.d.mts CHANGED
@@ -1865,6 +1865,204 @@ declare class OrganizationEnvVarsResource extends BaseResource {
1865
1865
  delete(organizationId: string, envVarId: string): Promise<void>;
1866
1866
  }
1867
1867
 
1868
+ /** Organization membership role used for administration privileges. */
1869
+ type OrganizationMembershipRole = 'OWNER' | 'ADMIN' | 'MEMBER';
1870
+ /** A user membership in a Gigadrive organization. */
1871
+ interface OrganizationMember {
1872
+ /** Unique membership identifier (UUID). */
1873
+ membershipId: string;
1874
+ /** Organization that owns this membership. */
1875
+ organizationId: string;
1876
+ /** User who belongs to the organization. */
1877
+ userId: string;
1878
+ /** Email address of the organization member. */
1879
+ email: string;
1880
+ /** Given name of the organization member, or null when unset. */
1881
+ givenName: string | null;
1882
+ /** Family name of the organization member, or null when unset. */
1883
+ familyName: string | null;
1884
+ /** Avatar URL for the organization member, or null when unset. */
1885
+ imageUrl: string | null;
1886
+ /** Organization membership role. */
1887
+ role: OrganizationMembershipRole;
1888
+ /** ISO 8601 timestamp when the user joined the organization. */
1889
+ joinedAt: string;
1890
+ }
1891
+ /**
1892
+ * List organization members. Accessed via {@link OrganizationsResource.members}.
1893
+ *
1894
+ * @example
1895
+ * ```ts
1896
+ * const { items } = await client.organizations.members.list('org-id');
1897
+ * console.log(items.map((m) => `${m.email} (${m.role})`));
1898
+ * ```
1899
+ */
1900
+ declare class OrganizationMembersResource extends BaseResource {
1901
+ /**
1902
+ * List the users who belong to an organization.
1903
+ *
1904
+ * @param organizationId - Organization whose members should be listed.
1905
+ * @param query - Optional pagination.
1906
+ * @returns A paginated list of organization members.
1907
+ *
1908
+ * @example
1909
+ * ```ts
1910
+ * const { items, total } = await client.organizations.members.list('org-id');
1911
+ * console.log(`Found ${total} members`);
1912
+ * ```
1913
+ */
1914
+ list(organizationId: string, query?: ListQuery): Promise<Paginated<OrganizationMember>>;
1915
+ }
1916
+
1917
+ /** Product access mode from the code-defined product registry. */
1918
+ type ProductAccessMode = 'organization' | 'user';
1919
+ /** Fallback access policy when no explicit entitlement override exists. */
1920
+ type ProductDefaultAccessPolicy = 'granted' | 'explicit_entitlement_required';
1921
+ /** Lifecycle status of an explicit product entitlement override. */
1922
+ type ProductEntitlementStatus = 'ACTIVE' | 'SUSPENDED' | 'REVOKED';
1923
+ /** Lifecycle status of a local organization product subscription. */
1924
+ type ProductSubscriptionStatus = 'ACTIVE' | 'CANCELED';
1925
+ /** Whether effective access was resolved from an override or the registry default. */
1926
+ type ProductAccessResolutionSource = 'explicit' | 'default';
1927
+ /** A plan defined for a product in the product registry. */
1928
+ interface ProductPlan {
1929
+ /** Stable plan slug. */
1930
+ slug: string;
1931
+ /** Human-readable plan name. */
1932
+ displayName: string;
1933
+ /** Short description of the plan. */
1934
+ description: string;
1935
+ }
1936
+ /** Product metadata from the code-defined product registry. */
1937
+ interface ProductDefinition {
1938
+ /** Stable product slug (e.g. `network`, `office`). */
1939
+ slug: string;
1940
+ /** Human-readable product name. */
1941
+ displayName: string;
1942
+ /** Whether the product is granted to organizations or directly to users. */
1943
+ accessMode: ProductAccessMode;
1944
+ /** Fallback access policy when no explicit entitlement override exists. */
1945
+ defaultAccessPolicy: ProductDefaultAccessPolicy;
1946
+ /** Locally activatable plans for the product. */
1947
+ plans: ProductPlan[];
1948
+ }
1949
+ /** Explicit organization product entitlement override. */
1950
+ interface OrganizationProductEntitlement {
1951
+ /** Unique identifier (UUID). */
1952
+ id: string;
1953
+ /** Product slug this entitlement applies to. */
1954
+ product: string;
1955
+ /** Lifecycle status of the override. */
1956
+ status: ProductEntitlementStatus;
1957
+ /** User who last granted or updated the override, if known. */
1958
+ grantedByUserId: string | null;
1959
+ /** ISO 8601 timestamp when the entitlement was revoked, if revoked. */
1960
+ revokedAt: string | null;
1961
+ /** ISO 8601 creation timestamp. */
1962
+ createdAt: string;
1963
+ /** ISO 8601 last-updated timestamp. */
1964
+ updatedAt: string;
1965
+ }
1966
+ /** Local organization product subscription / plan selection. */
1967
+ interface OrganizationProductSubscription {
1968
+ /** Unique identifier (UUID). */
1969
+ id: string;
1970
+ /** Product slug this subscription applies to. */
1971
+ product: string;
1972
+ /** Currently selected plan slug. */
1973
+ plan: string;
1974
+ /** Local subscription lifecycle status. */
1975
+ status: ProductSubscriptionStatus;
1976
+ /** User who activated the current plan, if known. */
1977
+ activatedByUserId: string | null;
1978
+ /** ISO 8601 creation timestamp. */
1979
+ createdAt: string;
1980
+ /** ISO 8601 last-updated timestamp. */
1981
+ updatedAt: string;
1982
+ }
1983
+ /** Effective product access summary for an organization-scoped product. */
1984
+ interface OrganizationProductAccess {
1985
+ /** Product metadata from the registry. */
1986
+ product: ProductDefinition;
1987
+ /** Whether the organization currently has effective access. */
1988
+ hasAccess: boolean;
1989
+ /** Whether access was resolved from an explicit override or the default policy. */
1990
+ resolutionSource: ProductAccessResolutionSource;
1991
+ /** Explicit entitlement override when one exists. */
1992
+ explicitEntitlement: OrganizationProductEntitlement | null;
1993
+ /** Local product subscription when one exists. */
1994
+ subscription: OrganizationProductSubscription | null;
1995
+ }
1996
+ /** Compact yes/no entitlement check for an organization product. */
1997
+ interface OrganizationProductEntitlementCheck {
1998
+ /** Organization that was checked. */
1999
+ organizationId: string;
2000
+ /** Product slug that was checked. */
2001
+ product: string;
2002
+ /** Whether the organization currently has effective access. */
2003
+ hasAccess: boolean;
2004
+ }
2005
+ /**
2006
+ * Inspect organization product access / entitlements.
2007
+ *
2008
+ * Accessed via {@link OrganizationsResource.products}.
2009
+ *
2010
+ * Subscriptions are read-only through the public API — plan changes happen in
2011
+ * Gigadrive product surfaces, not via the SDK.
2012
+ *
2013
+ * @example
2014
+ * ```ts
2015
+ * const { items } = await client.organizations.products.list('org-id');
2016
+ * const check = await client.organizations.products.checkEntitlement('org-id', 'office');
2017
+ * console.log(check.hasAccess);
2018
+ * ```
2019
+ */
2020
+ declare class OrganizationProductsResource extends BaseResource {
2021
+ /**
2022
+ * List effective product access for every organization-scoped product.
2023
+ *
2024
+ * @param organizationId - Organization whose product access should be listed.
2025
+ * @param query - Optional pagination.
2026
+ * @returns A paginated list of product access summaries.
2027
+ *
2028
+ * @example
2029
+ * ```ts
2030
+ * const { items } = await client.organizations.products.list('org-id');
2031
+ * for (const item of items) {
2032
+ * console.log(item.product.slug, item.hasAccess);
2033
+ * }
2034
+ * ```
2035
+ */
2036
+ list(organizationId: string, query?: ListQuery): Promise<Paginated<OrganizationProductAccess>>;
2037
+ /**
2038
+ * Get effective access for one organization-scoped product.
2039
+ *
2040
+ * @param organizationId - Organization to inspect.
2041
+ * @param product - Product slug from the product registry.
2042
+ * @returns Product access summary including entitlement and subscription state.
2043
+ *
2044
+ * @example
2045
+ * ```ts
2046
+ * const access = await client.organizations.products.get('org-id', 'office');
2047
+ * console.log(access.hasAccess, access.subscription?.plan);
2048
+ * ```
2049
+ */
2050
+ get(organizationId: string, product: string): Promise<OrganizationProductAccess>;
2051
+ /**
2052
+ * Check whether an organization currently has access to a product.
2053
+ *
2054
+ * @param organizationId - Organization to check.
2055
+ * @param product - Product slug from the product registry.
2056
+ * @returns Compact entitlement check result.
2057
+ *
2058
+ * @example
2059
+ * ```ts
2060
+ * const { hasAccess } = await client.organizations.products.checkEntitlement('org-id', 'network');
2061
+ * ```
2062
+ */
2063
+ checkEntitlement(organizationId: string, product: string): Promise<OrganizationProductEntitlementCheck>;
2064
+ }
2065
+
1868
2066
  /** A Gigadrive Network organization. */
1869
2067
  interface Organization {
1870
2068
  /** Unique identifier (UUID). */
@@ -1880,6 +2078,13 @@ interface Organization {
1880
2078
  /** ISO 8601 last-updated timestamp. */
1881
2079
  updatedAt: string;
1882
2080
  }
2081
+ /** Input for creating an organization. */
2082
+ interface CreateOrganizationInput {
2083
+ /** Display name for the new organization. */
2084
+ name: string;
2085
+ /** Optional URL-safe slug. Generated from the name when omitted. */
2086
+ slug?: string;
2087
+ }
1883
2088
  /**
1884
2089
  * Manage organizations. Accessed via {@link GigadriveClient.organizations}.
1885
2090
  *
@@ -1918,6 +2123,25 @@ declare class OrganizationsResource extends BaseResource {
1918
2123
  * ```
1919
2124
  */
1920
2125
  readonly aiGateway: OrganizationAiGatewayResource;
2126
+ /**
2127
+ * List organization members and membership roles.
2128
+ *
2129
+ * @example
2130
+ * ```ts
2131
+ * const { items } = await client.organizations.members.list('org-id');
2132
+ * ```
2133
+ */
2134
+ readonly members: OrganizationMembersResource;
2135
+ /**
2136
+ * Inspect organization product entitlements. Read-only through the public
2137
+ * API — plan changes happen in Gigadrive product surfaces, not via the SDK.
2138
+ *
2139
+ * @example
2140
+ * ```ts
2141
+ * const check = await client.organizations.products.checkEntitlement('org-id', 'office');
2142
+ * ```
2143
+ */
2144
+ readonly products: OrganizationProductsResource;
1921
2145
  constructor(...args: ConstructorParameters<typeof BaseResource>);
1922
2146
  /**
1923
2147
  * List organizations the authenticated actor has access to.
@@ -1932,6 +2156,35 @@ declare class OrganizationsResource extends BaseResource {
1932
2156
  * ```
1933
2157
  */
1934
2158
  list(query?: ListQuery): Promise<Paginated<Organization>>;
2159
+ /**
2160
+ * Get a single organization by ID.
2161
+ *
2162
+ * @param organizationId - Organization to retrieve.
2163
+ * @returns The organization.
2164
+ *
2165
+ * @example
2166
+ * ```ts
2167
+ * const org = await client.organizations.get('org-id');
2168
+ * console.log(org.name, org.slug);
2169
+ * ```
2170
+ */
2171
+ get(organizationId: string): Promise<Organization>;
2172
+ /**
2173
+ * Create a new organization.
2174
+ *
2175
+ * Requires a user-backed token with the `platform:organizations:write` scope.
2176
+ * The authenticated user becomes the organization owner.
2177
+ *
2178
+ * @param input - Organization creation input.
2179
+ * @returns The created organization.
2180
+ *
2181
+ * @example
2182
+ * ```ts
2183
+ * const org = await client.organizations.create({ name: 'Acme Corp' });
2184
+ * console.log(org.id, org.slug);
2185
+ * ```
2186
+ */
2187
+ create(input: CreateOrganizationInput): Promise<Organization>;
1935
2188
  }
1936
2189
 
1937
2190
  /** A Gigadrive Network application, belonging to an {@link Organization}. */
@@ -2650,4 +2903,4 @@ declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<
2650
2903
  */
2651
2904
  declare function parseSSEStream<T = unknown>(response: Response): AsyncGenerator<T>;
2652
2905
 
2653
- export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, paginate, parseSSEStream };
2906
+ export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateOrganizationInput, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, type OrganizationMember, OrganizationMembersResource, type OrganizationMembershipRole, type OrganizationProductAccess, type OrganizationProductEntitlement, type OrganizationProductEntitlementCheck, type OrganizationProductSubscription, OrganizationProductsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProductAccessMode, type ProductAccessResolutionSource, type ProductDefaultAccessPolicy, type ProductDefinition, type ProductEntitlementStatus, type ProductPlan, type ProductSubscriptionStatus, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, paginate, parseSSEStream };
package/dist/index.d.ts CHANGED
@@ -1865,6 +1865,204 @@ declare class OrganizationEnvVarsResource extends BaseResource {
1865
1865
  delete(organizationId: string, envVarId: string): Promise<void>;
1866
1866
  }
1867
1867
 
1868
+ /** Organization membership role used for administration privileges. */
1869
+ type OrganizationMembershipRole = 'OWNER' | 'ADMIN' | 'MEMBER';
1870
+ /** A user membership in a Gigadrive organization. */
1871
+ interface OrganizationMember {
1872
+ /** Unique membership identifier (UUID). */
1873
+ membershipId: string;
1874
+ /** Organization that owns this membership. */
1875
+ organizationId: string;
1876
+ /** User who belongs to the organization. */
1877
+ userId: string;
1878
+ /** Email address of the organization member. */
1879
+ email: string;
1880
+ /** Given name of the organization member, or null when unset. */
1881
+ givenName: string | null;
1882
+ /** Family name of the organization member, or null when unset. */
1883
+ familyName: string | null;
1884
+ /** Avatar URL for the organization member, or null when unset. */
1885
+ imageUrl: string | null;
1886
+ /** Organization membership role. */
1887
+ role: OrganizationMembershipRole;
1888
+ /** ISO 8601 timestamp when the user joined the organization. */
1889
+ joinedAt: string;
1890
+ }
1891
+ /**
1892
+ * List organization members. Accessed via {@link OrganizationsResource.members}.
1893
+ *
1894
+ * @example
1895
+ * ```ts
1896
+ * const { items } = await client.organizations.members.list('org-id');
1897
+ * console.log(items.map((m) => `${m.email} (${m.role})`));
1898
+ * ```
1899
+ */
1900
+ declare class OrganizationMembersResource extends BaseResource {
1901
+ /**
1902
+ * List the users who belong to an organization.
1903
+ *
1904
+ * @param organizationId - Organization whose members should be listed.
1905
+ * @param query - Optional pagination.
1906
+ * @returns A paginated list of organization members.
1907
+ *
1908
+ * @example
1909
+ * ```ts
1910
+ * const { items, total } = await client.organizations.members.list('org-id');
1911
+ * console.log(`Found ${total} members`);
1912
+ * ```
1913
+ */
1914
+ list(organizationId: string, query?: ListQuery): Promise<Paginated<OrganizationMember>>;
1915
+ }
1916
+
1917
+ /** Product access mode from the code-defined product registry. */
1918
+ type ProductAccessMode = 'organization' | 'user';
1919
+ /** Fallback access policy when no explicit entitlement override exists. */
1920
+ type ProductDefaultAccessPolicy = 'granted' | 'explicit_entitlement_required';
1921
+ /** Lifecycle status of an explicit product entitlement override. */
1922
+ type ProductEntitlementStatus = 'ACTIVE' | 'SUSPENDED' | 'REVOKED';
1923
+ /** Lifecycle status of a local organization product subscription. */
1924
+ type ProductSubscriptionStatus = 'ACTIVE' | 'CANCELED';
1925
+ /** Whether effective access was resolved from an override or the registry default. */
1926
+ type ProductAccessResolutionSource = 'explicit' | 'default';
1927
+ /** A plan defined for a product in the product registry. */
1928
+ interface ProductPlan {
1929
+ /** Stable plan slug. */
1930
+ slug: string;
1931
+ /** Human-readable plan name. */
1932
+ displayName: string;
1933
+ /** Short description of the plan. */
1934
+ description: string;
1935
+ }
1936
+ /** Product metadata from the code-defined product registry. */
1937
+ interface ProductDefinition {
1938
+ /** Stable product slug (e.g. `network`, `office`). */
1939
+ slug: string;
1940
+ /** Human-readable product name. */
1941
+ displayName: string;
1942
+ /** Whether the product is granted to organizations or directly to users. */
1943
+ accessMode: ProductAccessMode;
1944
+ /** Fallback access policy when no explicit entitlement override exists. */
1945
+ defaultAccessPolicy: ProductDefaultAccessPolicy;
1946
+ /** Locally activatable plans for the product. */
1947
+ plans: ProductPlan[];
1948
+ }
1949
+ /** Explicit organization product entitlement override. */
1950
+ interface OrganizationProductEntitlement {
1951
+ /** Unique identifier (UUID). */
1952
+ id: string;
1953
+ /** Product slug this entitlement applies to. */
1954
+ product: string;
1955
+ /** Lifecycle status of the override. */
1956
+ status: ProductEntitlementStatus;
1957
+ /** User who last granted or updated the override, if known. */
1958
+ grantedByUserId: string | null;
1959
+ /** ISO 8601 timestamp when the entitlement was revoked, if revoked. */
1960
+ revokedAt: string | null;
1961
+ /** ISO 8601 creation timestamp. */
1962
+ createdAt: string;
1963
+ /** ISO 8601 last-updated timestamp. */
1964
+ updatedAt: string;
1965
+ }
1966
+ /** Local organization product subscription / plan selection. */
1967
+ interface OrganizationProductSubscription {
1968
+ /** Unique identifier (UUID). */
1969
+ id: string;
1970
+ /** Product slug this subscription applies to. */
1971
+ product: string;
1972
+ /** Currently selected plan slug. */
1973
+ plan: string;
1974
+ /** Local subscription lifecycle status. */
1975
+ status: ProductSubscriptionStatus;
1976
+ /** User who activated the current plan, if known. */
1977
+ activatedByUserId: string | null;
1978
+ /** ISO 8601 creation timestamp. */
1979
+ createdAt: string;
1980
+ /** ISO 8601 last-updated timestamp. */
1981
+ updatedAt: string;
1982
+ }
1983
+ /** Effective product access summary for an organization-scoped product. */
1984
+ interface OrganizationProductAccess {
1985
+ /** Product metadata from the registry. */
1986
+ product: ProductDefinition;
1987
+ /** Whether the organization currently has effective access. */
1988
+ hasAccess: boolean;
1989
+ /** Whether access was resolved from an explicit override or the default policy. */
1990
+ resolutionSource: ProductAccessResolutionSource;
1991
+ /** Explicit entitlement override when one exists. */
1992
+ explicitEntitlement: OrganizationProductEntitlement | null;
1993
+ /** Local product subscription when one exists. */
1994
+ subscription: OrganizationProductSubscription | null;
1995
+ }
1996
+ /** Compact yes/no entitlement check for an organization product. */
1997
+ interface OrganizationProductEntitlementCheck {
1998
+ /** Organization that was checked. */
1999
+ organizationId: string;
2000
+ /** Product slug that was checked. */
2001
+ product: string;
2002
+ /** Whether the organization currently has effective access. */
2003
+ hasAccess: boolean;
2004
+ }
2005
+ /**
2006
+ * Inspect organization product access / entitlements.
2007
+ *
2008
+ * Accessed via {@link OrganizationsResource.products}.
2009
+ *
2010
+ * Subscriptions are read-only through the public API — plan changes happen in
2011
+ * Gigadrive product surfaces, not via the SDK.
2012
+ *
2013
+ * @example
2014
+ * ```ts
2015
+ * const { items } = await client.organizations.products.list('org-id');
2016
+ * const check = await client.organizations.products.checkEntitlement('org-id', 'office');
2017
+ * console.log(check.hasAccess);
2018
+ * ```
2019
+ */
2020
+ declare class OrganizationProductsResource extends BaseResource {
2021
+ /**
2022
+ * List effective product access for every organization-scoped product.
2023
+ *
2024
+ * @param organizationId - Organization whose product access should be listed.
2025
+ * @param query - Optional pagination.
2026
+ * @returns A paginated list of product access summaries.
2027
+ *
2028
+ * @example
2029
+ * ```ts
2030
+ * const { items } = await client.organizations.products.list('org-id');
2031
+ * for (const item of items) {
2032
+ * console.log(item.product.slug, item.hasAccess);
2033
+ * }
2034
+ * ```
2035
+ */
2036
+ list(organizationId: string, query?: ListQuery): Promise<Paginated<OrganizationProductAccess>>;
2037
+ /**
2038
+ * Get effective access for one organization-scoped product.
2039
+ *
2040
+ * @param organizationId - Organization to inspect.
2041
+ * @param product - Product slug from the product registry.
2042
+ * @returns Product access summary including entitlement and subscription state.
2043
+ *
2044
+ * @example
2045
+ * ```ts
2046
+ * const access = await client.organizations.products.get('org-id', 'office');
2047
+ * console.log(access.hasAccess, access.subscription?.plan);
2048
+ * ```
2049
+ */
2050
+ get(organizationId: string, product: string): Promise<OrganizationProductAccess>;
2051
+ /**
2052
+ * Check whether an organization currently has access to a product.
2053
+ *
2054
+ * @param organizationId - Organization to check.
2055
+ * @param product - Product slug from the product registry.
2056
+ * @returns Compact entitlement check result.
2057
+ *
2058
+ * @example
2059
+ * ```ts
2060
+ * const { hasAccess } = await client.organizations.products.checkEntitlement('org-id', 'network');
2061
+ * ```
2062
+ */
2063
+ checkEntitlement(organizationId: string, product: string): Promise<OrganizationProductEntitlementCheck>;
2064
+ }
2065
+
1868
2066
  /** A Gigadrive Network organization. */
1869
2067
  interface Organization {
1870
2068
  /** Unique identifier (UUID). */
@@ -1880,6 +2078,13 @@ interface Organization {
1880
2078
  /** ISO 8601 last-updated timestamp. */
1881
2079
  updatedAt: string;
1882
2080
  }
2081
+ /** Input for creating an organization. */
2082
+ interface CreateOrganizationInput {
2083
+ /** Display name for the new organization. */
2084
+ name: string;
2085
+ /** Optional URL-safe slug. Generated from the name when omitted. */
2086
+ slug?: string;
2087
+ }
1883
2088
  /**
1884
2089
  * Manage organizations. Accessed via {@link GigadriveClient.organizations}.
1885
2090
  *
@@ -1918,6 +2123,25 @@ declare class OrganizationsResource extends BaseResource {
1918
2123
  * ```
1919
2124
  */
1920
2125
  readonly aiGateway: OrganizationAiGatewayResource;
2126
+ /**
2127
+ * List organization members and membership roles.
2128
+ *
2129
+ * @example
2130
+ * ```ts
2131
+ * const { items } = await client.organizations.members.list('org-id');
2132
+ * ```
2133
+ */
2134
+ readonly members: OrganizationMembersResource;
2135
+ /**
2136
+ * Inspect organization product entitlements. Read-only through the public
2137
+ * API — plan changes happen in Gigadrive product surfaces, not via the SDK.
2138
+ *
2139
+ * @example
2140
+ * ```ts
2141
+ * const check = await client.organizations.products.checkEntitlement('org-id', 'office');
2142
+ * ```
2143
+ */
2144
+ readonly products: OrganizationProductsResource;
1921
2145
  constructor(...args: ConstructorParameters<typeof BaseResource>);
1922
2146
  /**
1923
2147
  * List organizations the authenticated actor has access to.
@@ -1932,6 +2156,35 @@ declare class OrganizationsResource extends BaseResource {
1932
2156
  * ```
1933
2157
  */
1934
2158
  list(query?: ListQuery): Promise<Paginated<Organization>>;
2159
+ /**
2160
+ * Get a single organization by ID.
2161
+ *
2162
+ * @param organizationId - Organization to retrieve.
2163
+ * @returns The organization.
2164
+ *
2165
+ * @example
2166
+ * ```ts
2167
+ * const org = await client.organizations.get('org-id');
2168
+ * console.log(org.name, org.slug);
2169
+ * ```
2170
+ */
2171
+ get(organizationId: string): Promise<Organization>;
2172
+ /**
2173
+ * Create a new organization.
2174
+ *
2175
+ * Requires a user-backed token with the `platform:organizations:write` scope.
2176
+ * The authenticated user becomes the organization owner.
2177
+ *
2178
+ * @param input - Organization creation input.
2179
+ * @returns The created organization.
2180
+ *
2181
+ * @example
2182
+ * ```ts
2183
+ * const org = await client.organizations.create({ name: 'Acme Corp' });
2184
+ * console.log(org.id, org.slug);
2185
+ * ```
2186
+ */
2187
+ create(input: CreateOrganizationInput): Promise<Organization>;
1935
2188
  }
1936
2189
 
1937
2190
  /** A Gigadrive Network application, belonging to an {@link Organization}. */
@@ -2650,4 +2903,4 @@ declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<
2650
2903
  */
2651
2904
  declare function parseSSEStream<T = unknown>(response: Response): AsyncGenerator<T>;
2652
2905
 
2653
- export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, paginate, parseSSEStream };
2906
+ export { AiGatewayAudioResource, type AiGatewayBudget, type AiGatewayBudgetInput, AiGatewayBudgetsResource, AiGatewayPoliciesResource, type AiGatewayPolicy, type AiGatewayPolicyInput, type AiGatewayProviderAttempt, type AiGatewayRequestEvent, type AiGatewayRequestsQuery, AiGatewayResource, type AiGatewayUsageBreakdown, type AiGatewayUsageQuery, AiGatewayUsageResource, type AiGatewayUsageSummary, AiGatewayVideosResource, type AiModel, type AiModelCapabilities, type AiModelRoutingProvider, ApiError, type ApiKey, ApiKeysResource, type Application, ApplicationEnvVarsResource, type ApplicationHostnameList, ApplicationRequestsResource, ApplicationStorageResource, ApplicationsResource, AuthenticationError, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionContentPart, type ChatCompletionMessage, type ChatCompletionRequest, type ChatCompletionResponse, type ChatCompletionUsage, type CreateApiKeyInput, type CreateApiKeyResult, type CreateDeploymentInput, type CreateEnvVarInput, type CreateOrganizationInput, type CreateStorageBucketInput, type CreateUploadSessionInput, type CreateUploadSessionResponse, type Deployment, type DeploymentLog, type DeploymentLogPage, type DeploymentLogType, type DeploymentStatus, DeploymentsResource, type EnvVar, type GatewayRequestOptions, type GatewayResult, GigadriveClient, type GigadriveClientConfig, GigadriveError, type Hostname, type HostnameAvailability, type ListApiKeysQuery, type ListApplicationsQuery, type ListDeploymentLogsQuery, type ListDeploymentsQuery, type ListQuery, type ListRequestsQuery, type ListStorageObjectsQuery, type NetworkRequest, type NetworkRequestApplicationRef, type NetworkRequestAssetRef, type NetworkRequestBucketRef, type NetworkRequestDeploymentRef, type NetworkRequestDetails, type NetworkRequestFunctionRef, type NetworkRequestMetrics, type NetworkRequestObjectRef, type NetworkRequestSummary, type NetworkResponseDetails, type NodeReadableLike, type Organization, OrganizationAiGatewayResource, OrganizationEnvVarsResource, type OrganizationMember, OrganizationMembersResource, type OrganizationMembershipRole, type OrganizationProductAccess, type OrganizationProductEntitlement, type OrganizationProductEntitlementCheck, type OrganizationProductSubscription, OrganizationProductsResource, OrganizationsResource, type Paginated, type PresignedUrlResult, type ProductAccessMode, type ProductAccessResolutionSource, type ProductDefaultAccessPolicy, type ProductDefinition, type ProductEntitlementStatus, type ProductPlan, type ProductSubscriptionStatus, type ProviderRouting, type PullEnvVarsQuery, type PullEnvVarsResult, type QueryValue, type ResolvedEnvVar, type ResponsesRequest, type ResponsesResponse, type RunUploadOptions, type SetProductionHostnameResult, type SpeechRequest, type StartUploadResult, type StorageBucket, StorageBucketsResource, type StorageObject, type StorageObjectAccess, type StorageObjectList, StorageObjectsResource, type StorageUploadSession, StorageUploadSessionsResource, type TranscriptionRequest, type TranscriptionResponse, type UpdateEnvVarInput, type UploadBatchItemResult, type UploadBatchOptions, type UploadByteSource, type UploadData, UploadError, type UploadFileInput, type UploadFileResult, type UploadPart, UploadSessionExpiredError, type UploadUrlStorage, type VideoGenerationRequest, type VideoGenerationResponse, type VideoModelList, type WaitForCompletionOptions, paginate, parseSSEStream };