samva 0.15.0 → 0.17.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/AGENTS.md +4 -1
- package/README.md +46 -1
- package/dist/analytics-CaqPRsry.js +207 -0
- package/dist/api-keys-Ce1Y4_Ip.js +274 -0
- package/dist/attachments-DYqVIraC.js +140 -0
- package/dist/brands-ZwuOGIWO.js +175 -0
- package/dist/campaigns-DZlz1E9E.js +522 -0
- package/dist/categories-CA4XIQAb.js +1011 -0
- package/dist/client/sdk.gen.d.ts +234 -49
- package/dist/client/types.gen.d.ts +1521 -348
- package/dist/client-DOzUrdTE.js +1115 -0
- package/dist/contact-groups-BLbFXnjq.js +446 -0
- package/dist/contacts-BbsoXXB4.js +787 -0
- package/dist/conversations-_sRHueML.js +494 -0
- package/dist/custom-fields-BHWbwlKn.js +176 -0
- package/dist/effect/analytics.js +2 -21
- package/dist/effect/api-keys.d.ts +1 -0
- package/dist/effect/api-keys.js +2 -25
- package/dist/effect/attachments.js +2 -17
- package/dist/effect/brands.d.ts +1 -1
- package/dist/effect/brands.js +3 -24
- package/dist/effect/campaigns.js +2 -33
- package/dist/effect/categories.js +1 -1
- package/dist/effect/client.d.ts +1 -1
- package/dist/effect/client.js +3 -4
- package/dist/effect/contact-groups.js +2 -29
- package/dist/effect/contacts.d.ts +52 -0
- package/dist/effect/contacts.js +2 -47
- package/dist/effect/conversations.js +2 -35
- package/dist/effect/custom-fields.js +2 -17
- package/dist/effect/email.d.ts +3 -20
- package/dist/effect/email.js +2 -141
- package/dist/effect/events.d.ts +121 -0
- package/dist/effect/events.js +3 -0
- package/dist/effect/extension-installations.js +2 -27
- package/dist/effect/extensions.js +2 -19
- package/dist/effect/feedback.d.ts +1 -1
- package/dist/effect/feedback.js +3 -13
- package/dist/effect/generated/analytics.d.ts +715 -0
- package/dist/effect/generated/api-keys.d.ts +1627 -0
- package/dist/effect/generated/attachments.d.ts +554 -0
- package/dist/effect/generated/brands.d.ts +1118 -0
- package/dist/effect/generated/campaigns.d.ts +3783 -0
- package/dist/effect/generated/contact-events.d.ts +158 -0
- package/dist/effect/generated/contact-groups.d.ts +1445 -0
- package/dist/effect/generated/contacts.d.ts +3789 -0
- package/dist/effect/generated/conversations.d.ts +2870 -0
- package/dist/effect/generated/custom-fields.d.ts +562 -0
- package/dist/effect/generated/email.d.ts +10622 -0
- package/dist/effect/generated/events.d.ts +463 -0
- package/dist/effect/generated/extension-installations.d.ts +1786 -0
- package/dist/effect/generated/extensions.d.ts +927 -0
- package/dist/effect/generated/feedback.d.ts +116 -0
- package/dist/effect/generated/index.d.ts +61 -0
- package/dist/effect/generated/journeys.d.ts +6135 -0
- package/dist/effect/generated/mailboxes.d.ts +13641 -0
- package/dist/effect/generated/media.d.ts +741 -0
- package/dist/effect/generated/messages.d.ts +2355 -0
- package/dist/effect/generated/namespaces.d.ts +654 -0
- package/dist/effect/generated/operations.d.ts +514 -0
- package/dist/effect/generated/organizations.d.ts +1111 -0
- package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
- package/dist/effect/generated/shared.d.ts +3250 -0
- package/dist/effect/generated/subscriptions.d.ts +188 -0
- package/dist/effect/generated/templates.d.ts +8177 -0
- package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
- package/dist/effect/generated/webhooks.d.ts +1697 -0
- package/dist/effect/generated/whoami.d.ts +291 -0
- package/dist/effect/generated-metadata.d.ts +1631 -0
- package/dist/effect/index.d.ts +4 -1
- package/dist/effect/index.js +29 -26
- package/dist/effect/internal/client.d.ts +10 -7
- package/dist/effect/internal/email-sender.d.ts +17 -0
- package/dist/effect/internal/operation.d.ts +12 -72
- package/dist/effect/internal/send.d.ts +60 -0
- package/dist/effect/journeys.d.ts +2153 -0
- package/dist/effect/journeys.js +2 -0
- package/dist/effect/mailboxes.d.ts +255 -205
- package/dist/effect/mailboxes.js +2 -2
- package/dist/effect/media.js +3 -1
- package/dist/effect/messages.d.ts +2 -2
- package/dist/effect/messages.js +3 -1
- package/dist/effect/namespaces.js +2 -19
- package/dist/effect/operations.js +2 -15
- package/dist/effect/organizations.js +2 -23
- package/dist/effect/retry.js +1 -1
- package/dist/effect/scheduled-messages.js +2 -19
- package/dist/effect/subscriptions.js +2 -9
- package/dist/effect/templates.d.ts +1 -1
- package/dist/effect/templates.js +3 -78
- package/dist/effect/unsubscribe-groups.js +2 -27
- package/dist/effect/webhooks.d.ts +9 -9
- package/dist/effect/webhooks.js +3 -33
- package/dist/effect/whoami.d.ts +46 -0
- package/dist/effect/whoami.js +2 -0
- package/dist/email-R0NAA9PW.js +2498 -0
- package/dist/events-CxbTUHYT.js +82 -0
- package/dist/extension-installations-CD94LPmk.js +407 -0
- package/dist/extensions-BKyNQLvu.js +220 -0
- package/dist/feedback-Bpa09JOS.js +52 -0
- package/dist/index.js +3 -3
- package/dist/{inline-attachments-UxLeyytJ.js → inline-attachments-Bi1hDltp.js} +2 -2
- package/dist/journeys-CARo_BJT.js +499 -0
- package/dist/mailboxes-BRDn7BIK.js +2470 -0
- package/dist/media-VrrtNnft.js +181 -0
- package/dist/namespaces-CcvEbG-y.js +152 -0
- package/dist/{operation-BZ5Xov-x.js → operation-n_IYgNVK.js} +85 -102
- package/dist/operations-CmB3FHwf.js +93 -0
- package/dist/organizations-A-plufWc.js +252 -0
- package/dist/promises/errors.gen.d.ts +12 -2
- package/dist/promises/index.d.ts +9 -3
- package/dist/promises/index.js +3 -3
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-Cd6Jamqk.js → promises---Kbh-7z.js} +745 -195
- package/dist/runtime-P0l1_2-C.js +25 -0
- package/dist/scheduled-messages-DkKZRRaN.js +207 -0
- package/dist/send-Bxc0XfGE.js +722 -0
- package/dist/service-map.d.ts +101 -15
- package/dist/subscriptions-DEXYtMXg.js +67 -0
- package/dist/templates-DZomxsG7.js +2289 -0
- package/dist/unsubscribe-groups-Iqk4Isf9.js +291 -0
- package/dist/webhooks-CPXuu8Xf.js +530 -0
- package/dist/whoami-Ccz0jwlt.js +59 -0
- package/package.json +17 -3
- package/dist/categories-BGUBFdH9.js +0 -183
- package/dist/client-CDg7zJs0.js +0 -13726
- package/dist/effect/generated.d.ts +0 -64059
- package/dist/mailboxes-BH_JPmOE.js +0 -159
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { Ct as MessageId, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, Mt as OrganizationId, Y as InternalError, c as AttachmentId, en as ValidationError, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware } from "./client-DOzUrdTE.js";
|
|
3
|
+
import { n as forGroup } from "./operation-n_IYgNVK.js";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
//#region src/effect/generated/attachments.ts
|
|
7
|
+
const AttachmentList = /* @__PURE__ */ Schema.Struct({ items: Schema.Array(Schema.Struct({
|
|
8
|
+
id: AttachmentId,
|
|
9
|
+
messageId: MessageId,
|
|
10
|
+
organizationId: OrganizationId,
|
|
11
|
+
filename: Schema.String,
|
|
12
|
+
contentType: Schema.String,
|
|
13
|
+
size: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
14
|
+
contentId: Schema.Union([Schema.String, Schema.Null]),
|
|
15
|
+
isInline: Schema.Boolean,
|
|
16
|
+
createdAt: Schema.String
|
|
17
|
+
})) }).annotate({ identifier: "AttachmentList" });
|
|
18
|
+
const AttachmentsListQuery = /* @__PURE__ */ Schema.Struct({ messageId: MessageId });
|
|
19
|
+
const AttachmentsList200 = AttachmentList;
|
|
20
|
+
const AttachmentsList401 = UnauthorizedError;
|
|
21
|
+
const AttachmentsList403 = ForbiddenError;
|
|
22
|
+
const AttachmentsList404 = ResourceNotFoundError;
|
|
23
|
+
const AttachmentsList422 = ValidationError;
|
|
24
|
+
const AttachmentsList500 = InternalError;
|
|
25
|
+
const AttachmentsList504 = GatewayTimeoutError;
|
|
26
|
+
const AttachmentsGetByIdPathParams = /* @__PURE__ */ Schema.Struct({ id: AttachmentId });
|
|
27
|
+
const AttachmentsGetById200 = /* @__PURE__ */ Schema.Struct({
|
|
28
|
+
id: AttachmentId,
|
|
29
|
+
messageId: MessageId,
|
|
30
|
+
organizationId: OrganizationId,
|
|
31
|
+
filename: Schema.String,
|
|
32
|
+
contentType: Schema.String,
|
|
33
|
+
size: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
34
|
+
contentId: Schema.Union([Schema.String, Schema.Null]),
|
|
35
|
+
isInline: Schema.Boolean,
|
|
36
|
+
createdAt: Schema.String
|
|
37
|
+
});
|
|
38
|
+
const AttachmentsGetById401 = UnauthorizedError;
|
|
39
|
+
const AttachmentsGetById403 = ForbiddenError;
|
|
40
|
+
const AttachmentsGetById404 = ResourceNotFoundError;
|
|
41
|
+
const AttachmentsGetById422 = ValidationError;
|
|
42
|
+
const AttachmentsGetById500 = InternalError;
|
|
43
|
+
const AttachmentsGetById504 = GatewayTimeoutError;
|
|
44
|
+
const AttachmentsRemovePathParams = /* @__PURE__ */ Schema.Struct({ id: AttachmentId });
|
|
45
|
+
const AttachmentsRemove200 = /* @__PURE__ */ Schema.Struct({
|
|
46
|
+
success: Schema.Boolean,
|
|
47
|
+
deletedId: AttachmentId
|
|
48
|
+
});
|
|
49
|
+
const AttachmentsRemove401 = UnauthorizedError;
|
|
50
|
+
const AttachmentsRemove403 = ForbiddenError;
|
|
51
|
+
const AttachmentsRemove404 = ResourceNotFoundError;
|
|
52
|
+
const AttachmentsRemove422 = ValidationError;
|
|
53
|
+
const AttachmentsRemove500 = InternalError;
|
|
54
|
+
const AttachmentsRemove504 = GatewayTimeoutError;
|
|
55
|
+
const AttachmentsDownloadUrlPathParams = /* @__PURE__ */ Schema.Struct({ id: AttachmentId });
|
|
56
|
+
const AttachmentsDownloadUrlQuery = /* @__PURE__ */ Schema.Struct({ expiresIn: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) });
|
|
57
|
+
const AttachmentsDownloadUrl200 = /* @__PURE__ */ Schema.Struct({
|
|
58
|
+
url: Schema.String,
|
|
59
|
+
expiresAt: Schema.String,
|
|
60
|
+
attachment: Schema.Struct({
|
|
61
|
+
id: AttachmentId,
|
|
62
|
+
messageId: MessageId,
|
|
63
|
+
organizationId: OrganizationId,
|
|
64
|
+
filename: Schema.String,
|
|
65
|
+
contentType: Schema.String,
|
|
66
|
+
size: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
67
|
+
contentId: Schema.Union([Schema.String, Schema.Null]),
|
|
68
|
+
isInline: Schema.Boolean,
|
|
69
|
+
createdAt: Schema.String
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
const AttachmentsDownloadUrl401 = UnauthorizedError;
|
|
73
|
+
const AttachmentsDownloadUrl403 = ForbiddenError;
|
|
74
|
+
const AttachmentsDownloadUrl404 = ResourceNotFoundError;
|
|
75
|
+
const AttachmentsDownloadUrl422 = ValidationError;
|
|
76
|
+
const AttachmentsDownloadUrl500 = InternalError;
|
|
77
|
+
const AttachmentsDownloadUrl504 = GatewayTimeoutError;
|
|
78
|
+
var AttachmentsGroup = class extends HttpApiGroup.make("Attachments").add(HttpApiEndpoint.get("attachmentsList", "/v1/attachments", {
|
|
79
|
+
query: AttachmentsListQuery,
|
|
80
|
+
success: AttachmentsList200,
|
|
81
|
+
error: [
|
|
82
|
+
AttachmentsList401.pipe(HttpApiSchema.status(401)),
|
|
83
|
+
AttachmentsList403.pipe(HttpApiSchema.status(403)),
|
|
84
|
+
AttachmentsList404.pipe(HttpApiSchema.status(404)),
|
|
85
|
+
AttachmentsList422.pipe(HttpApiSchema.status(422)),
|
|
86
|
+
AttachmentsList500,
|
|
87
|
+
AttachmentsList504.pipe(HttpApiSchema.status(504))
|
|
88
|
+
]
|
|
89
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "attachments.list").annotate(OpenApi.Summary, "List message attachments").annotate(OpenApi.Description, "Returns every attachment of the given message, newest first. A message's attachments all ride that one email, so the list is never paged."), HttpApiEndpoint.get("attachmentsGetById", "/v1/attachments/:id", {
|
|
90
|
+
params: AttachmentsGetByIdPathParams,
|
|
91
|
+
success: AttachmentsGetById200,
|
|
92
|
+
error: [
|
|
93
|
+
AttachmentsGetById401.pipe(HttpApiSchema.status(401)),
|
|
94
|
+
AttachmentsGetById403.pipe(HttpApiSchema.status(403)),
|
|
95
|
+
AttachmentsGetById404.pipe(HttpApiSchema.status(404)),
|
|
96
|
+
AttachmentsGetById422.pipe(HttpApiSchema.status(422)),
|
|
97
|
+
AttachmentsGetById500,
|
|
98
|
+
AttachmentsGetById504.pipe(HttpApiSchema.status(504))
|
|
99
|
+
]
|
|
100
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "attachments.getById").annotate(OpenApi.Summary, "Get an attachment").annotate(OpenApi.Description, "Returns metadata for a single attachment, including filename, content type, and size."), HttpApiEndpoint.delete("attachmentsRemove", "/v1/attachments/:id", {
|
|
101
|
+
params: AttachmentsRemovePathParams,
|
|
102
|
+
success: AttachmentsRemove200,
|
|
103
|
+
error: [
|
|
104
|
+
AttachmentsRemove401.pipe(HttpApiSchema.status(401)),
|
|
105
|
+
AttachmentsRemove403.pipe(HttpApiSchema.status(403)),
|
|
106
|
+
AttachmentsRemove404.pipe(HttpApiSchema.status(404)),
|
|
107
|
+
AttachmentsRemove422.pipe(HttpApiSchema.status(422)),
|
|
108
|
+
AttachmentsRemove500,
|
|
109
|
+
AttachmentsRemove504.pipe(HttpApiSchema.status(504))
|
|
110
|
+
]
|
|
111
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "attachments.remove").annotate(OpenApi.Summary, "Delete an attachment").annotate(OpenApi.Description, "Deletes an attachment and returns the deleted attachment's ID."), HttpApiEndpoint.get("attachmentsDownloadUrl", "/v1/attachments/:id/download-url", {
|
|
112
|
+
params: AttachmentsDownloadUrlPathParams,
|
|
113
|
+
query: AttachmentsDownloadUrlQuery,
|
|
114
|
+
success: AttachmentsDownloadUrl200,
|
|
115
|
+
error: [
|
|
116
|
+
AttachmentsDownloadUrl401.pipe(HttpApiSchema.status(401)),
|
|
117
|
+
AttachmentsDownloadUrl403.pipe(HttpApiSchema.status(403)),
|
|
118
|
+
AttachmentsDownloadUrl404.pipe(HttpApiSchema.status(404)),
|
|
119
|
+
AttachmentsDownloadUrl422.pipe(HttpApiSchema.status(422)),
|
|
120
|
+
AttachmentsDownloadUrl500,
|
|
121
|
+
AttachmentsDownloadUrl504.pipe(HttpApiSchema.status(504))
|
|
122
|
+
]
|
|
123
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "attachments.downloadUrl").annotate(OpenApi.Summary, "Get an attachment download URL").annotate(OpenApi.Description, "Generates a presigned, time-limited download URL for the attachment; expiry is configurable via the expiresIn query parameter.")).annotate(OpenApi.Description, "Email attachment metadata and secure download URLs") {};
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/effect/attachments.ts
|
|
126
|
+
var attachments_exports = /* @__PURE__ */ __exportAll({
|
|
127
|
+
downloadUrl: () => downloadUrl,
|
|
128
|
+
getById: () => getById,
|
|
129
|
+
list: () => list,
|
|
130
|
+
remove: () => remove
|
|
131
|
+
});
|
|
132
|
+
const make = forGroup(AttachmentsGroup);
|
|
133
|
+
const list = make("attachmentsList");
|
|
134
|
+
const getById = make("attachmentsGetById");
|
|
135
|
+
const remove = make("attachmentsRemove");
|
|
136
|
+
const downloadUrl = make("attachmentsDownloadUrl");
|
|
137
|
+
//#endregion
|
|
138
|
+
export { remove as a, list as i, downloadUrl as n, getById as r, attachments_exports as t };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=attachments-DYqVIraC.js.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { Ht as SuccessResponse, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, S as CreateBrand, Xt as UpdateBrand, Y as InternalError, d as BrandAssets, en as ValidationError, f as BrandFooter, m as ConflictError, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware } from "./client-DOzUrdTE.js";
|
|
3
|
+
import { n as forGroup } from "./operation-n_IYgNVK.js";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
//#region src/effect/generated/brands.ts
|
|
7
|
+
const BrandId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^brand_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
8
|
+
expected: "a string matching the RegExp ^brand_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
9
|
+
identifier: "BrandId"
|
|
10
|
+
})).pipe(Schema.brand("BrandId"));
|
|
11
|
+
const Brand = /* @__PURE__ */ Schema.Struct({
|
|
12
|
+
id: BrandId,
|
|
13
|
+
slug: Schema.String.annotate({ description: "The brand's handle, unique in the organization; `samva:brand/<slug>` names it." }).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })),
|
|
14
|
+
name: Schema.String,
|
|
15
|
+
isDefault: Schema.Boolean.annotate({ description: "Whether bare `samva:brand` and domains without a brand resolve to this brand." }),
|
|
16
|
+
css: Schema.String.annotate({ description: "Brand theme CSS: `@theme` variables, one dark-mode `@theme` of colors, and `@font-face` rules with https WOFF2 sources." }),
|
|
17
|
+
assets: BrandAssets,
|
|
18
|
+
footer: BrandFooter,
|
|
19
|
+
digest: Schema.String.annotate({ description: "SHA-256 of the brand's css, assets and footer. A publication built against a different digest predates the brand's current content." }),
|
|
20
|
+
createdAt: Schema.String,
|
|
21
|
+
updatedAt: Schema.String
|
|
22
|
+
}).annotate({ identifier: "Brand" });
|
|
23
|
+
const BrandsList200 = /* @__PURE__ */ Schema.Struct({ items: Schema.Array(Brand) }).annotate({ identifier: "BrandList" });
|
|
24
|
+
const BrandsList401 = UnauthorizedError;
|
|
25
|
+
const BrandsList403 = ForbiddenError;
|
|
26
|
+
const BrandsList422 = ValidationError;
|
|
27
|
+
const BrandsList500 = InternalError;
|
|
28
|
+
const BrandsList504 = GatewayTimeoutError;
|
|
29
|
+
const BrandsCreateRequestJson = /* @__PURE__ */ Schema.Struct({
|
|
30
|
+
slug: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })),
|
|
31
|
+
name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" })),
|
|
32
|
+
css: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(32768).annotate({ expected: "a string with at most 32768 code points" })).check(Schema.isMaxLength(32768).annotate({ expected: "a value with a length of at most 32768" })), Schema.Null])),
|
|
33
|
+
assets: Schema.optionalKey(Schema.Union([BrandAssets, Schema.Null])),
|
|
34
|
+
footer: Schema.optionalKey(Schema.Union([BrandFooter, Schema.Null])),
|
|
35
|
+
isDefault: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
|
|
36
|
+
});
|
|
37
|
+
const BrandsCreate201 = Brand;
|
|
38
|
+
const BrandsCreate401 = UnauthorizedError;
|
|
39
|
+
const BrandsCreate403 = ForbiddenError;
|
|
40
|
+
const BrandsCreate409 = ConflictError;
|
|
41
|
+
const BrandsCreate422 = ValidationError;
|
|
42
|
+
const BrandsCreate500 = InternalError;
|
|
43
|
+
const BrandsCreate504 = GatewayTimeoutError;
|
|
44
|
+
const BrandsGetPathParams = /* @__PURE__ */ Schema.Struct({ slug: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })) });
|
|
45
|
+
const BrandsGet200 = Brand;
|
|
46
|
+
const BrandsGet401 = UnauthorizedError;
|
|
47
|
+
const BrandsGet403 = ForbiddenError;
|
|
48
|
+
const BrandsGet404 = ResourceNotFoundError;
|
|
49
|
+
const BrandsGet422 = ValidationError;
|
|
50
|
+
const BrandsGet500 = InternalError;
|
|
51
|
+
const BrandsGet504 = GatewayTimeoutError;
|
|
52
|
+
const BrandsRemovePathParams = /* @__PURE__ */ Schema.Struct({ slug: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })) });
|
|
53
|
+
const BrandsRemove200 = SuccessResponse;
|
|
54
|
+
const BrandsRemove401 = UnauthorizedError;
|
|
55
|
+
const BrandsRemove403 = ForbiddenError;
|
|
56
|
+
const BrandsRemove404 = ResourceNotFoundError;
|
|
57
|
+
const BrandsRemove409 = ConflictError;
|
|
58
|
+
const BrandsRemove422 = ValidationError;
|
|
59
|
+
const BrandsRemove500 = InternalError;
|
|
60
|
+
const BrandsRemove504 = GatewayTimeoutError;
|
|
61
|
+
const BrandsUpdatePathParams = /* @__PURE__ */ Schema.Struct({ slug: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })) });
|
|
62
|
+
const BrandsUpdateRequestJson = /* @__PURE__ */ Schema.Struct({
|
|
63
|
+
newSlug: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "Renames the brand. Projects importing `samva:brand/<old slug>` stop building until they import the new slug." }).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })), Schema.Null])),
|
|
64
|
+
name: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" })), Schema.Null])),
|
|
65
|
+
css: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(32768).annotate({ expected: "a string with at most 32768 code points" })).check(Schema.isMaxLength(32768).annotate({ expected: "a value with a length of at most 32768" })), Schema.Null])),
|
|
66
|
+
assets: Schema.optionalKey(Schema.Union([BrandAssets, Schema.Null])),
|
|
67
|
+
footer: Schema.optionalKey(Schema.Union([BrandFooter, Schema.Null]))
|
|
68
|
+
});
|
|
69
|
+
const BrandsUpdate200 = Brand;
|
|
70
|
+
const BrandsUpdate401 = UnauthorizedError;
|
|
71
|
+
const BrandsUpdate403 = ForbiddenError;
|
|
72
|
+
const BrandsUpdate404 = ResourceNotFoundError;
|
|
73
|
+
const BrandsUpdate409 = ConflictError;
|
|
74
|
+
const BrandsUpdate422 = ValidationError;
|
|
75
|
+
const BrandsUpdate500 = InternalError;
|
|
76
|
+
const BrandsUpdate504 = GatewayTimeoutError;
|
|
77
|
+
const BrandsSetDefaultPathParams = /* @__PURE__ */ Schema.Struct({ slug: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })) });
|
|
78
|
+
const BrandsSetDefault200 = Brand;
|
|
79
|
+
const BrandsSetDefault401 = UnauthorizedError;
|
|
80
|
+
const BrandsSetDefault403 = ForbiddenError;
|
|
81
|
+
const BrandsSetDefault404 = ResourceNotFoundError;
|
|
82
|
+
const BrandsSetDefault422 = ValidationError;
|
|
83
|
+
const BrandsSetDefault500 = InternalError;
|
|
84
|
+
const BrandsSetDefault504 = GatewayTimeoutError;
|
|
85
|
+
var BrandsGroup = class extends HttpApiGroup.make("Brands").add(HttpApiEndpoint.get("brandsList", "/v1/brands", {
|
|
86
|
+
success: BrandsList200,
|
|
87
|
+
error: [
|
|
88
|
+
BrandsList401.pipe(HttpApiSchema.status(401)),
|
|
89
|
+
BrandsList403.pipe(HttpApiSchema.status(403)),
|
|
90
|
+
BrandsList422.pipe(HttpApiSchema.status(422)),
|
|
91
|
+
BrandsList500,
|
|
92
|
+
BrandsList504.pipe(HttpApiSchema.status(504))
|
|
93
|
+
]
|
|
94
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "brands.list").annotate(OpenApi.Summary, "List brands").annotate(OpenApi.Description, "Returns the organization's brands, the default brand first."), HttpApiEndpoint.post("brandsCreate", "/v1/brands", {
|
|
95
|
+
payload: BrandsCreateRequestJson,
|
|
96
|
+
success: BrandsCreate201.pipe(HttpApiSchema.status(201)),
|
|
97
|
+
error: [
|
|
98
|
+
BrandsCreate401.pipe(HttpApiSchema.status(401)),
|
|
99
|
+
BrandsCreate403.pipe(HttpApiSchema.status(403)),
|
|
100
|
+
BrandsCreate409.pipe(HttpApiSchema.status(409)),
|
|
101
|
+
BrandsCreate422.pipe(HttpApiSchema.status(422)),
|
|
102
|
+
BrandsCreate500,
|
|
103
|
+
BrandsCreate504.pipe(HttpApiSchema.status(504))
|
|
104
|
+
]
|
|
105
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "brands.create").annotate(OpenApi.Summary, "Create a brand").annotate(OpenApi.Description, "Creates a brand. The CSS must parse as a brand theme; a rejected theme answers 422 with located findings under `fields.css`. With `isDefault`, the new brand becomes the default. An organization holds at most 12 brands; creating one more answers 409 with a `ConflictError`."), HttpApiEndpoint.get("brandsGet", "/v1/brands/:slug", {
|
|
106
|
+
params: BrandsGetPathParams,
|
|
107
|
+
success: BrandsGet200,
|
|
108
|
+
error: [
|
|
109
|
+
BrandsGet401.pipe(HttpApiSchema.status(401)),
|
|
110
|
+
BrandsGet403.pipe(HttpApiSchema.status(403)),
|
|
111
|
+
BrandsGet404.pipe(HttpApiSchema.status(404)),
|
|
112
|
+
BrandsGet422.pipe(HttpApiSchema.status(422)),
|
|
113
|
+
BrandsGet500,
|
|
114
|
+
BrandsGet504.pipe(HttpApiSchema.status(504))
|
|
115
|
+
]
|
|
116
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "brands.get").annotate(OpenApi.Summary, "Get a brand").annotate(OpenApi.Description, "Returns one brand by its slug."), HttpApiEndpoint.delete("brandsRemove", "/v1/brands/:slug", {
|
|
117
|
+
params: BrandsRemovePathParams,
|
|
118
|
+
success: BrandsRemove200,
|
|
119
|
+
error: [
|
|
120
|
+
BrandsRemove401.pipe(HttpApiSchema.status(401)),
|
|
121
|
+
BrandsRemove403.pipe(HttpApiSchema.status(403)),
|
|
122
|
+
BrandsRemove404.pipe(HttpApiSchema.status(404)),
|
|
123
|
+
BrandsRemove409.pipe(HttpApiSchema.status(409)),
|
|
124
|
+
BrandsRemove422.pipe(HttpApiSchema.status(422)),
|
|
125
|
+
BrandsRemove500,
|
|
126
|
+
BrandsRemove504.pipe(HttpApiSchema.status(504))
|
|
127
|
+
]
|
|
128
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "brands.remove").annotate(OpenApi.Summary, "Delete a brand").annotate(OpenApi.Description, "Deletes a brand. The default brand cannot be deleted; domains that used the deleted brand fall back to the default."), HttpApiEndpoint.patch("brandsUpdate", "/v1/brands/:slug", {
|
|
129
|
+
params: BrandsUpdatePathParams,
|
|
130
|
+
payload: BrandsUpdateRequestJson,
|
|
131
|
+
success: BrandsUpdate200,
|
|
132
|
+
error: [
|
|
133
|
+
BrandsUpdate401.pipe(HttpApiSchema.status(401)),
|
|
134
|
+
BrandsUpdate403.pipe(HttpApiSchema.status(403)),
|
|
135
|
+
BrandsUpdate404.pipe(HttpApiSchema.status(404)),
|
|
136
|
+
BrandsUpdate409.pipe(HttpApiSchema.status(409)),
|
|
137
|
+
BrandsUpdate422.pipe(HttpApiSchema.status(422)),
|
|
138
|
+
BrandsUpdate500,
|
|
139
|
+
BrandsUpdate504.pipe(HttpApiSchema.status(504))
|
|
140
|
+
]
|
|
141
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "brands.update").annotate(OpenApi.Summary, "Update a brand").annotate(OpenApi.Description, "Updates a brand. Each section given replaces that section whole. Published templates keep the brand they were built against until they are republished."), HttpApiEndpoint.post("brandsSetDefault", "/v1/brands/:slug/default", {
|
|
142
|
+
params: BrandsSetDefaultPathParams,
|
|
143
|
+
success: BrandsSetDefault200,
|
|
144
|
+
error: [
|
|
145
|
+
BrandsSetDefault401.pipe(HttpApiSchema.status(401)),
|
|
146
|
+
BrandsSetDefault403.pipe(HttpApiSchema.status(403)),
|
|
147
|
+
BrandsSetDefault404.pipe(HttpApiSchema.status(404)),
|
|
148
|
+
BrandsSetDefault422.pipe(HttpApiSchema.status(422)),
|
|
149
|
+
BrandsSetDefault500,
|
|
150
|
+
BrandsSetDefault504.pipe(HttpApiSchema.status(504))
|
|
151
|
+
]
|
|
152
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "brands.setDefault").annotate(OpenApi.Summary, "Make a brand the default").annotate(OpenApi.Description, "Makes this brand the organization's default: bare `samva:brand` and domains without a brand resolve to it at their next build or send.")).annotate(OpenApi.Description, "Brand themes, logos and footers that templates import with `samva:brand`.") {};
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/effect/brands.ts
|
|
155
|
+
var brands_exports = /* @__PURE__ */ __exportAll({
|
|
156
|
+
CreatePayload: () => CreateBrand,
|
|
157
|
+
UpdatePayload: () => UpdateBrand,
|
|
158
|
+
create: () => create,
|
|
159
|
+
get: () => get,
|
|
160
|
+
list: () => list,
|
|
161
|
+
remove: () => remove,
|
|
162
|
+
setDefault: () => setDefault,
|
|
163
|
+
update: () => update
|
|
164
|
+
});
|
|
165
|
+
const make = forGroup(BrandsGroup);
|
|
166
|
+
const list = make("brandsList");
|
|
167
|
+
const create = make("brandsCreate");
|
|
168
|
+
const get = make("brandsGet");
|
|
169
|
+
const update = make("brandsUpdate");
|
|
170
|
+
const remove = make("brandsRemove");
|
|
171
|
+
const setDefault = make("brandsSetDefault");
|
|
172
|
+
//#endregion
|
|
173
|
+
export { remove as a, list as i, create as n, setDefault as o, get as r, update as s, brands_exports as t };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=brands-ZwuOGIWO.js.map
|