@gpt-platform/client 0.10.5 → 0.11.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/_internal/client/client.gen.d.ts +3 -0
- package/dist/_internal/client/client.gen.d.ts.map +1 -0
- package/dist/_internal/client/index.d.ts +9 -0
- package/dist/_internal/client/index.d.ts.map +1 -0
- package/dist/_internal/client/types.gen.d.ts +118 -0
- package/dist/_internal/client/types.gen.d.ts.map +1 -0
- package/dist/_internal/client/utils.gen.d.ts +34 -0
- package/dist/_internal/client/utils.gen.d.ts.map +1 -0
- package/dist/_internal/client.gen.d.ts +13 -0
- package/dist/_internal/client.gen.d.ts.map +1 -0
- package/dist/_internal/core/auth.gen.d.ts +19 -0
- package/dist/_internal/core/auth.gen.d.ts.map +1 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts +26 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/params.gen.d.ts +44 -0
- package/dist/_internal/core/params.gen.d.ts.map +1 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts +34 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/_internal/core/types.gen.d.ts +79 -0
- package/dist/_internal/core/types.gen.d.ts.map +1 -0
- package/dist/_internal/core/utils.gen.d.ts +20 -0
- package/dist/_internal/core/utils.gen.d.ts.map +1 -0
- package/dist/_internal/index.d.ts +3 -0
- package/dist/_internal/index.d.ts.map +1 -0
- package/dist/_internal/sdk.gen.d.ts +7053 -0
- package/dist/_internal/sdk.gen.d.ts.map +1 -0
- package/dist/_internal/types.gen.d.ts +146633 -0
- package/dist/_internal/types.gen.d.ts.map +1 -0
- package/dist/base-client.d.ts +199 -0
- package/dist/base-client.d.ts.map +1 -0
- package/dist/errors/index.d.ts +128 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/events.d.ts +69 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/execution-events.d.ts +95 -0
- package/dist/execution-events.d.ts.map +1 -0
- package/dist/gpt-client.d.ts +2175 -0
- package/dist/gpt-client.d.ts.map +1 -0
- package/dist/index.d.ts +51 -30734
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +311 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +311 -4
- package/dist/index.mjs.map +1 -1
- package/dist/json-api.d.ts +26 -0
- package/dist/json-api.d.ts.map +1 -0
- package/dist/logging.d.ts +22 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/namespace-types.d.ts +79 -0
- package/dist/namespace-types.d.ts.map +1 -0
- package/dist/namespaces/access-grants.d.ts +71 -0
- package/dist/namespaces/access-grants.d.ts.map +1 -0
- package/dist/namespaces/agents.d.ts +1406 -0
- package/dist/namespaces/agents.d.ts.map +1 -0
- package/dist/namespaces/ai.d.ts +407 -0
- package/dist/namespaces/ai.d.ts.map +1 -0
- package/dist/namespaces/audit.d.ts +83 -0
- package/dist/namespaces/audit.d.ts.map +1 -0
- package/dist/namespaces/billing.d.ts +854 -0
- package/dist/namespaces/billing.d.ts.map +1 -0
- package/dist/namespaces/campaigns.d.ts +973 -0
- package/dist/namespaces/campaigns.d.ts.map +1 -0
- package/dist/namespaces/catalog.d.ts +964 -0
- package/dist/namespaces/catalog.d.ts.map +1 -0
- package/dist/namespaces/channels.d.ts +162 -0
- package/dist/namespaces/channels.d.ts.map +1 -0
- package/dist/namespaces/clinical.d.ts +2443 -0
- package/dist/namespaces/clinical.d.ts.map +1 -0
- package/dist/namespaces/communication.d.ts +439 -0
- package/dist/namespaces/communication.d.ts.map +1 -0
- package/dist/namespaces/compliance.d.ts +2310 -0
- package/dist/namespaces/compliance.d.ts.map +1 -0
- package/dist/namespaces/connectors.d.ts +1368 -0
- package/dist/namespaces/connectors.d.ts.map +1 -0
- package/dist/namespaces/content.d.ts +188 -0
- package/dist/namespaces/content.d.ts.map +1 -0
- package/dist/namespaces/crawler.d.ts +408 -0
- package/dist/namespaces/crawler.d.ts.map +1 -0
- package/dist/namespaces/crm-clusters.d.ts +31 -0
- package/dist/namespaces/crm-clusters.d.ts.map +1 -0
- package/dist/namespaces/crm.d.ts +1539 -0
- package/dist/namespaces/crm.d.ts.map +1 -0
- package/dist/namespaces/documents.d.ts +136 -0
- package/dist/namespaces/documents.d.ts.map +1 -0
- package/dist/namespaces/email.d.ts +550 -0
- package/dist/namespaces/email.d.ts.map +1 -0
- package/dist/namespaces/extraction.d.ts +1249 -0
- package/dist/namespaces/extraction.d.ts.map +1 -0
- package/dist/namespaces/identity.d.ts +411 -0
- package/dist/namespaces/identity.d.ts.map +1 -0
- package/dist/namespaces/imports.d.ts +177 -0
- package/dist/namespaces/imports.d.ts.map +1 -0
- package/dist/namespaces/index.d.ts +119 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/memory.d.ts +105 -0
- package/dist/namespaces/memory.d.ts.map +1 -0
- package/dist/namespaces/models.d.ts +75 -0
- package/dist/namespaces/models.d.ts.map +1 -0
- package/dist/namespaces/permissions.d.ts +75 -0
- package/dist/namespaces/permissions.d.ts.map +1 -0
- package/dist/namespaces/pipeline-executions.d.ts +130 -0
- package/dist/namespaces/pipeline-executions.d.ts.map +1 -0
- package/dist/namespaces/pipelines.d.ts +120 -0
- package/dist/namespaces/pipelines.d.ts.map +1 -0
- package/dist/namespaces/platform.d.ts +1430 -0
- package/dist/namespaces/platform.d.ts.map +1 -0
- package/dist/namespaces/portal.d.ts +198 -0
- package/dist/namespaces/portal.d.ts.map +1 -0
- package/dist/namespaces/projects.d.ts +553 -0
- package/dist/namespaces/projects.d.ts.map +1 -0
- package/dist/namespaces/roles.d.ts +65 -0
- package/dist/namespaces/roles.d.ts.map +1 -0
- package/dist/namespaces/scheduling.d.ts +944 -0
- package/dist/namespaces/scheduling.d.ts.map +1 -0
- package/dist/namespaces/search.d.ts +224 -0
- package/dist/namespaces/search.d.ts.map +1 -0
- package/dist/namespaces/session-notes.d.ts +67 -0
- package/dist/namespaces/session-notes.d.ts.map +1 -0
- package/dist/namespaces/social.d.ts +330 -0
- package/dist/namespaces/social.d.ts.map +1 -0
- package/dist/namespaces/storage.d.ts +378 -0
- package/dist/namespaces/storage.d.ts.map +1 -0
- package/dist/namespaces/support.d.ts +427 -0
- package/dist/namespaces/support.d.ts.map +1 -0
- package/dist/namespaces/threads.d.ts +596 -0
- package/dist/namespaces/threads.d.ts.map +1 -0
- package/dist/namespaces/training.d.ts +358 -0
- package/dist/namespaces/training.d.ts.map +1 -0
- package/dist/namespaces/voice.d.ts +752 -0
- package/dist/namespaces/voice.d.ts.map +1 -0
- package/dist/namespaces/watcher.d.ts +425 -0
- package/dist/namespaces/watcher.d.ts.map +1 -0
- package/dist/namespaces/webhooks-ns.d.ts +3 -0
- package/dist/namespaces/webhooks-ns.d.ts.map +1 -0
- package/dist/pagination.d.ts +57 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/request-builder.d.ts +95 -0
- package/dist/request-builder.d.ts.map +1 -0
- package/dist/security.d.ts +32 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/streaming.d.ts +135 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +63 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/webhook-signature.d.ts +109 -0
- package/dist/webhook-signature.d.ts.map +1 -0
- package/llms.txt +7 -1
- package/package.json +286 -36
- package/dist/index.d.mts +0 -30734
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility type for JSON:API resource flattening.
|
|
3
|
+
*
|
|
4
|
+
* The SDK runtime unwraps JSON:API envelopes via `flattenResource()`:
|
|
5
|
+
* { id, type, attributes: { a, b }, relationships: { r } } → { id, type, a, b, r }
|
|
6
|
+
*
|
|
7
|
+
* Generated types in `_internal/types.gen.ts` keep the nested envelope shape.
|
|
8
|
+
* `FlatResource<T>` mirrors the runtime flattening at the type level so namespace
|
|
9
|
+
* method return types match what callers actually receive.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import type { ClinicalMealPlan } from "./_internal/types.gen";
|
|
14
|
+
* import type { FlatResource } from "./json-api";
|
|
15
|
+
*
|
|
16
|
+
* type MealPlan = FlatResource<ClinicalMealPlan>;
|
|
17
|
+
* // MealPlan.status works directly — no .attributes?.status
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export type FlatResource<T> = T extends {
|
|
21
|
+
id: string;
|
|
22
|
+
type: string;
|
|
23
|
+
attributes?: infer A;
|
|
24
|
+
relationships?: infer R;
|
|
25
|
+
} ? Omit<T, "attributes" | "relationships"> & (NonNullable<A> extends Record<string, unknown> ? NonNullable<A> : {}) & (NonNullable<R> extends Record<string, unknown> ? NonNullable<R> : {}) : T;
|
|
26
|
+
//# sourceMappingURL=json-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-api.d.ts","sourceRoot":"","sources":["../src/json-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;CACzB,GACG,IAAI,CAAC,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC,GACrC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GACtE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GACxE,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Logger interface matching console API */
|
|
2
|
+
export interface Logger {
|
|
3
|
+
debug: (...args: unknown[]) => void;
|
|
4
|
+
info: (...args: unknown[]) => void;
|
|
5
|
+
warn: (...args: unknown[]) => void;
|
|
6
|
+
error: (...args: unknown[]) => void;
|
|
7
|
+
}
|
|
8
|
+
/** Log levels */
|
|
9
|
+
export type LogLevel = "debug" | "info" | "warn" | "error" | "none";
|
|
10
|
+
/** Log level priority for comparison */
|
|
11
|
+
export declare const LOG_LEVELS: Record<LogLevel, number>;
|
|
12
|
+
/**
|
|
13
|
+
* Build User-Agent string.
|
|
14
|
+
* @param sdkVersion - SDK version string (e.g., "0.1.1")
|
|
15
|
+
* @param appInfo - Optional application info for platform integrators
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildUserAgent(sdkVersion: string, appInfo?: {
|
|
18
|
+
name: string;
|
|
19
|
+
version?: string;
|
|
20
|
+
url?: string;
|
|
21
|
+
}): string;
|
|
22
|
+
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACrC;AAED,iBAAiB;AACjB,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,wCAAwC;AACxC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAM/C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACzD,MAAM,CAQR"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type utilities for namespace implementations.
|
|
3
|
+
* These types bridge the gap between our ergonomic namespace APIs
|
|
4
|
+
* and the OpenAPI-generated generic types.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* JSON:API page parameter structure
|
|
8
|
+
*/
|
|
9
|
+
export type JsonApiPageParams = {
|
|
10
|
+
number?: number;
|
|
11
|
+
size?: number;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* JSON:API query parameters with pagination
|
|
16
|
+
*/
|
|
17
|
+
export type JsonApiQueryWithPage = {
|
|
18
|
+
query: {
|
|
19
|
+
page?: JsonApiPageParams;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* JSON:API data envelope for POST/PATCH requests
|
|
26
|
+
*/
|
|
27
|
+
export type JsonApiDataEnvelope<T extends string = string> = {
|
|
28
|
+
data: {
|
|
29
|
+
type: T;
|
|
30
|
+
attributes: Record<string, unknown>;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* JSON:API body parameter
|
|
37
|
+
*/
|
|
38
|
+
export type JsonApiBody<T extends string = string> = {
|
|
39
|
+
body: JsonApiDataEnvelope<T>;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Empty body (for endpoints that require a body but no data)
|
|
44
|
+
*/
|
|
45
|
+
export type EmptyBody = {
|
|
46
|
+
body: Record<string, never>;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Path parameters
|
|
51
|
+
*/
|
|
52
|
+
export type PathParams = {
|
|
53
|
+
path: Record<string, string>;
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Query parameter dictionary (generic index signature)
|
|
58
|
+
*/
|
|
59
|
+
export type QueryParamDict = {
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* File upload body (File, Blob, or FormData)
|
|
64
|
+
* This is cast as unknown because the OpenAPI generated types expect JSON:API structure,
|
|
65
|
+
* but file uploads use multipart/form-data or binary content.
|
|
66
|
+
*/
|
|
67
|
+
export type FileUploadBody = {
|
|
68
|
+
body: File | Blob | FormData;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Helper to construct query params with page
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildPageQuery(page?: number, pageSize?: number): JsonApiQueryWithPage;
|
|
75
|
+
/**
|
|
76
|
+
* Helper to construct JSON:API body
|
|
77
|
+
*/
|
|
78
|
+
export declare function buildJsonApiBody<T extends string>(type: T, attributes: Record<string, unknown>): JsonApiBody<T>;
|
|
79
|
+
//# sourceMappingURL=namespace-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace-types.d.ts","sourceRoot":"","sources":["../src/namespace-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE;QACL,IAAI,CAAC,EAAE,iBAAiB,CAAC;QACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAC3D,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,CAAC;QACR,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACnD,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,oBAAoB,CAStB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,IAAI,EAAE,CAAC,EACP,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,WAAW,CAAC,CAAC,CAAC,CAShB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { RequestBuilder } from "../request-builder";
|
|
2
|
+
import type { AccessGrant, PostAccessGrantsData, PatchAccessGrantsByIdData } from "../_internal/types.gen";
|
|
3
|
+
export type { AccessGrant };
|
|
4
|
+
export interface AccessGrantListResult {
|
|
5
|
+
data: AccessGrant[];
|
|
6
|
+
meta?: {
|
|
7
|
+
total?: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface AccessGrantResult {
|
|
11
|
+
data: AccessGrant;
|
|
12
|
+
}
|
|
13
|
+
export declare function createAccessGrantsNamespace(rb: RequestBuilder): {
|
|
14
|
+
/**
|
|
15
|
+
* List access grants for the authenticated user's workspace.
|
|
16
|
+
*
|
|
17
|
+
* @param params - Optional filter parameters (subject_id, object_id, object_type, relation)
|
|
18
|
+
* @returns Paginated list of access grants
|
|
19
|
+
* @example
|
|
20
|
+
* const grants = await client.accessGrants.list({ object_id: workspaceId });
|
|
21
|
+
*/
|
|
22
|
+
list(params?: Record<string, string>): Promise<AccessGrantListResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a single access grant by ID.
|
|
25
|
+
*
|
|
26
|
+
* @param id - AccessGrant UUID
|
|
27
|
+
* @returns The access grant record
|
|
28
|
+
* @example
|
|
29
|
+
* const grant = await client.accessGrants.get("grant-uuid");
|
|
30
|
+
*/
|
|
31
|
+
get(id: string): Promise<AccessGrantResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new access grant, giving a subject a relation to an object.
|
|
34
|
+
*
|
|
35
|
+
* @param attrs - Grant attributes (subject_type, subject_id, relation, object_type, object_id)
|
|
36
|
+
* @returns The created access grant
|
|
37
|
+
* @example
|
|
38
|
+
* const grant = await client.accessGrants.create({
|
|
39
|
+
* data: {
|
|
40
|
+
* type: "access-grant",
|
|
41
|
+
* attributes: {
|
|
42
|
+
* subject_type: "user",
|
|
43
|
+
* subject_id: "user-uuid",
|
|
44
|
+
* relation: "workspace_editor",
|
|
45
|
+
* object_type: "workspace",
|
|
46
|
+
* object_id: "workspace-uuid",
|
|
47
|
+
* },
|
|
48
|
+
* },
|
|
49
|
+
* });
|
|
50
|
+
*/
|
|
51
|
+
create(attrs: PostAccessGrantsData["body"]): Promise<AccessGrantResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Update an existing access grant (relation, custom_permissions, expires_at).
|
|
54
|
+
*
|
|
55
|
+
* @param id - AccessGrant UUID
|
|
56
|
+
* @param attrs - Attributes to update
|
|
57
|
+
* @returns The updated access grant
|
|
58
|
+
* @example
|
|
59
|
+
* const updated = await client.accessGrants.update("grant-uuid", { data: { ... } });
|
|
60
|
+
*/
|
|
61
|
+
update(id: string, attrs: PatchAccessGrantsByIdData["body"]): Promise<AccessGrantResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Revoke (delete) an access grant.
|
|
64
|
+
*
|
|
65
|
+
* @param id - AccessGrant UUID
|
|
66
|
+
* @example
|
|
67
|
+
* await client.accessGrants.revoke("grant-uuid");
|
|
68
|
+
*/
|
|
69
|
+
revoke(id: string): Promise<void>;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=access-grants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-grants.d.ts","sourceRoot":"","sources":["../../src/namespaces/access-grants.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,cAAc;IAE1D;;;;;;;OAOG;kBAEQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,qBAAqB,CAAC;IAKjC;;;;;;;OAOG;YACW,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIjD;;;;;;;;;;;;;;;;;;OAkBG;kBAEM,oBAAoB,CAAC,MAAM,CAAC,GAClC,OAAO,CAAC,iBAAiB,CAAC;IAI7B;;;;;;;;OAQG;eAEG,MAAM,SACH,yBAAyB,CAAC,MAAM,CAAC,GACvC,OAAO,CAAC,iBAAiB,CAAC;IAI7B;;;;;;OAMG;eACc,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;EAI1C"}
|