@managemint-solutions/sdk 0.5.0 → 0.6.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/README.md +74 -6
- package/dist/additional-details/dto.d.ts +2 -5
- package/dist/additional-details/dto.js +2 -0
- package/dist/additional-details/dto.js.map +1 -1
- package/dist/additional-details/index.js +5 -6
- package/dist/additional-details/index.js.map +1 -1
- package/dist/additional-details/values.d.ts +2 -2
- package/dist/additional-details/values.js +2 -2
- package/dist/client.d.ts +5 -2
- package/dist/client.js +6 -0
- package/dist/client.js.map +1 -1
- package/dist/clients/index.js +3 -6
- package/dist/clients/index.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/notes/dto.d.ts +1 -4
- package/dist/notes/dto.js +2 -0
- package/dist/notes/dto.js.map +1 -1
- package/dist/notes/index.js +3 -5
- package/dist/notes/index.js.map +1 -1
- package/dist/projects/dto.d.ts +38 -0
- package/dist/projects/dto.js +238 -0
- package/dist/projects/dto.js.map +1 -0
- package/dist/projects/index.d.ts +20 -0
- package/dist/projects/index.js +299 -0
- package/dist/projects/index.js.map +1 -0
- package/dist/statuses/dto.d.ts +2 -5
- package/dist/statuses/dto.js +2 -0
- package/dist/statuses/dto.js.map +1 -1
- package/dist/statuses/index.js +3 -4
- package/dist/statuses/index.js.map +1 -1
- package/dist/supporting-files/index.js +3 -3
- package/dist/supporting-files/index.js.map +1 -1
- package/dist/tasks/dto.d.ts +43 -0
- package/dist/tasks/dto.js +288 -0
- package/dist/tasks/dto.js.map +1 -0
- package/dist/tasks/index.d.ts +20 -0
- package/dist/tasks/index.js +241 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/transforms.d.ts +14 -0
- package/dist/transforms.js +38 -0
- package/dist/transforms.js.map +1 -0
- package/package.json +1 -1
- package/dist/database.types.d.ts +0 -2570
- package/dist/database.types.js +0 -12
- package/dist/database.types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# ManageMint Solutions SDK
|
|
2
2
|
|
|
3
|
-
Typed Supabase data-access SDK for ManageMint Solutions. Query logic
|
|
4
|
-
|
|
3
|
+
Typed Supabase data-access SDK for ManageMint Solutions. Query logic lives here; consumers
|
|
4
|
+
(api, portal) get responses typed as the shared `@managemint-solutions/entities` types with no casts.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
@@ -14,7 +14,8 @@ are peer dependencies — the request DTOs (`AddStatusDto`, `UpdateStatusDto`, `
|
|
|
14
14
|
`GetStatusesDto`, `AddAdditionalDetailsDto`, `UpdateAdditionalDetailsDto`,
|
|
15
15
|
`AdditionalDetailsIdDto`, `GetAdditionalDetailsDto`, `AddNoteDto`, `NoteIdDto`,
|
|
16
16
|
`GetNotesDto`, `SupportingFileIdDto`, `GetSupportingFilesDto`, `GetClientsDto`, `ClientIdDto`,
|
|
17
|
-
`CreateClientDto`, `UpdateClientDto`
|
|
17
|
+
`CreateClientDto`, `UpdateClientDto`, `GetProjectsDto`, `ProjectIdDto`, `CreateProjectDto`,
|
|
18
|
+
`UpdateProjectDto`, `GetTasksDto`, `TaskIdDto`, `CreateTaskDto`, `UpdateTaskDto`) ship with their class-validator
|
|
18
19
|
decorators so consumers validate against
|
|
19
20
|
the same rules the SDK's input types describe. `@nestjs/common` (^11) is an optional peer
|
|
20
21
|
dependency, needed only for the `@managemint-solutions/sdk/nest` subpath.
|
|
@@ -124,8 +125,75 @@ await supabase.clients.restore(client.mms_id); // deleted = false + restored_a
|
|
|
124
125
|
email and phone empty, no status, `contract_client` false, `contracted_hours` 0). Every write
|
|
125
126
|
except `remove` re-reads and returns the full record afterwards.
|
|
126
127
|
|
|
128
|
+
```ts
|
|
129
|
+
// Projects are paginated the same way, with extra date-range and client filters.
|
|
130
|
+
const page = await supabase.projects.list({
|
|
131
|
+
page: 1,
|
|
132
|
+
page_size: 10,
|
|
133
|
+
archive: false,
|
|
134
|
+
client_id: clientId, // a UUID, or the base64-JSON option value a select sends
|
|
135
|
+
});
|
|
136
|
+
// `search` matches name/specification; `created_*`, `start_date_*` and `end_date_*` bound the
|
|
137
|
+
// date columns, and `status_id_in` filters by status.
|
|
138
|
+
|
|
139
|
+
const project = await supabase.projects.create({
|
|
140
|
+
name: 'Website rebuild',
|
|
141
|
+
specification: 'Rebuild the marketing site',
|
|
142
|
+
start_date: '2026-04-22',
|
|
143
|
+
end_date: '2026-06-30',
|
|
144
|
+
has_budget: true,
|
|
145
|
+
status_id: statusId,
|
|
146
|
+
client_id: clientId,
|
|
147
|
+
manager_id: userId,
|
|
148
|
+
});
|
|
149
|
+
await supabase.projects.getById(project.mms_id);
|
|
150
|
+
await supabase.projects.update(project.mms_id, { ...project, name: 'Website rebuild v2' });
|
|
151
|
+
await supabase.projects.archive(project.mms_id);
|
|
152
|
+
await supabase.projects.unarchive(project.mms_id);
|
|
153
|
+
await supabase.projects.remove(project.mms_id); // soft delete
|
|
154
|
+
await supabase.projects.restore(project.mms_id);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Each project carries its embedded `status`, `manager` and `client`; `getById` on a soft-deleted
|
|
158
|
+
project returns the creation audit with the rest blanked (empty name, no specification, dates,
|
|
159
|
+
status, manager or client).
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
// Tasks are paginated too, ordered by priority then newest first.
|
|
163
|
+
const page = await supabase.tasks.list({
|
|
164
|
+
page: 1,
|
|
165
|
+
page_size: 10,
|
|
166
|
+
archive: false,
|
|
167
|
+
project_id: projectId,
|
|
168
|
+
priority_in: [1, 3],
|
|
169
|
+
});
|
|
170
|
+
// `search` matches name/description, and `client_id`, `assigned_to_id`, the date ranges and
|
|
171
|
+
// `status_id_in` narrow it further.
|
|
172
|
+
|
|
173
|
+
const task = await supabase.tasks.create({
|
|
174
|
+
name: 'Draft the proposal',
|
|
175
|
+
description: 'Write the first pass and circulate it',
|
|
176
|
+
start_date: '2026-04-22',
|
|
177
|
+
end_date: '2026-04-30',
|
|
178
|
+
status_id: statusId,
|
|
179
|
+
priority: 2,
|
|
180
|
+
assigned_to_id: userId,
|
|
181
|
+
project_id: projectId,
|
|
182
|
+
client_id: clientId,
|
|
183
|
+
});
|
|
184
|
+
await supabase.tasks.getById(task.mms_id);
|
|
185
|
+
await supabase.tasks.update(task.mms_id, { ...task, priority: 3 });
|
|
186
|
+
await supabase.tasks.archive(task.mms_id);
|
|
187
|
+
await supabase.tasks.unarchive(task.mms_id);
|
|
188
|
+
await supabase.tasks.remove(task.mms_id); // soft delete
|
|
189
|
+
await supabase.tasks.restore(task.mms_id);
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
A task's `task_id` (its per-organization number) is assigned by the database on insert, and each
|
|
193
|
+
task carries its embedded `status`, `assigned_to`, `project` and `client`.
|
|
194
|
+
|
|
127
195
|
The client decodes `{ mms_id, organization_id }` from the JWT itself and scopes every query
|
|
128
|
-
by `organization_id`. `supabase.supabase` is the raw
|
|
196
|
+
by `organization_id`. `supabase.supabase` is the raw `@supabase/supabase-js` client
|
|
129
197
|
(`TypedSupabaseClient`) — the escape hatch for queries not yet covered by a resource.
|
|
130
198
|
|
|
131
199
|
## Errors
|
|
@@ -169,6 +237,6 @@ npm test # jest + ts-jest; specs live in src/<resource>/tests/*.spec.ts
|
|
|
169
237
|
npm run build # tsc -p tsconfig.build.json (excludes specs), CommonJS output in dist/ — the type gate
|
|
170
238
|
```
|
|
171
239
|
|
|
172
|
-
|
|
173
|
-
|
|
240
|
+
The SDK carries no generated database types: the schema of record is the api's
|
|
241
|
+
`supabase/migrations`, and each resource declares the row shape its select string produces.
|
|
174
242
|
Publishing happens on push to `main` via `.github/workflows/release.yml`.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type ValidationOptions } from 'class-validator';
|
|
2
2
|
import type { AddAdditionalDetailsDto as AddAdditionalDetailsDtoType, AdditionalDetailsIdDto as AdditionalDetailsIdDtoType, GetAdditionalDetailsDto as GetAdditionalDetailsDtoType, UpdateAdditionalDetailsDto as UpdateAdditionalDetailsDtoType } from '@managemint-solutions/entities/additional-details/dto';
|
|
3
3
|
import { AdditionalDetailsEntityTypes, AdditionalDetailsTypes } from '@managemint-solutions/entities/additional-details/enum';
|
|
4
|
-
import type { TablesInsert } from '../database.types';
|
|
5
4
|
/** Validates `value` against the sibling `type` property (the discriminator). */
|
|
6
5
|
export declare function IsAdditionalDetailsValueByType(typeProperty: string, validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
|
|
7
|
-
type AdditionalDetailsInsertColumns = Required<Pick<TablesInsert<'additional_details'>, 'key' | 'copyable'>>;
|
|
8
6
|
export declare class AdditionalDetailsIdDto implements AdditionalDetailsIdDtoType {
|
|
9
7
|
readonly additionalDetailsId: string;
|
|
10
8
|
}
|
|
@@ -12,16 +10,15 @@ export declare class GetAdditionalDetailsDto implements GetAdditionalDetailsDtoT
|
|
|
12
10
|
readonly entity: AdditionalDetailsEntityTypes;
|
|
13
11
|
readonly entityId: string;
|
|
14
12
|
}
|
|
15
|
-
export declare class AddAdditionalDetailsDto implements AddAdditionalDetailsDtoType
|
|
13
|
+
export declare class AddAdditionalDetailsDto implements AddAdditionalDetailsDtoType {
|
|
16
14
|
readonly key: string;
|
|
17
15
|
readonly value: string | number | boolean | Date | URL;
|
|
18
16
|
readonly type: AdditionalDetailsTypes;
|
|
19
17
|
readonly copyable: boolean;
|
|
20
18
|
}
|
|
21
|
-
export declare class UpdateAdditionalDetailsDto implements UpdateAdditionalDetailsDtoType
|
|
19
|
+
export declare class UpdateAdditionalDetailsDto implements UpdateAdditionalDetailsDtoType {
|
|
22
20
|
readonly key: string;
|
|
23
21
|
readonly value: string | number | boolean;
|
|
24
22
|
readonly type: AdditionalDetailsTypes;
|
|
25
23
|
readonly copyable: boolean;
|
|
26
24
|
}
|
|
27
|
-
export {};
|
|
@@ -66,6 +66,8 @@ function IsAdditionalDetailsValueByType(typeProperty, validationOptions) {
|
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
+
// class-validator versions of the shared DTO types from @managemint-solutions/entities.
|
|
70
|
+
// Each class `implements` its entities type so the wire contract cannot drift.
|
|
69
71
|
class AdditionalDetailsIdDto {
|
|
70
72
|
additionalDetailsId;
|
|
71
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/additional-details/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/additional-details/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAwBA,wEA4DC;AApFD,qDAWyB;AAOzB,iFAGgE;AAEhE,iFAAiF;AACjF,SAAgB,8BAA8B,CAC5C,YAAoB,EACpB,iBAAqC;IAErC,OAAO,UAAU,MAAc,EAAE,YAAoB;QACnD,IAAA,mCAAiB,EAAC;YAChB,IAAI,EAAE,gCAAgC;YACtC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY;YACZ,WAAW,EAAE,CAAC,YAAY,CAAC;YAC3B,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,QAAQ,CAAC,KAAc,EAAE,IAAyB;oBAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;oBACnC,MAAM,YAAY,GAAI,IAAI,CAAC,MAAkC,CAAC,OAAO,CAExD,CAAC;oBAEd,4DAA4D;oBAC5D,IAAI,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,6BAAsB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;wBACnF,OAAO,IAAI,CAAC;oBACd,CAAC;oBAED,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBAC1C,OAAO,KAAK,CAAC;oBACf,CAAC;oBAED,QAAQ,YAAY,EAAE,CAAC;wBACrB,KAAK,6BAAsB,CAAC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C;IACpC,IAAA,2BAAS,EAAC,CAAC,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;IAChD,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;;uDAC1C;AAIb;IAFR,IAAA,2BAAS,EAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC3C,8BAA8B,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC;;yDACnD;AAGlC;IADR,IAAA,wBAAM,EAAC,6BAAsB,EAAE,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;;wDACxC;AAG9B;IADR,IAAA,2BAAS,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;4DACrB"}
|
|
@@ -19,12 +19,11 @@ const errors_1 = require("../errors");
|
|
|
19
19
|
const values_1 = require("./values");
|
|
20
20
|
__exportStar(require("./dto"), exports);
|
|
21
21
|
__exportStar(require("./values"), exports);
|
|
22
|
-
// The
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
// declares the parsed string | number | boolean | Date | URL union that castValueByType produces.
|
|
22
|
+
// The public contract is the shared AdditionalDetailsEntity / AdditionalDetailSummary from
|
|
23
|
+
// @managemint-solutions/entities; the casts at the returns declare the shape the select strings
|
|
24
|
+
// below produce (the columns are defined in the api's supabase/migrations). `value` is a `text`
|
|
25
|
+
// column, and castValueByType turns it into the string | number | boolean | Date | URL union the
|
|
26
|
+
// entity declares.
|
|
28
27
|
const ADDITIONAL_DETAILS_SELECT = 'mms_id, created_at, created_by:user_profiles!created_by(*), updated_at, last_updated_by:user_profiles!last_updated_by(*), key, value, type, copyable';
|
|
29
28
|
const ADDITIONAL_DETAILS_SUMMARY_SELECT = 'mms_id, key, value, type, copyable';
|
|
30
29
|
const withCastValue = (detail) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/additional-details/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAcA,sCAA8C;AAC9C,qCAA2D;AAE3D,wCAAsB;AACtB,2CAAyB;AAEzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/additional-details/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAcA,sCAA8C;AAC9C,qCAA2D;AAE3D,wCAAsB;AACtB,2CAAyB;AAEzB,2FAA2F;AAC3F,gGAAgG;AAChG,gGAAgG;AAChG,iGAAiG;AACjG,mBAAmB;AACnB,MAAM,yBAAyB,GAC7B,sJAA+J,CAAC;AAElK,MAAM,iCAAiC,GAAG,oCAA6C,CAAC;AAExF,MAAM,aAAa,GAAG,CAA6C,MAAS,EAAE,EAAE,CAAC,CAAC;IAChF,GAAG,MAAM;IACT,KAAK,EAAE,IAAA,wBAAe,EAAC,MAAM,CAAC,IAA8B,EAAE,MAAM,CAAC,KAAK,CAAC;CAC5E,CAAC,CAAC;AAEH,MAAa,yBAAyB;IAEjB;IACA;IAFnB,YACmB,QAA6B,EAC7B,IAAiB;QADjB,aAAQ,GAAR,QAAQ,CAAqB;QAC7B,SAAI,GAAJ,IAAI,CAAa;IACjC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,mBAA2B;QACvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ;aACxC,IAAI,CAAC,oBAAoB,CAAC;aAC1B,MAAM,CAAC,yBAAyB,CAAC;aACjC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC;aAChD,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;aACjC,MAAM,EAAE,CAAC;QACZ,IAAI,KAAK;YAAE,MAAM,IAAA,0BAAiB,EAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,aAAa,CAAC,IAAI,CAAuC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC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ueByType: (type: AdditionalDetailsTypes, value: unknown) => unknown;
|
|
7
7
|
/**
|
|
8
|
-
* What gets written to the `text` column.
|
|
9
|
-
*
|
|
8
|
+
* What gets written to the `text` column. `String()` reproduces the JSON → text coercion
|
|
9
|
+
* PostgREST used to do for number/boolean/string.
|
|
10
10
|
*/
|
|
11
11
|
export declare const serializeValue: (value: string | number | boolean | Date | URL) => string;
|
|
@@ -29,8 +29,8 @@ const castValueByType = (type, value) => {
|
|
|
29
29
|
};
|
|
30
30
|
exports.castValueByType = castValueByType;
|
|
31
31
|
/**
|
|
32
|
-
* What gets written to the `text` column.
|
|
33
|
-
*
|
|
32
|
+
* What gets written to the `text` column. `String()` reproduces the JSON → text coercion
|
|
33
|
+
* PostgREST used to do for number/boolean/string.
|
|
34
34
|
*/
|
|
35
35
|
const serializeValue = (value) => value instanceof Date ? value.toISOString() : String(value);
|
|
36
36
|
exports.serializeValue = serializeValue;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type SupabaseClient as SupabaseJsClient } from '@supabase/supabase-js';
|
|
2
|
-
import type { Database } from './database.types';
|
|
3
2
|
import { type AuthContext } from './auth';
|
|
4
3
|
import { AdditionalDetailsResource } from './additional-details';
|
|
5
4
|
import { ClientsResource } from './clients';
|
|
6
5
|
import { NotesResource } from './notes';
|
|
6
|
+
import { ProjectsResource } from './projects';
|
|
7
7
|
import { StatusesResource } from './statuses';
|
|
8
8
|
import { SupportingFilesResource } from './supporting-files';
|
|
9
|
-
|
|
9
|
+
import { TasksResource } from './tasks';
|
|
10
|
+
export type TypedSupabaseClient = SupabaseJsClient;
|
|
10
11
|
export type SupabaseClientConfig = {
|
|
11
12
|
url: string;
|
|
12
13
|
key: string;
|
|
@@ -20,6 +21,8 @@ export declare class SupabaseClient {
|
|
|
20
21
|
readonly notes: NotesResource;
|
|
21
22
|
readonly supportingFiles: SupportingFilesResource;
|
|
22
23
|
readonly clients: ClientsResource;
|
|
24
|
+
readonly projects: ProjectsResource;
|
|
25
|
+
readonly tasks: TasksResource;
|
|
23
26
|
constructor(config: SupabaseClientConfig);
|
|
24
27
|
}
|
|
25
28
|
export declare const createSupabaseClient: (config: SupabaseClientConfig) => SupabaseClient;
|
package/dist/client.js
CHANGED
|
@@ -6,8 +6,10 @@ const auth_1 = require("./auth");
|
|
|
6
6
|
const additional_details_1 = require("./additional-details");
|
|
7
7
|
const clients_1 = require("./clients");
|
|
8
8
|
const notes_1 = require("./notes");
|
|
9
|
+
const projects_1 = require("./projects");
|
|
9
10
|
const statuses_1 = require("./statuses");
|
|
10
11
|
const supporting_files_1 = require("./supporting-files");
|
|
12
|
+
const tasks_1 = require("./tasks");
|
|
11
13
|
class SupabaseClient {
|
|
12
14
|
supabase; // escape hatch for not-yet-migrated queries
|
|
13
15
|
auth;
|
|
@@ -16,6 +18,8 @@ class SupabaseClient {
|
|
|
16
18
|
notes;
|
|
17
19
|
supportingFiles;
|
|
18
20
|
clients;
|
|
21
|
+
projects;
|
|
22
|
+
tasks;
|
|
19
23
|
constructor(config) {
|
|
20
24
|
this.auth = (0, auth_1.decodeAuthContext)(config.accessToken);
|
|
21
25
|
this.supabase = (0, supabase_js_1.createClient)(config.url, config.key, {
|
|
@@ -27,6 +31,8 @@ class SupabaseClient {
|
|
|
27
31
|
this.notes = new notes_1.NotesResource(this.supabase, this.auth);
|
|
28
32
|
this.supportingFiles = new supporting_files_1.SupportingFilesResource(this.supabase, this.auth);
|
|
29
33
|
this.clients = new clients_1.ClientsResource(this.supabase, this.auth);
|
|
34
|
+
this.projects = new projects_1.ProjectsResource(this.supabase, this.auth);
|
|
35
|
+
this.tasks = new tasks_1.TasksResource(this.supabase, this.auth);
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
exports.SupabaseClient = SupabaseClient;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAA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,IAAI,CAAC,CAAC;QAC7E,IAAI,CAAC,OAAO,GAAG,IAAI,yBAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,QAAQ,GAAG,IAAI,2BAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;CACF;AAzBD,wCAyBC;AAEM,MAAM,oBAAoB,GAAG,CAAC,MAA4B,EAAkB,EAAE,CACnF,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AADhB,QAAA,oBAAoB,wBACJ"}
|
package/dist/clients/index.js
CHANGED
|
@@ -17,12 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.ClientsResource = void 0;
|
|
18
18
|
const errors_1 = require("../errors");
|
|
19
19
|
__exportStar(require("./dto"), exports);
|
|
20
|
-
// The
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// `as unknown as`: the embedded user_profiles/statuses rows are all-nullable view rows where the
|
|
24
|
-
// entities declare UserIdentity/StatusEntity, and the timestamp columns are ISO strings where the
|
|
25
|
-
// entities declare Date.
|
|
20
|
+
// The public contract is the shared ClientSummary / ClientEntity from
|
|
21
|
+
// @managemint-solutions/entities; the casts at the returns declare the shape the select strings
|
|
22
|
+
// below produce (the columns are defined in the api's supabase/migrations).
|
|
26
23
|
const CLIENT_LIST_SELECT = `
|
|
27
24
|
mms_id,
|
|
28
25
|
created_at,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,sCAA8C;AAG9C,wCAAsB;AAEtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceR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B;QAC3B,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ;aAClC,IAAI,CAAC,SAAS,CAAC;aACf,MAAM,CAAC;YACN,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;SAC7B,CAAC;aACD,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC;aAChD,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1B,IAAI,KAAK;YAAE,MAAM,IAAA,0BAAiB,EAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;CACF;AArLD,0CAqLC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ export * from './client';
|
|
|
2
2
|
export * from './auth';
|
|
3
3
|
export * from './errors';
|
|
4
4
|
export * from './validators';
|
|
5
|
+
export * from './transforms';
|
|
5
6
|
export * from './statuses';
|
|
6
7
|
export * from './additional-details';
|
|
7
8
|
export * from './notes';
|
|
8
9
|
export * from './supporting-files';
|
|
9
10
|
export * from './clients';
|
|
10
|
-
export
|
|
11
|
+
export * from './projects';
|
|
12
|
+
export * from './tasks';
|
package/dist/index.js
CHANGED
|
@@ -18,9 +18,12 @@ __exportStar(require("./client"), exports);
|
|
|
18
18
|
__exportStar(require("./auth"), exports);
|
|
19
19
|
__exportStar(require("./errors"), exports);
|
|
20
20
|
__exportStar(require("./validators"), exports);
|
|
21
|
+
__exportStar(require("./transforms"), exports);
|
|
21
22
|
__exportStar(require("./statuses"), exports);
|
|
22
23
|
__exportStar(require("./additional-details"), exports);
|
|
23
24
|
__exportStar(require("./notes"), exports);
|
|
24
25
|
__exportStar(require("./supporting-files"), exports);
|
|
25
26
|
__exportStar(require("./clients"), exports);
|
|
27
|
+
__exportStar(require("./projects"), exports);
|
|
28
|
+
__exportStar(require("./tasks"), exports);
|
|
26
29
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,uDAAqC;AACrC,0CAAwB;AACxB,qDAAmC;AACnC,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAC7B,6CAA2B;AAC3B,uDAAqC;AACrC,0CAAwB;AACxB,qDAAmC;AACnC,4CAA0B;AAC1B,6CAA2B;AAC3B,0CAAwB"}
|
package/dist/notes/dto.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { AddNoteDto as AddNoteDtoType, GetNotesDto as GetNotesDtoType, NoteIdDto as NoteIdDtoType } from '@managemint-solutions/entities/notes/dto';
|
|
2
2
|
import { NotesEntityTypes } from '@managemint-solutions/entities/notes/enum';
|
|
3
|
-
import type { TablesInsert } from '../database.types';
|
|
4
|
-
type NotesInsertColumns = Required<Pick<TablesInsert<'notes'>, 'content'>>;
|
|
5
3
|
export declare class NoteIdDto implements NoteIdDtoType {
|
|
6
4
|
readonly noteId: string;
|
|
7
5
|
}
|
|
@@ -9,7 +7,6 @@ export declare class GetNotesDto implements GetNotesDtoType {
|
|
|
9
7
|
readonly entity: NotesEntityTypes;
|
|
10
8
|
readonly entityId: string;
|
|
11
9
|
}
|
|
12
|
-
export declare class AddNoteDto implements AddNoteDtoType
|
|
10
|
+
export declare class AddNoteDto implements AddNoteDtoType {
|
|
13
11
|
readonly content: string;
|
|
14
12
|
}
|
|
15
|
-
export {};
|
package/dist/notes/dto.js
CHANGED
|
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AddNoteDto = exports.GetNotesDto = exports.NoteIdDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const enum_1 = require("@managemint-solutions/entities/notes/enum");
|
|
15
|
+
// class-validator versions of the shared DTO types from @managemint-solutions/entities.
|
|
16
|
+
// Each class `implements` its entities type so the wire contract cannot drift.
|
|
15
17
|
class NoteIdDto {
|
|
16
18
|
noteId;
|
|
17
19
|
}
|
package/dist/notes/dto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/notes/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiF;AAMjF,oEAA6E;
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/notes/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiF;AAMjF,oEAA6E;AAE7E,wFAAwF;AACxF,+EAA+E;AAE/E,MAAa,SAAS;IAEX,MAAM,CAAU;CAC1B;AAHD,8BAGC;AADU;IADR,IAAA,wBAAM,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;yCAC1B;AAG3B,MAAa,WAAW;IAEb,MAAM,CAAoB;IAG1B,QAAQ,CAAU;CAC5B;AAND,kCAMC;AAJU;IADR,IAAA,wBAAM,EAAC,uBAAgB,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;;2CAC1B;AAG1B;IADR,IAAA,wBAAM,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;;6CAC1B;AAG7B,MAAa,UAAU;IAIZ,OAAO,CAAU;CAC3B;AALD,gCAKC;AADU;IAHR,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IACxC,IAAA,2BAAS,EAAC,CAAC,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;IACpD,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;;2CAC1C"}
|
package/dist/notes/index.js
CHANGED
|
@@ -17,11 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.NotesResource = void 0;
|
|
18
18
|
const errors_1 = require("../errors");
|
|
19
19
|
__exportStar(require("./dto"), exports);
|
|
20
|
-
// The
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// embedded user_profiles row is an all-nullable view row where the entity declares UserIdentity,
|
|
24
|
-
// and created_at is an ISO string where the entity declares Date.
|
|
20
|
+
// The public contract is the shared NoteEntity from @managemint-solutions/entities; the casts at
|
|
21
|
+
// the returns declare the shape the select string below produces (the columns are defined in the
|
|
22
|
+
// api's supabase/migrations).
|
|
25
23
|
const NOTE_SELECT = 'mms_id, created_at, content, pinned, user:user_profiles!user_id(*)';
|
|
26
24
|
class NotesResource {
|
|
27
25
|
supabase;
|
package/dist/notes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKA,sCAA8C;AAE9C,wCAAsB;AAEtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKA,sCAA8C;AAE9C,wCAAsB;AAEtB,iGAAiG;AACjG,iGAAiG;AACjG,8BAA8B;AAC9B,MAAM,WAAW,GAAG,oEAA6E,CAAC;AAElG,MAAa,aAAa;IAEL;IACA;IAFnB,YACmB,QAA6B,EAC7B,IAAiB;QADjB,aAAQ,GAAR,QAAQ,CAAqB;QAC7B,SAAI,GAAJ,IAAI,CAAa;IACjC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,MAAc;QAC1B,MAAM,EAAE,IAAI,EAAE,KAA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to as GetProjectsDtoType, ProjectIdDto as ProjectIdDtoType, UpdateProjectDto as UpdateProjectDtoType } from '@managemint-solutions/entities/projects/dto';
|
|
2
|
+
export declare class GetProjectsDto implements Omit<GetProjectsDtoType, 'status_id_in'> {
|
|
3
|
+
readonly search?: string | null;
|
|
4
|
+
readonly page: number;
|
|
5
|
+
readonly page_size: number;
|
|
6
|
+
readonly created_after?: string | null;
|
|
7
|
+
readonly created_before?: string | null;
|
|
8
|
+
readonly start_date_after?: string | null;
|
|
9
|
+
readonly start_date_before?: string | null;
|
|
10
|
+
readonly end_date_after?: string | null;
|
|
11
|
+
readonly end_date_before?: string | null;
|
|
12
|
+
readonly status_id_in?: string[] | null;
|
|
13
|
+
readonly client_id?: string | null;
|
|
14
|
+
readonly archive: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class ProjectIdDto implements ProjectIdDtoType {
|
|
17
|
+
readonly projectId: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class CreateProjectDto implements CreateProjectDtoType {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly specification: string | null;
|
|
22
|
+
readonly start_date?: Date | null;
|
|
23
|
+
readonly end_date?: Date | null;
|
|
24
|
+
readonly has_budget: boolean;
|
|
25
|
+
readonly status_id?: string | null;
|
|
26
|
+
readonly client_id?: string | null;
|
|
27
|
+
readonly manager_id?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export declare class UpdateProjectDto implements UpdateProjectDtoType {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly specification?: string | null;
|
|
32
|
+
readonly start_date?: Date | null;
|
|
33
|
+
readonly end_date?: Date | null;
|
|
34
|
+
readonly has_budget: boolean;
|
|
35
|
+
readonly status_id?: string | null;
|
|
36
|
+
readonly client_id?: string | null;
|
|
37
|
+
readonly manager_id?: string | null;
|
|
38
|
+
}
|