@ossy/sdk 1.25.1 → 1.25.3
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/build/public.index.d.ts
CHANGED
|
@@ -273,4 +273,34 @@ declare class SDK {
|
|
|
273
273
|
makeRequest: <T extends Action>(action: T) => (_payload?: Required<T["payload"]>) => Promise<any>;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Unified interface for all SDK adapters.
|
|
278
|
+
*
|
|
279
|
+
* Adapters translate the generic `dispatch` / `query` calls into
|
|
280
|
+
* concrete operations — direct MongoDB writes (EventStoreAdapter),
|
|
281
|
+
* HTTP calls (HttpAdapter), or an in-memory store (InMemoryAdapter).
|
|
282
|
+
*
|
|
283
|
+
* Action names follow the pattern `{domain}/{verb}`, e.g.:
|
|
284
|
+
* - `workspaces/create`
|
|
285
|
+
* - `resources/create`
|
|
286
|
+
* - `user/join-workspace`
|
|
287
|
+
*
|
|
288
|
+
* Query names follow the same pattern, e.g.:
|
|
289
|
+
* - `workspaces/list`
|
|
290
|
+
* - `resources/list`
|
|
291
|
+
* - `resources/search`
|
|
292
|
+
*/
|
|
293
|
+
interface OssySdkAdapter {
|
|
294
|
+
/**
|
|
295
|
+
* Dispatch a write action. Returns the resulting entity/resource,
|
|
296
|
+
* or null for fire-and-forget operations.
|
|
297
|
+
*/
|
|
298
|
+
dispatch(action: string, payload: Record<string, unknown>): Promise<unknown>;
|
|
299
|
+
/**
|
|
300
|
+
* Execute a read query. Returns the matching data.
|
|
301
|
+
*/
|
|
302
|
+
query(name: string, params?: Record<string, unknown>): Promise<unknown>;
|
|
303
|
+
}
|
|
304
|
+
|
|
276
305
|
export { ApiTokenCreate, ApiTokenGetAll, ApiTokenInvalidate, AuthGetAuthenticatedUser, AuthGetAuthenticatedUserHistory, AuthGetUser, AuthSignIn, AuthSignOff, AuthSignUp, AuthVerifyInvitation, AuthVerifySignIn, ResourceUpdateAccess, ResourcesCreate, ResourcesCreateDirectory, ResourcesGet, ResourcesList, ResourcesMove, ResourcesRemove, ResourcesRename, ResourcesSearch, ResourcesUpdateContent, ResourcesUpload, ResourcesUploadNamedVersion, SDK, UserCurrentGet, UserCurrentGetHistory, UserCurrentUpdate, WorkspacesCreate, WorkspacesCreateApiToken, WorkspacesDisableService, WorkspacesEnableService, WorkspacesGet, WorkspacesGetApiTokens, WorkspacesGetCurrent, WorkspacesGetResourceTemplates, WorkspacesGetUsers, WorkspacesImportResourceTemplates, WorkspacesInviteUser, WorkspacesList };
|
|
306
|
+
export type { OssySdkAdapter };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified interface for all SDK adapters.
|
|
3
|
+
*
|
|
4
|
+
* Adapters translate the generic `dispatch` / `query` calls into
|
|
5
|
+
* concrete operations — direct MongoDB writes (EventStoreAdapter),
|
|
6
|
+
* HTTP calls (HttpAdapter), or an in-memory store (InMemoryAdapter).
|
|
7
|
+
*
|
|
8
|
+
* Action names follow the pattern `{domain}/{verb}`, e.g.:
|
|
9
|
+
* - `workspaces/create`
|
|
10
|
+
* - `resources/create`
|
|
11
|
+
* - `user/join-workspace`
|
|
12
|
+
*
|
|
13
|
+
* Query names follow the same pattern, e.g.:
|
|
14
|
+
* - `workspaces/list`
|
|
15
|
+
* - `resources/list`
|
|
16
|
+
* - `resources/search`
|
|
17
|
+
*/
|
|
18
|
+
export interface OssySdkAdapter {
|
|
19
|
+
/**
|
|
20
|
+
* Dispatch a write action. Returns the resulting entity/resource,
|
|
21
|
+
* or null for fire-and-forget operations.
|
|
22
|
+
*/
|
|
23
|
+
dispatch(action: string, payload: Record<string, unknown>): Promise<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* Execute a read query. Returns the matching data.
|
|
26
|
+
*/
|
|
27
|
+
query(name: string, params?: Record<string, unknown>): Promise<unknown>;
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/sdk",
|
|
3
3
|
"description": "Software Development Kit for interacting with our services",
|
|
4
|
-
"version": "1.25.
|
|
4
|
+
"version": "1.25.3",
|
|
5
5
|
"url": "git://github.com/ossy-se/packages/sdk",
|
|
6
6
|
"source": "src/public.index.ts",
|
|
7
7
|
"main": "build/public.index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ossy/types": "^1.25.
|
|
24
|
+
"@ossy/types": "^1.25.3"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"start": "",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"/build",
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "88840c464266647e040f0b0d51c0bb95b18a056b"
|
|
40
40
|
}
|