@tinycloud/sdk-services 2.0.4 → 2.1.0-beta.1
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/{BaseService-D9BFm_rV.d.cts → BaseService-BiS6HRwE.d.cts} +18 -1
- package/dist/{BaseService-D9BFm_rV.d.ts → BaseService-BiS6HRwE.d.ts} +18 -1
- package/dist/index.cjs +686 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -3
- package/dist/index.d.ts +100 -3
- package/dist/index.js +685 -0
- package/dist/index.js.map +1 -1
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/index.d.cts +1 -1
- package/dist/kv/index.d.ts +1 -1
- package/dist/kv/index.js.map +1 -1
- package/dist/sql/index.cjs.map +1 -1
- package/dist/sql/index.d.cts +1 -1
- package/dist/sql/index.d.ts +1 -1
- package/dist/sql/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -133,6 +133,20 @@ type InvocationFacts = InvocationFact[];
|
|
|
133
133
|
* @returns Headers to include in the request
|
|
134
134
|
*/
|
|
135
135
|
type InvokeFunction = (session: ServiceSession, service: string, path: string, action: string, facts?: InvocationFacts) => ServiceHeaders;
|
|
136
|
+
/**
|
|
137
|
+
* Multi-resource invocation entry.
|
|
138
|
+
*/
|
|
139
|
+
interface InvokeAnyEntry {
|
|
140
|
+
spaceId: string;
|
|
141
|
+
service: string;
|
|
142
|
+
path: string;
|
|
143
|
+
action: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Invoke function for minting a single authorization header that covers
|
|
147
|
+
* multiple capabilities across one effective invoker.
|
|
148
|
+
*/
|
|
149
|
+
type InvokeAnyFunction = (session: ServiceSession, entries: InvokeAnyEntry[], facts?: InvocationFacts) => ServiceHeaders;
|
|
136
150
|
/**
|
|
137
151
|
* Fetch request options - compatible with standard fetch API.
|
|
138
152
|
*/
|
|
@@ -149,6 +163,7 @@ interface FetchResponse {
|
|
|
149
163
|
ok: boolean;
|
|
150
164
|
status: number;
|
|
151
165
|
statusText: string;
|
|
166
|
+
body?: unknown;
|
|
152
167
|
headers: {
|
|
153
168
|
get(name: string): string | null;
|
|
154
169
|
};
|
|
@@ -209,6 +224,8 @@ interface IServiceContext {
|
|
|
209
224
|
readonly isAuthenticated: boolean;
|
|
210
225
|
/** Platform-specific invoke function from WASM binding */
|
|
211
226
|
readonly invoke: InvokeFunction;
|
|
227
|
+
/** Optional multi-resource invoke function */
|
|
228
|
+
readonly invokeAny?: InvokeAnyFunction;
|
|
212
229
|
/** Fetch function (defaults to globalThis.fetch) */
|
|
213
230
|
readonly fetch: FetchFunction;
|
|
214
231
|
/** Available TinyCloud host URLs */
|
|
@@ -437,4 +454,4 @@ declare abstract class BaseService implements IService {
|
|
|
437
454
|
protected withTelemetry<T>(action: string, key: string | undefined, operation: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
438
455
|
}
|
|
439
456
|
|
|
440
|
-
export { BaseService as B, type ErrorCode as E, type FetchFunction as F, type IServiceContext as I, type RetryPolicy as R, type ServiceSession as S, TelemetryEvents as T, type InvokeFunction as a, type
|
|
457
|
+
export { BaseService as B, type ErrorCode as E, type FetchFunction as F, type IServiceContext as I, type RetryPolicy as R, type ServiceSession as S, TelemetryEvents as T, type InvokeFunction as a, type InvokeAnyFunction as b, type IService as c, type ServiceError as d, type Result as e, type StorageQuotaInfo as f, ErrorCodes as g, type EventHandler as h, type FetchRequestInit as i, type FetchResponse as j, type InvocationFact as k, type InvocationFacts as l, type InvokeAnyEntry as m, type ServiceErrorEvent as n, type ServiceHeaders as o, type ServiceRequestEvent as p, type ServiceResponseEvent as q, type ServiceRetryEvent as r, defaultRetryPolicy as s, err as t, ok as u, serviceError as v };
|
|
@@ -133,6 +133,20 @@ type InvocationFacts = InvocationFact[];
|
|
|
133
133
|
* @returns Headers to include in the request
|
|
134
134
|
*/
|
|
135
135
|
type InvokeFunction = (session: ServiceSession, service: string, path: string, action: string, facts?: InvocationFacts) => ServiceHeaders;
|
|
136
|
+
/**
|
|
137
|
+
* Multi-resource invocation entry.
|
|
138
|
+
*/
|
|
139
|
+
interface InvokeAnyEntry {
|
|
140
|
+
spaceId: string;
|
|
141
|
+
service: string;
|
|
142
|
+
path: string;
|
|
143
|
+
action: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Invoke function for minting a single authorization header that covers
|
|
147
|
+
* multiple capabilities across one effective invoker.
|
|
148
|
+
*/
|
|
149
|
+
type InvokeAnyFunction = (session: ServiceSession, entries: InvokeAnyEntry[], facts?: InvocationFacts) => ServiceHeaders;
|
|
136
150
|
/**
|
|
137
151
|
* Fetch request options - compatible with standard fetch API.
|
|
138
152
|
*/
|
|
@@ -149,6 +163,7 @@ interface FetchResponse {
|
|
|
149
163
|
ok: boolean;
|
|
150
164
|
status: number;
|
|
151
165
|
statusText: string;
|
|
166
|
+
body?: unknown;
|
|
152
167
|
headers: {
|
|
153
168
|
get(name: string): string | null;
|
|
154
169
|
};
|
|
@@ -209,6 +224,8 @@ interface IServiceContext {
|
|
|
209
224
|
readonly isAuthenticated: boolean;
|
|
210
225
|
/** Platform-specific invoke function from WASM binding */
|
|
211
226
|
readonly invoke: InvokeFunction;
|
|
227
|
+
/** Optional multi-resource invoke function */
|
|
228
|
+
readonly invokeAny?: InvokeAnyFunction;
|
|
212
229
|
/** Fetch function (defaults to globalThis.fetch) */
|
|
213
230
|
readonly fetch: FetchFunction;
|
|
214
231
|
/** Available TinyCloud host URLs */
|
|
@@ -437,4 +454,4 @@ declare abstract class BaseService implements IService {
|
|
|
437
454
|
protected withTelemetry<T>(action: string, key: string | undefined, operation: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
438
455
|
}
|
|
439
456
|
|
|
440
|
-
export { BaseService as B, type ErrorCode as E, type FetchFunction as F, type IServiceContext as I, type RetryPolicy as R, type ServiceSession as S, TelemetryEvents as T, type InvokeFunction as a, type
|
|
457
|
+
export { BaseService as B, type ErrorCode as E, type FetchFunction as F, type IServiceContext as I, type RetryPolicy as R, type ServiceSession as S, TelemetryEvents as T, type InvokeFunction as a, type InvokeAnyFunction as b, type IService as c, type ServiceError as d, type Result as e, type StorageQuotaInfo as f, ErrorCodes as g, type EventHandler as h, type FetchRequestInit as i, type FetchResponse as j, type InvocationFact as k, type InvocationFacts as l, type InvokeAnyEntry as m, type ServiceErrorEvent as n, type ServiceHeaders as o, type ServiceRequestEvent as p, type ServiceResponseEvent as q, type ServiceRetryEvent as r, defaultRetryPolicy as s, err as t, ok as u, serviceError as v };
|