@sacms/sdk 0.0.0-stage → 1.1.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.
@@ -0,0 +1,5 @@
1
+ export { SaCMS, SaCMSError } from "./client";
2
+ export type { SaCMSConfig, FindManyParams, FindSingleParams, CollectionResponse, SingleResponse, GraphQLResponse, PaginationMeta, PaginationParams, Filters, FilterOperators, MutateParams, } from "./types";
3
+ export type { SaCMSRegistryShape, EmptyRegistry } from "./generated-types";
4
+ export { AuthClient } from "./auth";
5
+ export type { MemberUser, AuthSession, RegisterParams, RegisterResult, UpdateProfileParams, ChangePasswordParams, ResetPasswordParams, } from "./auth";
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthClient = exports.SaCMSError = exports.SaCMS = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "SaCMS", { enumerable: true, get: function () { return client_1.SaCMS; } });
6
+ Object.defineProperty(exports, "SaCMSError", { enumerable: true, get: function () { return client_1.SaCMSError; } });
7
+ var auth_1 = require("./auth");
8
+ Object.defineProperty(exports, "AuthClient", { enumerable: true, get: function () { return auth_1.AuthClient; } });
@@ -0,0 +1,82 @@
1
+ /** Filter operators supported by the SaCMS API */
2
+ export interface FilterOperators {
3
+ $eq?: string | number | boolean;
4
+ $ne?: string | number | boolean;
5
+ $gt?: string | number;
6
+ $gte?: string | number;
7
+ $lt?: string | number;
8
+ $lte?: string | number;
9
+ $contains?: string;
10
+ $startsWith?: string;
11
+ $endsWith?: string;
12
+ $in?: (string | number)[];
13
+ $notIn?: (string | number)[];
14
+ $null?: boolean;
15
+ $notNull?: boolean;
16
+ }
17
+ export type Filters = Record<string, FilterOperators | string | number | boolean> & {
18
+ $or?: Filters[];
19
+ $and?: Filters[];
20
+ };
21
+ export interface PaginationParams {
22
+ page?: number;
23
+ pageSize?: number;
24
+ }
25
+ export interface FindManyParams {
26
+ filters?: Filters;
27
+ fields?: string[];
28
+ populate?: string[];
29
+ locale?: string;
30
+ sort?: string;
31
+ pagination?: PaginationParams;
32
+ search?: string;
33
+ status?: string;
34
+ }
35
+ export interface FindSingleParams {
36
+ locale?: string;
37
+ }
38
+ export interface PaginationMeta {
39
+ page: number;
40
+ pageSize: number;
41
+ total: number;
42
+ totalPages: number;
43
+ }
44
+ export interface CollectionResponse<T = Record<string, unknown>> {
45
+ data: T[];
46
+ meta: {
47
+ contentType: {
48
+ name: string;
49
+ slug: string;
50
+ };
51
+ pagination: PaginationMeta;
52
+ };
53
+ }
54
+ export interface SingleResponse<T = Record<string, unknown>> {
55
+ data: T;
56
+ meta: {
57
+ singleType: {
58
+ name: string;
59
+ slug: string;
60
+ };
61
+ locale: string;
62
+ };
63
+ }
64
+ export interface GraphQLResponse<T = Record<string, unknown>> {
65
+ data: T;
66
+ errors?: Array<{
67
+ message: string;
68
+ locations?: unknown[];
69
+ path?: string[];
70
+ }>;
71
+ }
72
+ export interface SaCMSConfig {
73
+ baseUrl: string;
74
+ tenant: string;
75
+ token: string;
76
+ locale?: string;
77
+ }
78
+ export interface MutateParams {
79
+ data: Record<string, unknown>;
80
+ locale?: string;
81
+ status?: string;
82
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
- {
2
- "name": "@sacms/sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@sacms/sdk",
3
+ "version": "1.1.0",
4
+ "description": "TypeScript SDK for SaCMS headless CMS",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "sacms-gen": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "clean": "rimraf dist",
15
+ "build": "npm run clean && tsc",
16
+ "dev": "tsc --watch",
17
+ "test": "vitest run",
18
+ "prepublishOnly": "npm run build && npm run test"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "keywords": [
24
+ "sacms",
25
+ "cms",
26
+ "headless",
27
+ "sdk"
28
+ ],
29
+ "license": "MIT",
30
+ "devDependencies": {
31
+ "rimraf": "^5.0.0",
32
+ "typescript": "^5.5.0",
33
+ "vitest": "^2.1.9"
34
+ }
35
+ }