ad2app-lib 1.49.0 → 1.59.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/analytics/index.d.ts +85 -2
- package/dist/analytics/index.js +26 -0
- package/dist/types/I_AccessDenial.d.ts +7 -0
- package/dist/types/I_AccessDenial.js +7 -0
- package/dist/types/agency-campaigns.d.ts +108 -5
- package/dist/types/agency-campaigns.js +111 -5
- package/dist/types/agency-pots.d.ts +518 -0
- package/dist/types/agency-pots.js +393 -0
- package/dist/types/agency-threads.d.ts +22 -1
- package/dist/types/agency.d.ts +93 -6
- package/dist/types/agency.js +70 -3
- package/dist/types/dealroom.d.ts +651 -0
- package/dist/types/dealroom.js +387 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -0
- package/package.json +1 -1
- package/src/analytics/index.test.ts +23 -1
- package/src/analytics/index.ts +69 -2
- package/src/types/I_AccessDenial.ts +7 -0
- package/src/types/access-denial.test.ts +2 -1
- package/src/types/agency-campaigns.ts +187 -5
- package/src/types/agency-pots.test.ts +255 -0
- package/src/types/agency-pots.ts +751 -0
- package/src/types/agency-threads.ts +14 -3
- package/src/types/agency.ts +120 -7
- package/src/types/consumer-compat.test.ts +90 -0
- package/src/types/dealroom-audit1.test.ts +56 -0
- package/src/types/dealroom-wave2.test.ts +61 -0
- package/src/types/dealroom-wave3.test.ts +68 -0
- package/src/types/dealroom-wave4.test.ts +103 -0
- package/src/types/dealroom.test.ts +231 -0
- package/src/types/dealroom.ts +868 -0
- package/src/types/index.ts +4 -0
package/dist/types/agency.js
CHANGED
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AdminSetOrganizationStatusDto = exports.UpdateAgencyDiscoverableDto = exports.AgencyAccessRequestDto = exports.AgencyDiscoverQueryDto = exports.SponsorCreatorDto = exports.UpdateGrantScopesDto = exports.AcceptGrantDto = exports.AcceptAgencyMemberInviteDto = exports.RedeemAgencyInviteDto = exports.InviteAgencyMemberDto = exports.CreateAgencyOrganizationDto = exports.AGENCY_ROSTER_METRICS_STATES = exports.AGENCY_ROSTER_NEEDS_ATTENTION_STATES = exports.AGENCY_ROSTER_ROW_STATES = exports.AGENCY_REQUEST_CODES = exports.CREATOR_ACCESS_GRANT_STATES = exports.AGENCY_ORGANIZATION_STATUSES = exports.isAgencyGrantScope = exports.AGENCY_GRANT_SCOPES = exports.AGENCY_ROUTE_PATHS = void 0;
|
|
12
|
+
exports.AdminSetOrganizationStatusDto = exports.UpdateAgencyDiscoverableDto = exports.AgencyAccessRequestDto = exports.AgencyDiscoverQueryDto = exports.SponsorCreatorDto = exports.ACTING_FOR_HEADER = exports.UpdateGrantScopesDto = exports.AcceptGrantDto = exports.AcceptAgencyMemberInviteDto = exports.RedeemAgencyInviteDto = exports.InviteAgencyMemberDto = exports.CreateAgencyOrganizationDto = exports.AGENCY_ROSTER_METRICS_STATES = exports.AGENCY_ROSTER_NEEDS_ATTENTION_STATES = exports.AGENCY_ROSTER_ROW_STATES = exports.AGENCY_REQUEST_CODES = exports.CREATOR_ACCESS_GRANT_ORIGINS = exports.CREATOR_ACCESS_GRANT_STATES = exports.AGENCY_ORGANIZATION_STATUSES = exports.AGENCY_ORGANIZATION_TYPES = exports.isGrantScope = exports.DELEGATION_SCOPES = exports.isAgencyGrantScope = exports.AGENCY_GRANT_SCOPES = exports.AGENCY_ROUTE_PATHS = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
// ── Cross-repo route constants ───────────────────────────────────────────────
|
|
15
15
|
/**
|
|
@@ -61,6 +61,27 @@ exports.AGENCY_GRANT_SCOPES = [
|
|
|
61
61
|
*/
|
|
62
62
|
const isAgencyGrantScope = (value) => exports.AGENCY_GRANT_SCOPES.includes(value);
|
|
63
63
|
exports.isAgencyGrantScope = isAgencyGrantScope;
|
|
64
|
+
/**
|
|
65
|
+
* Delegation (spec 148 FR-017a): the one scope that reaches WRITES, and only
|
|
66
|
+
* the creator-side deal acts (apply, offer acts, materials, the deal thread).
|
|
67
|
+
*
|
|
68
|
+
* Kept OUT of AGENCY_GRANT_SCOPES on purpose: that list is what an
|
|
69
|
+
* organization may ASK for, and no organization ever asks for this. Only the
|
|
70
|
+
* creator adds it to `grantedScopes`, which makes it the one exception to
|
|
71
|
+
* "granted is a subset of requested". Publishing, contract signature,
|
|
72
|
+
* payouts, the settlement form and platforms stay unreachable through it.
|
|
73
|
+
*/
|
|
74
|
+
exports.DELEGATION_SCOPES = ['deals'];
|
|
75
|
+
/** Narrowing guard over both sets; an unrecognised scope fails closed. */
|
|
76
|
+
const isGrantScope = (value) => (0, exports.isAgencyGrantScope)(value) || exports.DELEGATION_SCOPES.includes(value);
|
|
77
|
+
exports.isGrantScope = isGrantScope;
|
|
78
|
+
// ── Organization ─────────────────────────────────────────────────────────────
|
|
79
|
+
/**
|
|
80
|
+
* `'brand'` arrived with spec 148 (US2): one column, no enum table. A brand
|
|
81
|
+
* authors campaigns like an agency but has no roster; it is created only
|
|
82
|
+
* while the backend's brand door is open.
|
|
83
|
+
*/
|
|
84
|
+
exports.AGENCY_ORGANIZATION_TYPES = ['agency', 'brand'];
|
|
64
85
|
/**
|
|
65
86
|
* `closed` was added by the 2026-09-21 requirements review (FR-004b).
|
|
66
87
|
*
|
|
@@ -91,6 +112,12 @@ exports.CREATOR_ACCESS_GRANT_STATES = [
|
|
|
91
112
|
'expired',
|
|
92
113
|
'revoked',
|
|
93
114
|
];
|
|
115
|
+
/**
|
|
116
|
+
* `dealroom_application` (spec 148): created or widened when the creator
|
|
117
|
+
* applies to an open listing. The system revokes a grant of this origin, and
|
|
118
|
+
* only of this origin, when that deal ends.
|
|
119
|
+
*/
|
|
120
|
+
exports.CREATOR_ACCESS_GRANT_ORIGINS = ['invite_link', 'agency_request', 'dealroom_application'];
|
|
94
121
|
/**
|
|
95
122
|
* Outcomes of discovery and requests that are not refusals of access, sent as
|
|
96
123
|
* codes so the screen composes the sentence in the reader's language (FR-019,
|
|
@@ -171,6 +198,8 @@ exports.AGENCY_ROSTER_METRICS_STATES = [
|
|
|
171
198
|
*/
|
|
172
199
|
class CreateAgencyOrganizationDto {
|
|
173
200
|
constructor(data) {
|
|
201
|
+
this.type = data?.type;
|
|
202
|
+
this.paymentMethodId = data?.paymentMethodId;
|
|
174
203
|
this.name = data?.name ?? '';
|
|
175
204
|
this.website = data?.website;
|
|
176
205
|
this.registryId = data?.registryId ?? '';
|
|
@@ -203,6 +232,17 @@ __decorate([
|
|
|
203
232
|
(0, class_validator_1.IsEmail)(),
|
|
204
233
|
__metadata("design:type", String)
|
|
205
234
|
], CreateAgencyOrganizationDto.prototype, "contactEmail", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
(0, class_validator_1.IsOptional)(),
|
|
237
|
+
(0, class_validator_1.IsIn)(exports.AGENCY_ORGANIZATION_TYPES),
|
|
238
|
+
__metadata("design:type", String)
|
|
239
|
+
], CreateAgencyOrganizationDto.prototype, "type", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, class_validator_1.IsOptional)(),
|
|
242
|
+
(0, class_validator_1.IsString)(),
|
|
243
|
+
(0, class_validator_1.Matches)(/^pm_[A-Za-z0-9]{1,200}$/),
|
|
244
|
+
__metadata("design:type", String)
|
|
245
|
+
], CreateAgencyOrganizationDto.prototype, "paymentMethodId", void 0);
|
|
206
246
|
class InviteAgencyMemberDto {
|
|
207
247
|
constructor(data) {
|
|
208
248
|
this.email = data?.email ?? '';
|
|
@@ -265,19 +305,46 @@ __decorate([
|
|
|
265
305
|
(0, class_validator_1.IsIn)(exports.AGENCY_GRANT_SCOPES, { each: true }),
|
|
266
306
|
__metadata("design:type", Array)
|
|
267
307
|
], AcceptGrantDto.prototype, "scopes", void 0);
|
|
268
|
-
/**
|
|
308
|
+
/**
|
|
309
|
+
* The creator narrowing or widening a live grant — the only other write path.
|
|
310
|
+
*
|
|
311
|
+
* `scopes` are the READS only; `deals` is never one of them (it stays out of
|
|
312
|
+
* AGENCY_GRANT_SCOPES). Delegation (spec 148 FR-017a) is its own field, so the
|
|
313
|
+
* data-access screen, which saves reads, can never drop it by omission:
|
|
314
|
+
*
|
|
315
|
+
* - `deals` absent ⇒ delegation unchanged (a reads-only save keeps `deals`);
|
|
316
|
+
* - `deals: true` ⇒ added, `deals: false` ⇒ removed;
|
|
317
|
+
* - `scopes` may be left out when `deals` is sent ⇒ the reads stay as they are.
|
|
318
|
+
*/
|
|
269
319
|
class UpdateGrantScopesDto {
|
|
270
320
|
constructor(data) {
|
|
271
|
-
|
|
321
|
+
// Undefined when not given (never []): class-transformer builds the body
|
|
322
|
+
// with an empty construct, and a default would make `{ deals: true }` fail.
|
|
323
|
+
if (data?.scopes !== undefined)
|
|
324
|
+
this.scopes = data.scopes;
|
|
325
|
+
if (data?.deals !== undefined)
|
|
326
|
+
this.deals = data.deals;
|
|
272
327
|
}
|
|
273
328
|
}
|
|
274
329
|
exports.UpdateGrantScopesDto = UpdateGrantScopesDto;
|
|
275
330
|
__decorate([
|
|
331
|
+
(0, class_validator_1.ValidateIf)((dto) => dto.deals === undefined || dto.scopes !== undefined),
|
|
276
332
|
(0, class_validator_1.IsArray)(),
|
|
277
333
|
(0, class_validator_1.ArrayNotEmpty)(),
|
|
278
334
|
(0, class_validator_1.IsIn)(exports.AGENCY_GRANT_SCOPES, { each: true }),
|
|
279
335
|
__metadata("design:type", Array)
|
|
280
336
|
], UpdateGrantScopesDto.prototype, "scopes", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
(0, class_validator_1.IsOptional)(),
|
|
339
|
+
(0, class_validator_1.IsBoolean)(),
|
|
340
|
+
__metadata("design:type", Boolean)
|
|
341
|
+
], UpdateGrantScopesDto.prototype, "deals", void 0);
|
|
342
|
+
/**
|
|
343
|
+
* Spec 148 US8: the header a delegate names the creator with on the
|
|
344
|
+
* creator-side deal routes (`X-Acting-For: <creatorUserId>`). Every other
|
|
345
|
+
* route refuses a request that carries it (`dealroom-delegate-forbidden`).
|
|
346
|
+
*/
|
|
347
|
+
exports.ACTING_FOR_HEADER = 'x-acting-for';
|
|
281
348
|
class SponsorCreatorDto {
|
|
282
349
|
constructor(data) {
|
|
283
350
|
this.tier = data?.tier ?? 'starter';
|