@websolutespa/test 3.0.1 → 4.0.0-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @websolutespa/test
2
2
 
3
+ ## 4.0.0-next.0
4
+
5
+ ### Major Changes
6
+
7
+ - Next: support of the bom-next app package
8
+ - Updated dependencies
9
+ - @websolutespa/bom-core@4.0.0-next.0
10
+
11
+ ## 3.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Fixing: payload exports
16
+
3
17
  ## 3.0.1
4
18
 
5
19
  ### Patch Changes
@@ -0,0 +1,40 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __esm = (fn, res) => function() {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ };
13
+ var __commonJS = (cb, mod) => function() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __export = (target, all) => {
17
+ for (var name in all) __defProp(target, name, {
18
+ get: all[name],
19
+ enumerable: true
20
+ });
21
+ };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
+ key = keys[i];
25
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
26
+ get: ((k) => from[k]).bind(null, key),
27
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
+ });
29
+ }
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
33
+ value: mod,
34
+ enumerable: true
35
+ }) : target, mod));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
+
39
+ //#endregion
40
+ export { __commonJS, __esm, __export, __require, __toCommonJS, __toESM };
@@ -0,0 +1,167 @@
1
+ import { CollectionSlug, Config, JoinQuery, Payload, PopulateType, SanitizedConfig, SelectType, Where } from "payload";
2
+
3
+ //#region src/payload/client.d.ts
4
+ type ValidPath = `/${string}`;
5
+ type FileArg = {
6
+ file?: Omit<File, 'webkitRelativePath'>;
7
+ };
8
+ type RequestQuery = {
9
+ [key: string]: unknown;
10
+ } & {
11
+ depth?: number;
12
+ fallbackLocale?: string;
13
+ joins?: JoinQuery;
14
+ limit?: number;
15
+ locale?: string;
16
+ page?: number;
17
+ populate?: PopulateType;
18
+ select?: SelectType;
19
+ sort?: string;
20
+ where?: Where;
21
+ };
22
+ type RequestOptions = {
23
+ auth?: boolean;
24
+ query?: RequestQuery;
25
+ };
26
+ type ClientRequestOptions = FileArg & RequestInit & RequestOptions;
27
+ type NextRoute = (request: Request, args: {
28
+ params: Promise<{
29
+ slug: string[];
30
+ }>;
31
+ }) => Promise<Response>;
32
+ declare class RestClient {
33
+ private readonly config;
34
+ serverURL: string;
35
+ private token;
36
+ private getRest_;
37
+ private postRest_;
38
+ private putRest_;
39
+ private patchRest_;
40
+ private deleteRest_;
41
+ private postGraphql_;
42
+ constructor(config: SanitizedConfig);
43
+ private getHeaders;
44
+ private getPathParts;
45
+ GET(path: ValidPath, options?: Omit<ClientRequestOptions, 'body' | 'file'>): Promise<Response>;
46
+ POST(path: ValidPath, options?: ClientRequestOptions): Promise<Response>;
47
+ PUT(path: ValidPath, options?: ClientRequestOptions): Promise<Response>;
48
+ PATCH(path: ValidPath, options?: ClientRequestOptions): Promise<Response>;
49
+ DELETE(path: ValidPath, options?: Omit<ClientRequestOptions, 'file'>): Promise<Response>;
50
+ GRAPHQL_POST(options?: Omit<ClientRequestOptions, 'file'>): Promise<Response>;
51
+ get(path: string, options?: Omit<ClientRequestOptions, 'body' | 'file'>): Promise<{
52
+ [key: string]: any;
53
+ }>;
54
+ post(path: string, body: any, options?: ClientRequestOptions): Promise<{
55
+ [key: string]: any;
56
+ }>;
57
+ patch(path: string, body: any, options?: ClientRequestOptions): Promise<{
58
+ [key: string]: any;
59
+ }>;
60
+ delete(path: string, options?: Omit<ClientRequestOptions, 'body' | 'file'>): Promise<{
61
+ [key: string]: any;
62
+ }>;
63
+ getToken(slug?: CollectionSlug, credentials?: {
64
+ email: string;
65
+ password: string;
66
+ }): Promise<string>;
67
+ login({
68
+ slug,
69
+ credentials
70
+ }: {
71
+ slug: string;
72
+ credentials?: {
73
+ email: string;
74
+ password: string;
75
+ };
76
+ }): Promise<{
77
+ [key: string]: any;
78
+ }>;
79
+ }
80
+ //# sourceMappingURL=client.d.ts.map
81
+ //#endregion
82
+ //#region src/payload/config.d.ts
83
+ type TestDatabase = 'mongo' | 'memory';
84
+ type TestConfigOptions = {
85
+ /**
86
+ * Database backing the test payload.
87
+ * - 'mongo' (default): MongoMemoryReplSet + mongooseAdapter, Slate editor.
88
+ * - 'memory': @websolutespa/payload-db-memory, Lexical editor (no replica set, no DATABASE_URL).
89
+ * Defaults to the BOM_TEST_DB environment variable when set.
90
+ */
91
+ db?: TestDatabase;
92
+ };
93
+ declare function getConfig(config: Partial<Config>, options?: TestConfigOptions): Promise<SanitizedConfig>;
94
+ //# sourceMappingURL=config.d.ts.map
95
+ //#endregion
96
+ //#region src/payload/context.d.ts
97
+ /**
98
+ * Local Payload API surface for integration suites that register collections
99
+ * at runtime and therefore cannot use an application's generated schema.
100
+ * It is an intersection with Payload, so it stays assignable to Payload.
101
+ */
102
+ type TestPayload = Payload & {
103
+ create: (options: unknown) => Promise<any>;
104
+ find: (options: unknown) => Promise<any>;
105
+ findByID: (options: unknown) => Promise<any>;
106
+ update: (options: unknown) => Promise<any>;
107
+ };
108
+ type TestContext = {
109
+ payload: TestPayload;
110
+ client: RestClient;
111
+ };
112
+ declare function getContext(userConfig: Partial<Config>, options?: TestConfigOptions): Promise<TestContext>;
113
+ declare function clearContext(context?: TestContext): Promise<void>;
114
+ //# sourceMappingURL=context.d.ts.map
115
+ //#endregion
116
+ //#region src/payload/seed.d.ts
117
+ /**
118
+ * Defaults user roles and endUser roles available on the bowl plugin configuration:
119
+ *
120
+ * admin: user role with super powers.
121
+ * contributor: user role with minor powers.
122
+ * editor: user role with content editing powers.
123
+ * guest: endUser role with application reading capabilities.
124
+ * user: endUser authenticated role with reserved data.
125
+ *
126
+ */
127
+ declare const roles: {
128
+ readonly Admin: "admin";
129
+ readonly Contributor: "contributor";
130
+ readonly Editor: "editor";
131
+ readonly Guest: "guest";
132
+ readonly User: "user";
133
+ };
134
+ declare const users: {
135
+ admin: {
136
+ email: string;
137
+ password: string;
138
+ roles: "admin"[];
139
+ };
140
+ editor: {
141
+ email: string;
142
+ password: string;
143
+ roles: "editor"[];
144
+ };
145
+ api: {
146
+ email: string;
147
+ password: string;
148
+ roles: "guest"[];
149
+ enableAPIKey: boolean;
150
+ apiKey: string;
151
+ };
152
+ };
153
+ declare const endUsers: {
154
+ user: {
155
+ email: string;
156
+ password: string;
157
+ roles: ("guest" | "user")[];
158
+ };
159
+ };
160
+ declare const seedUsers: (payload: TestPayload) => Promise<void>;
161
+ declare const seedEndUsers: (payload: TestPayload) => Promise<void>;
162
+ declare const seed: (payload: TestPayload) => Promise<void>;
163
+ //# sourceMappingURL=seed.d.ts.map
164
+
165
+ //#endregion
166
+ export { ClientRequestOptions, FileArg, NextRoute, RequestOptions, RequestQuery, RestClient, TestConfigOptions, TestContext, TestDatabase, TestPayload, ValidPath, clearContext, endUsers, getConfig, getContext, roles, seed, seedEndUsers, seedUsers, users };
167
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","names":[],"sources":["../../src/payload/client.ts","../../src/payload/config.ts","../../src/payload/context.ts","../../src/payload/seed.ts"],"sourcesContent":[],"mappings":";;;KAMY,SAAA;KAEA,OAAA;EAFA,IAAA,CAAA,EAGH,IAHG,CAGE,IAHO,EAAA,oBAAA,CAAA;AAErB,CAAA;AAAmB,KAIP,YAAA,GAJO;EAAA,CAAA,GACL,EAAA,MAAA,CAAA,EAAA,OAAA;CAAI,GAAA;EAAL,KAAA,CAAA,EAAA,MAAA;EAGD,cAAA,CAAY,EAAA,MAAA;EAAA,KAAA,CAAA,EAKd,SALc;EAAA,KAKd,CAAA,EAAA,MAAA;EAAS,MAIN,CAAA,EAAA,MAAA;EAAY,IACd,CAAA,EAAA,MAAA;EAAU,QAEX,CAAA,EAHG,YAGH;EAAK,MAAA,CAAA,EAFJ,UAEI;EAGH,IAAA,CAAA,EAAA,MAAA;EAKA,KAAA,CAAA,EARF,KAQE;CAAoB;AAAG,KALvB,cAAA,GAKuB;EAAO,IAAG,CAAA,EAAA,OAAA;EAAW,KAAG,CAAA,EAHjD,YAGiD;AAAc,CAAA;AAE7D,KAFA,oBAAA,GAAuB,OAEd,GAFwB,WAExB,GAFsC,cAEtC;AAAA,KAAT,SAAA,GAAS,CAAA,OAAA,EAAa,OAAb,EAAA,IAAA,EAAA;EAAA,MAAa,EAAyB,OAAzB,CAAA;IAAyB,IAAA,EAAA,MAAA,EAAA;EAAO,CAAA,CAAA;CAA2C,EAAA,GAAhB,OAAA,CAAQ,QAAR,CAAA;AAAO,cAqBvF,UAAA,CArBuF;EAqBvF,iBAAU,MAAA;EAAA,SAAA,EAAA,MAAA;EAAA,QAaD,KAAA;EAAe,QA8CnB,QAAA;EAAS,QAAgB,SAAA;EAAoB,QAAzB,QAAA;EAAI,QAAuD,UAAA;EAAQ,QAAhB,WAAA;EAAO,QAY7E,YAAA;EAAS,WAAW,CAAA,MAAA,EA1DjB,eA0Di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