@managemint-solutions/sdk 0.29.0 → 0.30.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/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export { CancelSubscriptionDto, GetPaymentsQueryDto, InitialPaymentDto, PaymentI
15
15
  export { GetInvoicesQueryDto, InvoiceIdDto } from './billing/invoices';
16
16
  export type { CreateFeatureRequestRow, CreatedFeatureRequest } from './feature-requests';
17
17
  export { CreateFeatureRequestDto } from './feature-requests';
18
+ export { CreateSupportRequestDto } from './support';
18
19
  export { AddStatusDto, GetStatusesDto, StatusIdDto, UpdateStatusDto } from './statuses';
19
20
  export { AddAdditionalDetailsDto, AdditionalDetailsIdDto, GetAdditionalDetailsDto, IsAdditionalDetailsValueByType, UpdateAdditionalDetailsDto, } from './additional-details';
20
21
  export { AddNoteDto, GetNotesDto, NoteIdDto } from './notes';
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@
7
7
  // their classes are not exported: a consumer never constructs one, and every export is a contract
8
8
  // to keep. The row and input types they produce and accept are exported for annotations.
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.ClientIdDto = exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.CreateOrganizationDto = exports.NotificationIdDto = exports.GetNotificationsDto = exports.NoteIdDto = exports.GetNotesDto = exports.AddNoteDto = exports.UpdateAdditionalDetailsDto = exports.IsAdditionalDetailsValueByType = exports.GetAdditionalDetailsDto = exports.AdditionalDetailsIdDto = exports.AddAdditionalDetailsDto = exports.UpdateStatusDto = exports.StatusIdDto = exports.GetStatusesDto = exports.AddStatusDto = exports.CreateFeatureRequestDto = exports.InvoiceIdDto = exports.GetInvoicesQueryDto = exports.ReinstateSubscriptionDto = exports.PurchaseModuleDto = exports.PaymentIdDto = exports.InitialPaymentDto = exports.GetPaymentsQueryDto = exports.CancelSubscriptionDto = exports.GetAuditTrailDto = exports.IsNullable = exports.EmptyToNull = exports.SupabaseClientError = exports.createSupabaseServiceClient = exports.SupabaseServiceClient = exports.SignInDto = exports.SendPasswordResetEmailDto = exports.ResetPasswordDto = exports.ExchangeTokenHashDto = exports.ExchangeRefreshTokenDto = exports.createSupabaseAuthClient = exports.SupabaseAuthClient = exports.createSupabaseClient = exports.SupabaseClient = void 0;
11
- exports.monthlyTotalMinor = exports.UpdateTaskDto = exports.TaskIdDto = exports.GetTasksDto = exports.CreateTaskDto = exports.UpdateProjectDto = exports.ProjectIdDto = exports.GetProjectsDto = exports.CreateProjectDto = exports.UpdateClientDto = exports.GetClientsDto = exports.CreateClientDto = void 0;
10
+ exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.CreateOrganizationDto = exports.NotificationIdDto = exports.GetNotificationsDto = exports.NoteIdDto = exports.GetNotesDto = exports.AddNoteDto = exports.UpdateAdditionalDetailsDto = exports.IsAdditionalDetailsValueByType = exports.GetAdditionalDetailsDto = exports.AdditionalDetailsIdDto = exports.AddAdditionalDetailsDto = exports.UpdateStatusDto = exports.StatusIdDto = exports.GetStatusesDto = exports.AddStatusDto = exports.CreateSupportRequestDto = exports.CreateFeatureRequestDto = exports.InvoiceIdDto = exports.GetInvoicesQueryDto = exports.ReinstateSubscriptionDto = exports.PurchaseModuleDto = exports.PaymentIdDto = exports.InitialPaymentDto = exports.GetPaymentsQueryDto = exports.CancelSubscriptionDto = exports.GetAuditTrailDto = exports.IsNullable = exports.EmptyToNull = exports.SupabaseClientError = exports.createSupabaseServiceClient = exports.SupabaseServiceClient = exports.SignInDto = exports.SendPasswordResetEmailDto = exports.ResetPasswordDto = exports.ExchangeTokenHashDto = exports.ExchangeRefreshTokenDto = exports.createSupabaseAuthClient = exports.SupabaseAuthClient = exports.createSupabaseClient = exports.SupabaseClient = void 0;
11
+ exports.monthlyTotalMinor = exports.UpdateTaskDto = exports.TaskIdDto = exports.GetTasksDto = exports.CreateTaskDto = exports.UpdateProjectDto = exports.ProjectIdDto = exports.GetProjectsDto = exports.CreateProjectDto = exports.UpdateClientDto = exports.GetClientsDto = exports.CreateClientDto = exports.ClientIdDto = void 0;
12
12
  var client_1 = require("./client");
13
13
  Object.defineProperty(exports, "SupabaseClient", { enumerable: true, get: function () { return client_1.SupabaseClient; } });
14
14
  Object.defineProperty(exports, "createSupabaseClient", { enumerable: true, get: function () { return client_1.createSupabaseClient; } });
@@ -43,6 +43,8 @@ Object.defineProperty(exports, "GetInvoicesQueryDto", { enumerable: true, get: f
43
43
  Object.defineProperty(exports, "InvoiceIdDto", { enumerable: true, get: function () { return invoices_1.InvoiceIdDto; } });
44
44
  var feature_requests_1 = require("./feature-requests");
45
45
  Object.defineProperty(exports, "CreateFeatureRequestDto", { enumerable: true, get: function () { return feature_requests_1.CreateFeatureRequestDto; } });
46
+ var support_1 = require("./support");
47
+ Object.defineProperty(exports, "CreateSupportRequestDto", { enumerable: true, get: function () { return support_1.CreateSupportRequestDto; } });
46
48
  var statuses_1 = require("./statuses");
47
49
  Object.defineProperty(exports, "AddStatusDto", { enumerable: true, get: function () { return statuses_1.AddStatusDto; } });
48
50
  Object.defineProperty(exports, "GetStatusesDto", { enumerable: true, get: function () { return statuses_1.GetStatusesDto; } });
@@ -0,0 +1,18 @@
1
+ import type { CreateSupportRequestDto as CreateSupportRequestDtoType } from '@managemint-solutions/entities/support/dto';
2
+ import { SupportTopic } from '@managemint-solutions/entities/support/enum';
3
+ export declare class CreateSupportRequestDto implements CreateSupportRequestDtoType {
4
+ readonly topic: SupportTopic;
5
+ readonly name: string;
6
+ readonly email: string;
7
+ readonly company?: string | null;
8
+ readonly message: string;
9
+ /**
10
+ * The honeypot. It is here only so `forbidNonWhitelisted` does not 400 the field the website
11
+ * always submits; the api answers 201 and sends nothing when it arrives filled.
12
+ *
13
+ * Deliberately uncapped and unvalidated beyond "a string": a bot that pastes a novel into it
14
+ * must get the same bland 201 as one that types a URL. A 400 would tell it which field gave
15
+ * the game away.
16
+ */
17
+ readonly website_url?: string;
18
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateSupportRequestDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const enum_1 = require("@managemint-solutions/entities/support/enum");
16
+ const validators_1 = require("../validators");
17
+ // class-validator version of the shared DTO type from @managemint-solutions/entities, so the
18
+ // wire contract cannot drift.
19
+ /**
20
+ * Whitespace on either side of a pasted value is not part of the answer. Trimming here rather
21
+ * than in the api means the length rules below measure what will actually be sent — a name of
22
+ * three spaces is empty, not three characters long.
23
+ */
24
+ const Trim = () => (0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim() : value), {
25
+ toClassOnly: true,
26
+ });
27
+ class CreateSupportRequestDto {
28
+ topic;
29
+ name;
30
+ // 320 is the longest address RFC 5321 allows.
31
+ email;
32
+ // Optional on the form. `@Trim` sits above `@EmptyToNull` because transforms run top down, so
33
+ // a whitespace-only box is trimmed to '' first and then becomes null rather than being sent
34
+ // as blanks.
35
+ company;
36
+ // Plain text. 10 000 characters is a long letter, and well within what one email carries.
37
+ message;
38
+ /**
39
+ * The honeypot. It is here only so `forbidNonWhitelisted` does not 400 the field the website
40
+ * always submits; the api answers 201 and sends nothing when it arrives filled.
41
+ *
42
+ * Deliberately uncapped and unvalidated beyond "a string": a bot that pastes a novel into it
43
+ * must get the same bland 201 as one that types a URL. A 400 would tell it which field gave
44
+ * the game away.
45
+ */
46
+ website_url;
47
+ }
48
+ exports.CreateSupportRequestDto = CreateSupportRequestDto;
49
+ __decorate([
50
+ (0, class_validator_1.IsEnum)(enum_1.SupportTopic, { message: 'Invalid topic' }),
51
+ __metadata("design:type", String)
52
+ ], CreateSupportRequestDto.prototype, "topic", void 0);
53
+ __decorate([
54
+ Trim(),
55
+ (0, class_validator_1.IsString)({ message: 'Invalid name' }),
56
+ (0, class_validator_1.MinLength)(1, { message: 'Name cannot be empty' }),
57
+ (0, class_validator_1.MaxLength)(200, { message: 'Name cannot exceed 200 characters' }),
58
+ __metadata("design:type", String)
59
+ ], CreateSupportRequestDto.prototype, "name", void 0);
60
+ __decorate([
61
+ Trim(),
62
+ (0, class_validator_1.IsEmail)({}, { message: 'Invalid email address' }),
63
+ (0, class_validator_1.MaxLength)(320, { message: 'Email address cannot exceed 320 characters' }),
64
+ __metadata("design:type", String)
65
+ ], CreateSupportRequestDto.prototype, "email", void 0);
66
+ __decorate([
67
+ (0, class_validator_1.IsOptional)(),
68
+ Trim(),
69
+ (0, validators_1.EmptyToNull)(),
70
+ (0, validators_1.IsNullable)(),
71
+ (0, class_validator_1.ValidateIf)((o) => o.company !== null && o.company !== undefined),
72
+ (0, class_validator_1.IsString)({ message: 'Invalid company' }),
73
+ (0, class_validator_1.MaxLength)(200, { message: 'Company cannot exceed 200 characters' }),
74
+ __metadata("design:type", Object)
75
+ ], CreateSupportRequestDto.prototype, "company", void 0);
76
+ __decorate([
77
+ Trim(),
78
+ (0, class_validator_1.IsString)({ message: 'Invalid message' }),
79
+ (0, class_validator_1.MinLength)(1, { message: 'Message cannot be empty' }),
80
+ (0, class_validator_1.MaxLength)(10000, { message: 'Message cannot exceed 10000 characters' }),
81
+ __metadata("design:type", String)
82
+ ], CreateSupportRequestDto.prototype, "message", void 0);
83
+ __decorate([
84
+ (0, class_validator_1.IsOptional)(),
85
+ (0, class_validator_1.IsString)({ message: 'Invalid website URL' }),
86
+ __metadata("design:type", String)
87
+ ], CreateSupportRequestDto.prototype, "website_url", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The website's contact page, `POST /support`.
3
+ *
4
+ * Only the DTO lives here. Nothing is written to the database - the api turns a submission
5
+ * into two emails and keeps no row - so there is no resource, no table and no client method.
6
+ */
7
+ export { CreateSupportRequestDto } from './dto';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateSupportRequestDto = void 0;
4
+ /**
5
+ * The website's contact page, `POST /support`.
6
+ *
7
+ * Only the DTO lives here. Nothing is written to the database - the api turns a submission
8
+ * into two emails and keeps no row - so there is no resource, no table and no client method.
9
+ */
10
+ var dto_1 = require("./dto");
11
+ Object.defineProperty(exports, "CreateSupportRequestDto", { enumerable: true, get: function () { return dto_1.CreateSupportRequestDto; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/sdk",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "Typed Supabase data-access SDK for ManageMint Solutions",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Scott Bebington <scottbebington@gmail.com>",
@@ -47,7 +47,7 @@
47
47
  "testEnvironment": "node"
48
48
  },
49
49
  "dependencies": {
50
- "@managemint-solutions/entities": "^1.13.0"
50
+ "@managemint-solutions/entities": "^1.14.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@nestjs/common": "^11.0.0",