@adcp/sdk 15.5.0 → 15.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 +15 -0
- package/dist/lib/auth/oauth/index.d.mts +1 -0
- package/dist/lib/auth/oauth/index.d.ts +1 -0
- package/dist/lib/auth/oauth/index.js +5 -0
- package/dist/lib/auth/oauth/index.mjs +3 -0
- package/dist/lib/auth/oauth/pending-web-flow.d.mts +16 -0
- package/dist/lib/auth/oauth/pending-web-flow.d.ts +16 -0
- package/dist/lib/auth/oauth/pending-web-flow.js +66 -0
- package/dist/lib/auth/oauth/pending-web-flow.mjs +41 -0
- package/dist/lib/auth/oauth/web-flow.js +3 -3
- package/dist/lib/auth/oauth/web-flow.mjs +3 -3
- package/dist/lib/registry/types.generated.d.mts +63 -1
- package/dist/lib/registry/types.generated.d.ts +63 -1
- package/dist/lib/reporting/azure/index.d.mts +26 -0
- package/dist/lib/reporting/azure/index.d.ts +26 -0
- package/dist/lib/reporting/azure/index.js +247 -0
- package/dist/lib/reporting/azure/index.mjs +230 -0
- package/dist/lib/reporting/bigquery/index.d.mts +127 -0
- package/dist/lib/reporting/bigquery/index.d.ts +127 -0
- package/dist/lib/reporting/bigquery/index.js +379 -0
- package/dist/lib/reporting/bigquery/index.mjs +341 -0
- package/dist/lib/reporting/ledger/postgres.d.mts +10 -0
- package/dist/lib/reporting/ledger/postgres.d.ts +10 -0
- package/dist/lib/reporting/ledger/postgres.js +23 -2
- package/dist/lib/reporting/ledger/postgres.mjs +23 -2
- package/dist/lib/reporting/ledger/row-storage-object.js +31 -8
- package/dist/lib/reporting/ledger/row-storage-object.mjs +32 -9
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.mts +0 -7
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.ts +0 -7
- package/dist/lib/reporting/ledger/row-storage-provider-io.js +0 -10
- package/dist/lib/reporting/ledger/row-storage-provider-io.mjs +0 -8
- package/dist/lib/reporting/s3/index.d.mts +29 -0
- package/dist/lib/reporting/s3/index.d.ts +29 -0
- package/dist/lib/reporting/s3/index.js +324 -0
- package/dist/lib/reporting/s3/index.mjs +317 -0
- package/dist/lib/reporting/service/index.d.mts +3 -1
- package/dist/lib/reporting/service/index.d.ts +3 -1
- package/dist/lib/reporting/service/index.js +1 -0
- package/dist/lib/reporting/service/index.mjs +1 -0
- package/dist/lib/schemas/browser.d.mts +14 -0
- package/dist/lib/schemas/browser.d.ts +14 -0
- package/dist/lib/schemas/browser.js +48 -0
- package/dist/lib/schemas/browser.mjs +20 -0
- package/dist/lib/schemas/index.d.mts +2 -120
- package/dist/lib/schemas/index.d.ts +2 -120
- package/dist/lib/schemas/index.js +3 -11
- package/dist/lib/schemas/index.mjs +1 -9
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/testing/index.d.mts +1 -0
- package/dist/lib/testing/index.d.ts +1 -0
- package/dist/lib/testing/index.js +3 -0
- package/dist/lib/testing/index.mjs +2 -0
- package/dist/lib/testing/pending-web-flow-store.d.mts +20 -0
- package/dist/lib/testing/pending-web-flow-store.d.ts +20 -0
- package/dist/lib/testing/pending-web-flow-store.js +132 -0
- package/dist/lib/testing/pending-web-flow-store.mjs +98 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/validation/get-products-request.d.mts +122 -0
- package/dist/lib/validation/get-products-request.d.ts +122 -0
- package/dist/lib/validation/get-products-request.js +39 -0
- package/dist/lib/validation/get-products-request.mjs +14 -0
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +1 -1
- package/docs/ZOD-SCHEMAS.md +13 -1
- package/docs/guides/OAUTH-ISSUER-BINDING.md +6 -0
- package/docs/guides/REPORTING-LEDGER.md +165 -0
- package/docs/guides/REPORTING-OPERATIONS.md +76 -1
- package/docs/guides/WEB-OAUTH.md +48 -1
- package/docs/llms.txt +1 -1
- package/docs/migration-14.x-rc-worksheet.md +6 -4
- package/package.json +64 -1
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
*/
|
|
42
42
|
import { z } from 'zod';
|
|
43
43
|
import * as schemas from '../types/schemas.generated';
|
|
44
|
-
import type { CanonicalGetProductsRequest } from '../v2/projection/creative-delivery';
|
|
45
44
|
import type { KnownToolRequestSchemas } from '../utils/tool-request-schemas';
|
|
46
45
|
import { getSchemaDocumentByRef, type Direction, type ResolvedToolSchemaDocument, type ResponseVariant } from '../validation/schema-loader';
|
|
47
46
|
import type { ValidateFunction } from 'ajv';
|
|
@@ -49,125 +48,8 @@ export * from '../types/schemas.generated';
|
|
|
49
48
|
export { AgentOAuthClientCredentialsSchema } from '../auth/oauth/client-credentials-schema';
|
|
50
49
|
export type { AgentOAuthClientCredentials } from '../types/adcp';
|
|
51
50
|
export type { PlacementPresentationDocument, PlacementPresentationReference } from '../types/core.generated';
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
type ZodShapeOutput<U extends z.core.$ZodShape> = {
|
|
56
|
-
[K in keyof U as undefined extends z.output<U[K]> ? never : K]: z.output<U[K]>;
|
|
57
|
-
} & {
|
|
58
|
-
[K in keyof U as undefined extends z.output<U[K]> ? K : never]?: z.output<U[K]>;
|
|
59
|
-
};
|
|
60
|
-
/** Portable loose-object facade retained across adopter declaration emit. */
|
|
61
|
-
export type LooseObjectSchemaFor<T extends object> = {
|
|
62
|
-
extend<U extends z.core.$ZodShape>(shape: U): LooseObjectSchemaFor<Omit<T, keyof U> & ZodShapeOutput<U>>;
|
|
63
|
-
} & z.ZodObject<LooseObjectShapeFor<T>, z.core.$loose> & z.ZodType<T & Record<string, unknown>, T & Record<string, unknown>>;
|
|
64
|
-
/** Wire-compatible request schema, including the legacy `format_ids` selector. */
|
|
65
|
-
export declare const LegacyGetProductsRequestSchema: z.ZodObject<{
|
|
66
|
-
adcp_version: z.ZodOptional<z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
67
|
-
adcp_major_version: z.ZodOptional<z.ZodType<number, number, z.core.$ZodTypeInternals<number, number>>>;
|
|
68
|
-
idempotency_key: z.ZodOptional<z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
69
|
-
buying_mode: z.ZodType<"brief" | "wholesale" | "refine", "brief" | "wholesale" | "refine", z.core.$ZodTypeInternals<"brief" | "wholesale" | "refine", "brief" | "wholesale" | "refine">>;
|
|
70
|
-
brief: z.ZodOptional<z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
71
|
-
refine: z.ZodOptional<z.ZodType<({
|
|
72
|
-
scope: "request";
|
|
73
|
-
ask: string;
|
|
74
|
-
} | {
|
|
75
|
-
scope: "product";
|
|
76
|
-
product_id: string;
|
|
77
|
-
action?: "include" | "omit" | "more_like_this";
|
|
78
|
-
ask?: string;
|
|
79
|
-
} | {
|
|
80
|
-
scope: "proposal";
|
|
81
|
-
proposal_id: string;
|
|
82
|
-
action?: "include" | "omit" | "finalize";
|
|
83
|
-
ask?: string;
|
|
84
|
-
})[], ({
|
|
85
|
-
scope: "request";
|
|
86
|
-
ask: string;
|
|
87
|
-
} | {
|
|
88
|
-
scope: "product";
|
|
89
|
-
product_id: string;
|
|
90
|
-
action?: "include" | "omit" | "more_like_this";
|
|
91
|
-
ask?: string;
|
|
92
|
-
} | {
|
|
93
|
-
scope: "proposal";
|
|
94
|
-
proposal_id: string;
|
|
95
|
-
action?: "include" | "omit" | "finalize";
|
|
96
|
-
ask?: string;
|
|
97
|
-
})[], z.core.$ZodTypeInternals<({
|
|
98
|
-
scope: "request";
|
|
99
|
-
ask: string;
|
|
100
|
-
} | {
|
|
101
|
-
scope: "product";
|
|
102
|
-
product_id: string;
|
|
103
|
-
action?: "include" | "omit" | "more_like_this";
|
|
104
|
-
ask?: string;
|
|
105
|
-
} | {
|
|
106
|
-
scope: "proposal";
|
|
107
|
-
proposal_id: string;
|
|
108
|
-
action?: "include" | "omit" | "finalize";
|
|
109
|
-
ask?: string;
|
|
110
|
-
})[], ({
|
|
111
|
-
scope: "request";
|
|
112
|
-
ask: string;
|
|
113
|
-
} | {
|
|
114
|
-
scope: "product";
|
|
115
|
-
product_id: string;
|
|
116
|
-
action?: "include" | "omit" | "more_like_this";
|
|
117
|
-
ask?: string;
|
|
118
|
-
} | {
|
|
119
|
-
scope: "proposal";
|
|
120
|
-
proposal_id: string;
|
|
121
|
-
action?: "include" | "omit" | "finalize";
|
|
122
|
-
ask?: string;
|
|
123
|
-
})[]>>>;
|
|
124
|
-
brand: z.ZodOptional<z.ZodType<import("../types/core.generated").BrandReference, import("../types/core.generated").BrandReference, z.core.$ZodTypeInternals<import("../types/core.generated").BrandReference, import("../types/core.generated").BrandReference>>>;
|
|
125
|
-
acceptance_context: z.ZodOptional<z.ZodType<import("../types/tools.generated").AcceptanceContext, import("../types/tools.generated").AcceptanceContext, z.core.$ZodTypeInternals<import("../types/tools.generated").AcceptanceContext, import("../types/tools.generated").AcceptanceContext>>>;
|
|
126
|
-
catalog: z.ZodOptional<z.ZodType<import("..").Catalog, import("..").Catalog, z.core.$ZodTypeInternals<import("..").Catalog, import("..").Catalog>>>;
|
|
127
|
-
account: z.ZodOptional<z.ZodType<import("../types/core.generated").AccountReference, import("../types/core.generated").AccountReference, z.core.$ZodTypeInternals<import("../types/core.generated").AccountReference, import("../types/core.generated").AccountReference>>>;
|
|
128
|
-
preferred_delivery_types: z.ZodOptional<z.ZodType<import("../types/core.generated").DeliveryType[], import("../types/core.generated").DeliveryType[], z.core.$ZodTypeInternals<import("../types/core.generated").DeliveryType[], import("../types/core.generated").DeliveryType[]>>>;
|
|
129
|
-
filters: z.ZodOptional<z.ZodType<import("../types/tools.generated").ProductFilters, import("../types/tools.generated").ProductFilters, z.core.$ZodTypeInternals<import("../types/tools.generated").ProductFilters, import("../types/tools.generated").ProductFilters>>>;
|
|
130
|
-
targeting_overlay: z.ZodOptional<z.ZodType<import("..").TargetingOverlay, import("..").TargetingOverlay, z.core.$ZodTypeInternals<import("..").TargetingOverlay, import("..").TargetingOverlay>>>;
|
|
131
|
-
media_buy_frequency_cap: z.ZodOptional<z.ZodType<{
|
|
132
|
-
suppress?: import("..").Duration;
|
|
133
|
-
suppress_minutes?: number;
|
|
134
|
-
max_impressions?: number;
|
|
135
|
-
per?: import("../types/core.generated").ReachUnit;
|
|
136
|
-
window?: import("..").Duration;
|
|
137
|
-
}, {
|
|
138
|
-
suppress?: import("..").Duration;
|
|
139
|
-
suppress_minutes?: number;
|
|
140
|
-
max_impressions?: number;
|
|
141
|
-
per?: import("../types/core.generated").ReachUnit;
|
|
142
|
-
window?: import("..").Duration;
|
|
143
|
-
}, z.core.$ZodTypeInternals<{
|
|
144
|
-
suppress?: import("..").Duration;
|
|
145
|
-
suppress_minutes?: number;
|
|
146
|
-
max_impressions?: number;
|
|
147
|
-
per?: import("../types/core.generated").ReachUnit;
|
|
148
|
-
window?: import("..").Duration;
|
|
149
|
-
}, {
|
|
150
|
-
suppress?: import("..").Duration;
|
|
151
|
-
suppress_minutes?: number;
|
|
152
|
-
max_impressions?: number;
|
|
153
|
-
per?: import("../types/core.generated").ReachUnit;
|
|
154
|
-
window?: import("..").Duration;
|
|
155
|
-
}>>>;
|
|
156
|
-
required_overlay_support: z.ZodOptional<z.ZodType<import("../types/core.generated").TargetingOverlayRequirements, import("../types/core.generated").TargetingOverlayRequirements, z.core.$ZodTypeInternals<import("../types/core.generated").TargetingOverlayRequirements, import("../types/core.generated").TargetingOverlayRequirements>>>;
|
|
157
|
-
required_media_buy_support: z.ZodOptional<z.ZodType<import("../types/tools.generated").ProductMediaBuySupportRequirements, import("../types/tools.generated").ProductMediaBuySupportRequirements, z.core.$ZodTypeInternals<import("../types/tools.generated").ProductMediaBuySupportRequirements, import("../types/tools.generated").ProductMediaBuySupportRequirements>>>;
|
|
158
|
-
property_list: z.ZodOptional<z.ZodType<import("../types/tools.generated").PropertyListReference, import("../types/tools.generated").PropertyListReference, z.core.$ZodTypeInternals<import("../types/tools.generated").PropertyListReference, import("../types/tools.generated").PropertyListReference>>>;
|
|
159
|
-
fields: z.ZodOptional<z.ZodType<("name" | "identity" | "forecast" | "description" | "publisher_properties" | "audience_evidence" | "product_id" | "channels" | "video_placement_types" | "audio_distribution_types" | "sponsored_placement_types" | "social_placement_surfaces" | "format_options" | "placements" | "delivery_type" | "exclusivity" | "pricing_options" | "reporting_capabilities" | "measurement_terms" | "performance_standards" | "catalog_types" | "signal_targeting_allowed" | "signal_targeting_rules" | "demographic_targeting" | "overlay_support" | "collections" | "collection_targeting_allowed" | "media_buy_support" | "audience_evidence_selections" | "max_optimization_goals" | "catalog_match" | "list_applications" | "brief_relevance" | "targeting_resolution" | "acceptance_policy_profile_ids" | "execution_requirements" | "expires_at" | "allowed_actions" | "product_card" | "format_ids" | "outcome_measurement" | "delivery_measurement" | "creative_policy" | "metric_optimization" | "conversion_tracking" | "data_provider_signals" | "included_signals" | "signal_targeting_options" | "installments" | "is_custom" | "product_card_detailed" | "enforced_policies" | "trusted_match")[], ("name" | "identity" | "forecast" | "description" | "publisher_properties" | "audience_evidence" | "product_id" | "channels" | "video_placement_types" | "audio_distribution_types" | "sponsored_placement_types" | "social_placement_surfaces" | "format_options" | "placements" | "delivery_type" | "exclusivity" | "pricing_options" | "reporting_capabilities" | "measurement_terms" | "performance_standards" | "catalog_types" | "signal_targeting_allowed" | "signal_targeting_rules" | "demographic_targeting" | "overlay_support" | "collections" | "collection_targeting_allowed" | "media_buy_support" | "audience_evidence_selections" | "max_optimization_goals" | "catalog_match" | "list_applications" | "brief_relevance" | "targeting_resolution" | "acceptance_policy_profile_ids" | "execution_requirements" | "expires_at" | "allowed_actions" | "product_card" | "format_ids" | "outcome_measurement" | "delivery_measurement" | "creative_policy" | "metric_optimization" | "conversion_tracking" | "data_provider_signals" | "included_signals" | "signal_targeting_options" | "installments" | "is_custom" | "product_card_detailed" | "enforced_policies" | "trusted_match")[], z.core.$ZodTypeInternals<("name" | "identity" | "forecast" | "description" | "publisher_properties" | "audience_evidence" | "product_id" | "channels" | "video_placement_types" | "audio_distribution_types" | "sponsored_placement_types" | "social_placement_surfaces" | "format_options" | "placements" | "delivery_type" | "exclusivity" | "pricing_options" | "reporting_capabilities" | "measurement_terms" | "performance_standards" | "catalog_types" | "signal_targeting_allowed" | "signal_targeting_rules" | "demographic_targeting" | "overlay_support" | "collections" | "collection_targeting_allowed" | "media_buy_support" | "audience_evidence_selections" | "max_optimization_goals" | "catalog_match" | "list_applications" | "brief_relevance" | "targeting_resolution" | "acceptance_policy_profile_ids" | "execution_requirements" | "expires_at" | "allowed_actions" | "product_card" | "format_ids" | "outcome_measurement" | "delivery_measurement" | "creative_policy" | "metric_optimization" | "conversion_tracking" | "data_provider_signals" | "included_signals" | "signal_targeting_options" | "installments" | "is_custom" | "product_card_detailed" | "enforced_policies" | "trusted_match")[], ("name" | "identity" | "forecast" | "description" | "publisher_properties" | "audience_evidence" | "product_id" | "channels" | "video_placement_types" | "audio_distribution_types" | "sponsored_placement_types" | "social_placement_surfaces" | "format_options" | "placements" | "delivery_type" | "exclusivity" | "pricing_options" | "reporting_capabilities" | "measurement_terms" | "performance_standards" | "catalog_types" | "signal_targeting_allowed" | "signal_targeting_rules" | "demographic_targeting" | "overlay_support" | "collections" | "collection_targeting_allowed" | "media_buy_support" | "audience_evidence_selections" | "max_optimization_goals" | "catalog_match" | "list_applications" | "brief_relevance" | "targeting_resolution" | "acceptance_policy_profile_ids" | "execution_requirements" | "expires_at" | "allowed_actions" | "product_card" | "format_ids" | "outcome_measurement" | "delivery_measurement" | "creative_policy" | "metric_optimization" | "conversion_tracking" | "data_provider_signals" | "included_signals" | "signal_targeting_options" | "installments" | "is_custom" | "product_card_detailed" | "enforced_policies" | "trusted_match")[]>>>;
|
|
160
|
-
time_budget: z.ZodOptional<z.ZodType<import("..").Duration, import("..").Duration, z.core.$ZodTypeInternals<import("..").Duration, import("..").Duration>>>;
|
|
161
|
-
push_notification_config: z.ZodOptional<z.ZodType<import("../types/tools.generated").PushNotificationConfig, import("../types/tools.generated").PushNotificationConfig, z.core.$ZodTypeInternals<import("../types/tools.generated").PushNotificationConfig, import("../types/tools.generated").PushNotificationConfig>>>;
|
|
162
|
-
pagination: z.ZodOptional<z.ZodType<import("..").PaginationRequest, import("..").PaginationRequest, z.core.$ZodTypeInternals<import("..").PaginationRequest, import("..").PaginationRequest>>>;
|
|
163
|
-
if_wholesale_feed_version: z.ZodOptional<z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
164
|
-
if_pricing_version: z.ZodOptional<z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
165
|
-
context: z.ZodOptional<z.ZodType<import("../types/tools.generated").ContextObject, import("../types/tools.generated").ContextObject, z.core.$ZodTypeInternals<import("../types/tools.generated").ContextObject, import("../types/tools.generated").ContextObject>>>;
|
|
166
|
-
required_policies: z.ZodOptional<z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>>;
|
|
167
|
-
ext: z.ZodOptional<z.ZodType<import("../types/core.generated").ExtensionObject, import("../types/core.generated").ExtensionObject, z.core.$ZodTypeInternals<import("../types/core.generated").ExtensionObject, import("../types/core.generated").ExtensionObject>>>;
|
|
168
|
-
}, z.core.$loose> & z.ZodType<import("..").LegacyGetProductsRequest & Record<string, unknown>, import("..").LegacyGetProductsRequest & Record<string, unknown>, z.core.$ZodTypeInternals<import("..").LegacyGetProductsRequest & Record<string, unknown>, import("..").LegacyGetProductsRequest & Record<string, unknown>>>;
|
|
169
|
-
/** Primary request schema; legacy `format_ids` selection is rejected. */
|
|
170
|
-
export declare const GetProductsRequestSchema: LooseObjectSchemaFor<CanonicalGetProductsRequest>;
|
|
51
|
+
export { GetProductsRequestSchema, LegacyGetProductsRequestSchema } from '../validation/get-products-request';
|
|
52
|
+
export type { LooseObjectSchemaFor } from '../validation/get-products-request';
|
|
171
53
|
export { BiddingPolicySchema } from '../validation/bidding-policy';
|
|
172
54
|
export { CanonicalBudgetAllocationSchema } from '../validation/budget-allocation';
|
|
173
55
|
export { TOOL_REQUEST_SCHEMAS } from '../utils/tool-request-schemas';
|
|
@@ -32,8 +32,8 @@ __export(schemas_exports, {
|
|
|
32
32
|
AgentOAuthClientCredentialsSchema: () => import_client_credentials_schema.AgentOAuthClientCredentialsSchema,
|
|
33
33
|
BiddingPolicySchema: () => import_bidding_policy.BiddingPolicySchema,
|
|
34
34
|
CanonicalBudgetAllocationSchema: () => import_budget_allocation.CanonicalBudgetAllocationSchema,
|
|
35
|
-
GetProductsRequestSchema: () => GetProductsRequestSchema,
|
|
36
|
-
LegacyGetProductsRequestSchema: () => LegacyGetProductsRequestSchema,
|
|
35
|
+
GetProductsRequestSchema: () => import_get_products_request.GetProductsRequestSchema,
|
|
36
|
+
LegacyGetProductsRequestSchema: () => import_get_products_request.LegacyGetProductsRequestSchema,
|
|
37
37
|
SyncCreativesActionSchema: () => import_sync_creatives.SyncCreativesActionSchema,
|
|
38
38
|
SyncCreativesItemSchema: () => import_sync_creatives.SyncCreativesItemSchema,
|
|
39
39
|
SyncCreativesResponseStrictSchema: () => import_sync_creatives.SyncCreativesResponseStrictSchema,
|
|
@@ -50,26 +50,18 @@ __export(schemas_exports, {
|
|
|
50
50
|
getToolResponseSchema: () => getToolResponseSchema
|
|
51
51
|
});
|
|
52
52
|
module.exports = __toCommonJS(schemas_exports);
|
|
53
|
-
var import_zod = require("zod");
|
|
54
53
|
var schemas = __toESM(require('../types/schemas.generated.js'));
|
|
55
|
-
var import_inline_enums = require('../types/inline-enums.generated.js');
|
|
56
54
|
var import_tool_request_schemas = require('../utils/tool-request-schemas.js');
|
|
57
55
|
var import_schema_loader = require('../validation/schema-loader.js');
|
|
58
56
|
var import_adcp_version_config = require('../utils/adcp-version-config.js');
|
|
59
57
|
__reExport(schemas_exports, require('../types/schemas.generated.js'), module.exports);
|
|
60
58
|
var import_client_credentials_schema = require('../auth/oauth/client-credentials-schema.js');
|
|
59
|
+
var import_get_products_request = require('../validation/get-products-request.js');
|
|
61
60
|
var import_bidding_policy = require('../validation/bidding-policy.js');
|
|
62
61
|
var import_budget_allocation = require('../validation/budget-allocation.js');
|
|
63
62
|
var import_tool_request_schemas2 = require('../utils/tool-request-schemas.js');
|
|
64
63
|
var import_response_schemas = require('../utils/response-schemas.js');
|
|
65
64
|
var import_sync_creatives = require('../validation/sync-creatives.js');
|
|
66
|
-
const LegacyGetProductsRequestSchema = schemas.GetProductsRequestSchema;
|
|
67
|
-
const canonicalGetProductsFields = import_inline_enums.GetProductsRequest_FieldsValues.filter(
|
|
68
|
-
(field) => field !== "format_ids"
|
|
69
|
-
);
|
|
70
|
-
const GetProductsRequestSchema = schemas.GetProductsRequestSchema.safeExtend({
|
|
71
|
-
fields: import_zod.z.array(import_zod.z.enum(canonicalGetProductsFields)).optional()
|
|
72
|
-
});
|
|
73
65
|
function getToolInputSchema(toolName, options = {}) {
|
|
74
66
|
return (0, import_schema_loader.getToolSchemaDocument)(toolName, "request", (0, import_adcp_version_config.resolveAdcpVersion)(options.adcpVersion));
|
|
75
67
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as schemas from "../types/schemas.generated.mjs";
|
|
3
|
-
import { GetProductsRequest_FieldsValues } from "../types/inline-enums.generated.mjs";
|
|
4
2
|
import { TOOL_REQUEST_SCHEMAS } from "../utils/tool-request-schemas.mjs";
|
|
5
3
|
import {
|
|
6
4
|
getCanonicalToolValidatorForVersion,
|
|
@@ -10,13 +8,7 @@ import {
|
|
|
10
8
|
import { resolveAdcpVersion } from "../utils/adcp-version-config.mjs";
|
|
11
9
|
export * from "../types/schemas.generated.mjs";
|
|
12
10
|
import { AgentOAuthClientCredentialsSchema } from "../auth/oauth/client-credentials-schema.mjs";
|
|
13
|
-
|
|
14
|
-
const canonicalGetProductsFields = GetProductsRequest_FieldsValues.filter(
|
|
15
|
-
(field) => field !== "format_ids"
|
|
16
|
-
);
|
|
17
|
-
const GetProductsRequestSchema = schemas.GetProductsRequestSchema.safeExtend({
|
|
18
|
-
fields: z.array(z.enum(canonicalGetProductsFields)).optional()
|
|
19
|
-
});
|
|
11
|
+
import { GetProductsRequestSchema, LegacyGetProductsRequestSchema } from "../validation/get-products-request.mjs";
|
|
20
12
|
import { BiddingPolicySchema } from "../validation/bidding-policy.mjs";
|
|
21
13
|
import { CanonicalBudgetAllocationSchema } from "../validation/budget-allocation.mjs";
|
|
22
14
|
import { TOOL_REQUEST_SCHEMAS as TOOL_REQUEST_SCHEMAS2 } from "../utils/tool-request-schemas.mjs";
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"source_sha": "4e553ad955f83b49c7d221ab5c3ff78237ad02e3",
|
|
5
5
|
"source_tarball_sha256": "580656d6466ef9f0d1119985e6726c2efea718dc671e2ad30957fcb2fd54af0f",
|
|
6
6
|
"upstream_adcp_version": "2.5.3",
|
|
7
|
-
"synced_at": "2026-10-
|
|
7
|
+
"synced_at": "2026-10-09T12:16:02.843Z"
|
|
8
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { assertPendingWebFlowStoreRoundTrip, type PendingWebFlowStoreRoundTripOptions } from './pending-web-flow-store.mjs';
|
|
1
2
|
export { testAgent, testAgentA2A, testAgentClient, createTestAgent, TEST_AGENT_TOKEN, TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG, testAgentNoAuth, testAgentNoAuthA2A, TEST_AGENT_NO_AUTH_MCP_CONFIG, TEST_AGENT_NO_AUTH_A2A_CONFIG, creativeAgent, } from './test-helpers.mjs';
|
|
2
3
|
export { testAgent as runAgentTests, formatTestResults, formatTestResultsJSON, formatTestResultsSummary, setAgentTesterLogger, getLogger, createTestClient, runStep, testHealthCheck, testDiscovery, testCreateMediaBuy, testFullSalesFlow, testReportingFlow, testCreativeSync, testCreativeInline, testCreativeFlow, testSignalsFlow, testErrorHandling, testValidation, testPricingEdgeCases, testTemporalValidation, testBehaviorAnalysis, testResponseConsistency, testGovernancePropertyLists, testGovernanceContentStandards, testPropertyListFilters, testSISessionLifecycle, testSIAvailability, testSIHandoff, testCapabilityDiscovery, testSyncAudiences, resolveAccountForMediaBuy, resolveAccountForAudiences, testSchemaCompliance, testMediaBuyLifecycle, testTerminalStateEnforcement, testPackageLifecycle, testCreativeStateMachine, testMediaBuyStateMachine, testAccountStateMachine, testSessionStateMachine, testDeliverySimulation, testBudgetSimulation, testControllerValidation, testBrandRightsFlow, hasBrandRightsTools, hasGovernanceTools, hasSITools, likelySupportsV3, testAllScenarios, getApplicableScenarios, SCENARIO_REQUIREMENTS, DEFAULT_SCENARIOS, formatSuiteResults, formatSuiteResultsJSON, type TestScenario, type TestOptions, type OrchestratorOptions, type TestResult, type SuiteResult, type TestStepResult, type AgentProfile, type TaskResult, type TestClient, type Logger, } from './agent-tester.mjs';
|
|
3
4
|
export { comply, buildComplianceBundleResults, formatComplianceResults, formatComplianceResultsJSON, buildComplianceSummary, SAMPLE_BRIEFS, getBriefById, getBriefsByVertical, type ComplyOptions, type ComplianceBundleAssessmentOptions, type ComplyRouteStoryboardContext, type ComplyStoryboardRoute, type ComplyStoryboardRouting, type ComplyStoryboardSkip, type ComplianceTrack, type TrackResult, type TestedTrackEntry, type TrackStatus, type ComplianceBundleResult, type ComplianceBundleStatus, type ComplianceResult, type ComplianceSummary, type ComplianceSummaryArtifact, type BuildSummaryOptions, type AdvisoryObservation, type ObservationSource, type SampleBrief, } from './compliance/index.mjs';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { assertPendingWebFlowStoreRoundTrip, type PendingWebFlowStoreRoundTripOptions } from './pending-web-flow-store';
|
|
1
2
|
export { testAgent, testAgentA2A, testAgentClient, createTestAgent, TEST_AGENT_TOKEN, TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG, testAgentNoAuth, testAgentNoAuthA2A, TEST_AGENT_NO_AUTH_MCP_CONFIG, TEST_AGENT_NO_AUTH_A2A_CONFIG, creativeAgent, } from './test-helpers';
|
|
2
3
|
export { testAgent as runAgentTests, formatTestResults, formatTestResultsJSON, formatTestResultsSummary, setAgentTesterLogger, getLogger, createTestClient, runStep, testHealthCheck, testDiscovery, testCreateMediaBuy, testFullSalesFlow, testReportingFlow, testCreativeSync, testCreativeInline, testCreativeFlow, testSignalsFlow, testErrorHandling, testValidation, testPricingEdgeCases, testTemporalValidation, testBehaviorAnalysis, testResponseConsistency, testGovernancePropertyLists, testGovernanceContentStandards, testPropertyListFilters, testSISessionLifecycle, testSIAvailability, testSIHandoff, testCapabilityDiscovery, testSyncAudiences, resolveAccountForMediaBuy, resolveAccountForAudiences, testSchemaCompliance, testMediaBuyLifecycle, testTerminalStateEnforcement, testPackageLifecycle, testCreativeStateMachine, testMediaBuyStateMachine, testAccountStateMachine, testSessionStateMachine, testDeliverySimulation, testBudgetSimulation, testControllerValidation, testBrandRightsFlow, hasBrandRightsTools, hasGovernanceTools, hasSITools, likelySupportsV3, testAllScenarios, getApplicableScenarios, SCENARIO_REQUIREMENTS, DEFAULT_SCENARIOS, formatSuiteResults, formatSuiteResultsJSON, type TestScenario, type TestOptions, type OrchestratorOptions, type TestResult, type SuiteResult, type TestStepResult, type AgentProfile, type TaskResult, type TestClient, type Logger, } from './agent-tester';
|
|
3
4
|
export { comply, buildComplianceBundleResults, formatComplianceResults, formatComplianceResultsJSON, buildComplianceSummary, SAMPLE_BRIEFS, getBriefById, getBriefsByVertical, type ComplyOptions, type ComplianceBundleAssessmentOptions, type ComplyRouteStoryboardContext, type ComplyStoryboardRoute, type ComplyStoryboardRouting, type ComplyStoryboardSkip, type ComplianceTrack, type TrackResult, type TestedTrackEntry, type TrackStatus, type ComplianceBundleResult, type ComplianceBundleStatus, type ComplianceResult, type ComplianceSummary, type ComplianceSummaryArtifact, type BuildSummaryOptions, type AdvisoryObservation, type ObservationSource, type SampleBrief, } from './compliance';
|
|
@@ -47,6 +47,7 @@ __export(testing_exports, {
|
|
|
47
47
|
applyAdcpVersionRunOptions: () => import_storyboard.applyAdcpVersionRunOptions,
|
|
48
48
|
applyFixtureBindingsToRequest: () => import_storyboard.applyFixtureBindingsToRequest,
|
|
49
49
|
applyStoryboardVersionOptions: () => import_storyboard.applyStoryboardVersionOptions,
|
|
50
|
+
assertPendingWebFlowStoreRoundTrip: () => import_pending_web_flow_store.assertPendingWebFlowStoreRoundTrip,
|
|
50
51
|
bridgeFromSessionStore: () => import_test_controller_bridge.bridgeFromSessionStore,
|
|
51
52
|
bridgeFromTestControllerStore: () => import_test_controller_bridge.bridgeFromTestControllerStore,
|
|
52
53
|
buildComplianceBundleResults: () => import_compliance.buildComplianceBundleResults,
|
|
@@ -194,6 +195,7 @@ __export(testing_exports, {
|
|
|
194
195
|
withExternalSchemaRoot: () => import_validation.withExternalSchemaRoot
|
|
195
196
|
});
|
|
196
197
|
module.exports = __toCommonJS(testing_exports);
|
|
198
|
+
var import_pending_web_flow_store = require('./pending-web-flow-store.js');
|
|
197
199
|
var import_test_helpers = require('./test-helpers.js');
|
|
198
200
|
var import_agent_tester = require('./agent-tester.js');
|
|
199
201
|
var import_compliance = require('./compliance/index.js');
|
|
@@ -237,6 +239,7 @@ var import_storyboard = require('./storyboard/index.js');
|
|
|
237
239
|
applyAdcpVersionRunOptions,
|
|
238
240
|
applyFixtureBindingsToRequest,
|
|
239
241
|
applyStoryboardVersionOptions,
|
|
242
|
+
assertPendingWebFlowStoreRoundTrip,
|
|
240
243
|
bridgeFromSessionStore,
|
|
241
244
|
bridgeFromTestControllerStore,
|
|
242
245
|
buildComplianceBundleResults,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assertPendingWebFlowStoreRoundTrip } from "./pending-web-flow-store.mjs";
|
|
1
2
|
import {
|
|
2
3
|
testAgent,
|
|
3
4
|
testAgentA2A,
|
|
@@ -213,6 +214,7 @@ export {
|
|
|
213
214
|
applyAdcpVersionRunOptions,
|
|
214
215
|
applyFixtureBindingsToRequest,
|
|
215
216
|
applyStoryboardVersionOptions,
|
|
217
|
+
assertPendingWebFlowStoreRoundTrip,
|
|
216
218
|
bridgeFromSessionStore,
|
|
217
219
|
bridgeFromTestControllerStore,
|
|
218
220
|
buildComplianceBundleResults,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PendingWebFlowStore } from '../auth/oauth/web-flow.mjs';
|
|
2
|
+
/** Application-owned fixture values, for stores with agent foreign keys or carry validation. */
|
|
3
|
+
export interface PendingWebFlowStoreRoundTripOptions {
|
|
4
|
+
agentId?: string;
|
|
5
|
+
carry?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Assert that an adopter's pending-flow store preserves every current SDK field,
|
|
9
|
+
* revives Dates, isolates state keys, rejects duplicates, consumes atomically
|
|
10
|
+
* once, and treats expired rows as absent. Throws on a contract violation.
|
|
11
|
+
* Stores may refuse to insert an already-expired row. Also checks null/absent snapshots,
|
|
12
|
+
* clear actions, public clients, registration metadata and unknown extensions.
|
|
13
|
+
* Absent optional fields must stay absent rather than become undefined-valued
|
|
14
|
+
* own properties; the callback distinguishes presence for resource snapshots.
|
|
15
|
+
*
|
|
16
|
+
* Run against a disposable store in CI on every SDK upgrade. Uses random states
|
|
17
|
+
* and only conformance credentials; no OAuth endpoints are contacted. Concurrent
|
|
18
|
+
* consume checks are a smoke test, not a proof of distributed atomicity.
|
|
19
|
+
*/
|
|
20
|
+
export declare function assertPendingWebFlowStoreRoundTrip(store: PendingWebFlowStore, options?: PendingWebFlowStoreRoundTripOptions): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PendingWebFlowStore } from '../auth/oauth/web-flow';
|
|
2
|
+
/** Application-owned fixture values, for stores with agent foreign keys or carry validation. */
|
|
3
|
+
export interface PendingWebFlowStoreRoundTripOptions {
|
|
4
|
+
agentId?: string;
|
|
5
|
+
carry?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Assert that an adopter's pending-flow store preserves every current SDK field,
|
|
9
|
+
* revives Dates, isolates state keys, rejects duplicates, consumes atomically
|
|
10
|
+
* once, and treats expired rows as absent. Throws on a contract violation.
|
|
11
|
+
* Stores may refuse to insert an already-expired row. Also checks null/absent snapshots,
|
|
12
|
+
* clear actions, public clients, registration metadata and unknown extensions.
|
|
13
|
+
* Absent optional fields must stay absent rather than become undefined-valued
|
|
14
|
+
* own properties; the callback distinguishes presence for resource snapshots.
|
|
15
|
+
*
|
|
16
|
+
* Run against a disposable store in CI on every SDK upgrade. Uses random states
|
|
17
|
+
* and only conformance credentials; no OAuth endpoints are contacted. Concurrent
|
|
18
|
+
* consume checks are a smoke test, not a proof of distributed atomicity.
|
|
19
|
+
*/
|
|
20
|
+
export declare function assertPendingWebFlowStoreRoundTrip(store: PendingWebFlowStore, options?: PendingWebFlowStoreRoundTripOptions): Promise<void>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var pending_web_flow_store_exports = {};
|
|
30
|
+
__export(pending_web_flow_store_exports, {
|
|
31
|
+
assertPendingWebFlowStoreRoundTrip: () => assertPendingWebFlowStoreRoundTrip
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(pending_web_flow_store_exports);
|
|
34
|
+
var import_strict = __toESM(require("node:assert/strict"));
|
|
35
|
+
var import_node_crypto = require("node:crypto");
|
|
36
|
+
function createPendingWebFlowFixture(state, options) {
|
|
37
|
+
const createdAt = /* @__PURE__ */ new Date();
|
|
38
|
+
return {
|
|
39
|
+
state,
|
|
40
|
+
agentId: options.agentId ?? "pending-flow-store-conformance",
|
|
41
|
+
agentUrl: "https://agent.example/mcp",
|
|
42
|
+
codeVerifier: "conformance-only-pkce-verifier",
|
|
43
|
+
redirectUri: "https://buyer.example/oauth/callback",
|
|
44
|
+
resource: "https://resource.example/mcp",
|
|
45
|
+
resourceOverride: "https://resource.example/mcp",
|
|
46
|
+
resourceOverrideAction: "set",
|
|
47
|
+
resourceOverrideSnapshot: "https://previous-resource.example/mcp",
|
|
48
|
+
scope: "mcp.read mcp.write",
|
|
49
|
+
authorizationServerUrl: "https://auth.example/tenant",
|
|
50
|
+
authorizationServerIssuer: "https://auth.example/tenant",
|
|
51
|
+
clientInformation: {
|
|
52
|
+
client_id: "conformance-client",
|
|
53
|
+
client_secret: "conformance-only-client-secret",
|
|
54
|
+
client_id_issued_at: 17e8,
|
|
55
|
+
client_secret_expires_at: 0,
|
|
56
|
+
issuer: "https://auth.example/tenant",
|
|
57
|
+
redirect_uris: ["https://buyer.example/oauth/callback"],
|
|
58
|
+
token_endpoint_auth_method: "client_secret_post",
|
|
59
|
+
conformanceExtension: { retained: "client metadata" }
|
|
60
|
+
},
|
|
61
|
+
createdAt,
|
|
62
|
+
expiresAt: new Date(createdAt.getTime() + 10 * 60 * 1e3),
|
|
63
|
+
carry: options.carry !== void 0 ? structuredClone(options.carry) : {
|
|
64
|
+
user_id: "conformance-user",
|
|
65
|
+
return_to: "/dashboard",
|
|
66
|
+
nested: { values: ["one", 2, true, null, { retained: "yes" }] }
|
|
67
|
+
},
|
|
68
|
+
conformanceExtension: { retained: "future flow fields" }
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function assertPendingWebFlowStoreRoundTrip(store, options = {}) {
|
|
72
|
+
const newState = () => (0, import_node_crypto.randomBytes)(32).toString("base64url");
|
|
73
|
+
const flow = createPendingWebFlowFixture(newState(), options);
|
|
74
|
+
const expected = structuredClone(flow);
|
|
75
|
+
await store.put(flow);
|
|
76
|
+
import_strict.default.equal(await store.consume(newState()), null, "Unknown state must return null");
|
|
77
|
+
import_strict.default.deepStrictEqual(
|
|
78
|
+
await store.consume(flow.state),
|
|
79
|
+
expected,
|
|
80
|
+
"Pending flow must round-trip every field and Date"
|
|
81
|
+
);
|
|
82
|
+
import_strict.default.equal(await store.consume(flow.state), null, "Pending flow must only be consumed once");
|
|
83
|
+
const clear = {
|
|
84
|
+
...createPendingWebFlowFixture(newState(), options),
|
|
85
|
+
resourceOverrideAction: "clear",
|
|
86
|
+
resourceOverrideSnapshot: null,
|
|
87
|
+
clientInformation: { client_id: "public-conformance-client", issuer: "https://auth.example/tenant" }
|
|
88
|
+
};
|
|
89
|
+
delete clear.resourceOverride;
|
|
90
|
+
const expectedClear = structuredClone(clear);
|
|
91
|
+
await store.put(clear);
|
|
92
|
+
import_strict.default.deepStrictEqual(
|
|
93
|
+
await store.consume(clear.state),
|
|
94
|
+
expectedClear,
|
|
95
|
+
"Clear flow must preserve null and absent fields"
|
|
96
|
+
);
|
|
97
|
+
import_strict.default.equal(await store.consume(clear.state), null, "Clear flow must only be consumed once");
|
|
98
|
+
const preserve = { ...createPendingWebFlowFixture(newState(), options) };
|
|
99
|
+
delete preserve.resourceOverride;
|
|
100
|
+
delete preserve.resourceOverrideAction;
|
|
101
|
+
delete preserve.resourceOverrideSnapshot;
|
|
102
|
+
const expectedPreserve = structuredClone(preserve);
|
|
103
|
+
await store.put(preserve);
|
|
104
|
+
import_strict.default.deepStrictEqual(
|
|
105
|
+
await store.consume(preserve.state),
|
|
106
|
+
expectedPreserve,
|
|
107
|
+
"Preserve-only flow must keep override fields absent"
|
|
108
|
+
);
|
|
109
|
+
import_strict.default.equal(await store.consume(preserve.state), null, "Preserve-only flow must only be consumed once");
|
|
110
|
+
const expired = createPendingWebFlowFixture(newState(), options);
|
|
111
|
+
expired.createdAt = new Date(Date.now() - 2 * 60 * 60 * 1e3);
|
|
112
|
+
expired.expiresAt = new Date(Date.now() - 60 * 60 * 1e3);
|
|
113
|
+
try {
|
|
114
|
+
await store.put(expired);
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
import_strict.default.equal(await store.consume(expired.state), null, "Expired flow must return null");
|
|
118
|
+
const concurrent = createPendingWebFlowFixture(newState(), options);
|
|
119
|
+
const expectedConcurrent = structuredClone(concurrent);
|
|
120
|
+
await store.put(concurrent);
|
|
121
|
+
const duplicate = { ...structuredClone(expectedConcurrent), codeVerifier: "different-conformance-verifier" };
|
|
122
|
+
await import_strict.default.rejects(async () => store.put(duplicate), "Duplicate state must be rejected");
|
|
123
|
+
const results = await Promise.all([store.consume(concurrent.state), store.consume(concurrent.state)]);
|
|
124
|
+
const winners = results.filter((result) => result !== null);
|
|
125
|
+
import_strict.default.equal(winners.length, 1, "Concurrent consumes must return the flow exactly once");
|
|
126
|
+
import_strict.default.deepStrictEqual(winners[0], expectedConcurrent, "Concurrent consume must preserve the original flow");
|
|
127
|
+
import_strict.default.equal(await store.consume(concurrent.state), null, "Concurrent consume must delete the flow");
|
|
128
|
+
}
|
|
129
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
130
|
+
0 && (module.exports = {
|
|
131
|
+
assertPendingWebFlowStoreRoundTrip
|
|
132
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
function createPendingWebFlowFixture(state, options) {
|
|
4
|
+
const createdAt = /* @__PURE__ */ new Date();
|
|
5
|
+
return {
|
|
6
|
+
state,
|
|
7
|
+
agentId: options.agentId ?? "pending-flow-store-conformance",
|
|
8
|
+
agentUrl: "https://agent.example/mcp",
|
|
9
|
+
codeVerifier: "conformance-only-pkce-verifier",
|
|
10
|
+
redirectUri: "https://buyer.example/oauth/callback",
|
|
11
|
+
resource: "https://resource.example/mcp",
|
|
12
|
+
resourceOverride: "https://resource.example/mcp",
|
|
13
|
+
resourceOverrideAction: "set",
|
|
14
|
+
resourceOverrideSnapshot: "https://previous-resource.example/mcp",
|
|
15
|
+
scope: "mcp.read mcp.write",
|
|
16
|
+
authorizationServerUrl: "https://auth.example/tenant",
|
|
17
|
+
authorizationServerIssuer: "https://auth.example/tenant",
|
|
18
|
+
clientInformation: {
|
|
19
|
+
client_id: "conformance-client",
|
|
20
|
+
client_secret: "conformance-only-client-secret",
|
|
21
|
+
client_id_issued_at: 17e8,
|
|
22
|
+
client_secret_expires_at: 0,
|
|
23
|
+
issuer: "https://auth.example/tenant",
|
|
24
|
+
redirect_uris: ["https://buyer.example/oauth/callback"],
|
|
25
|
+
token_endpoint_auth_method: "client_secret_post",
|
|
26
|
+
conformanceExtension: { retained: "client metadata" }
|
|
27
|
+
},
|
|
28
|
+
createdAt,
|
|
29
|
+
expiresAt: new Date(createdAt.getTime() + 10 * 60 * 1e3),
|
|
30
|
+
carry: options.carry !== void 0 ? structuredClone(options.carry) : {
|
|
31
|
+
user_id: "conformance-user",
|
|
32
|
+
return_to: "/dashboard",
|
|
33
|
+
nested: { values: ["one", 2, true, null, { retained: "yes" }] }
|
|
34
|
+
},
|
|
35
|
+
conformanceExtension: { retained: "future flow fields" }
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function assertPendingWebFlowStoreRoundTrip(store, options = {}) {
|
|
39
|
+
const newState = () => randomBytes(32).toString("base64url");
|
|
40
|
+
const flow = createPendingWebFlowFixture(newState(), options);
|
|
41
|
+
const expected = structuredClone(flow);
|
|
42
|
+
await store.put(flow);
|
|
43
|
+
assert.equal(await store.consume(newState()), null, "Unknown state must return null");
|
|
44
|
+
assert.deepStrictEqual(
|
|
45
|
+
await store.consume(flow.state),
|
|
46
|
+
expected,
|
|
47
|
+
"Pending flow must round-trip every field and Date"
|
|
48
|
+
);
|
|
49
|
+
assert.equal(await store.consume(flow.state), null, "Pending flow must only be consumed once");
|
|
50
|
+
const clear = {
|
|
51
|
+
...createPendingWebFlowFixture(newState(), options),
|
|
52
|
+
resourceOverrideAction: "clear",
|
|
53
|
+
resourceOverrideSnapshot: null,
|
|
54
|
+
clientInformation: { client_id: "public-conformance-client", issuer: "https://auth.example/tenant" }
|
|
55
|
+
};
|
|
56
|
+
delete clear.resourceOverride;
|
|
57
|
+
const expectedClear = structuredClone(clear);
|
|
58
|
+
await store.put(clear);
|
|
59
|
+
assert.deepStrictEqual(
|
|
60
|
+
await store.consume(clear.state),
|
|
61
|
+
expectedClear,
|
|
62
|
+
"Clear flow must preserve null and absent fields"
|
|
63
|
+
);
|
|
64
|
+
assert.equal(await store.consume(clear.state), null, "Clear flow must only be consumed once");
|
|
65
|
+
const preserve = { ...createPendingWebFlowFixture(newState(), options) };
|
|
66
|
+
delete preserve.resourceOverride;
|
|
67
|
+
delete preserve.resourceOverrideAction;
|
|
68
|
+
delete preserve.resourceOverrideSnapshot;
|
|
69
|
+
const expectedPreserve = structuredClone(preserve);
|
|
70
|
+
await store.put(preserve);
|
|
71
|
+
assert.deepStrictEqual(
|
|
72
|
+
await store.consume(preserve.state),
|
|
73
|
+
expectedPreserve,
|
|
74
|
+
"Preserve-only flow must keep override fields absent"
|
|
75
|
+
);
|
|
76
|
+
assert.equal(await store.consume(preserve.state), null, "Preserve-only flow must only be consumed once");
|
|
77
|
+
const expired = createPendingWebFlowFixture(newState(), options);
|
|
78
|
+
expired.createdAt = new Date(Date.now() - 2 * 60 * 60 * 1e3);
|
|
79
|
+
expired.expiresAt = new Date(Date.now() - 60 * 60 * 1e3);
|
|
80
|
+
try {
|
|
81
|
+
await store.put(expired);
|
|
82
|
+
} catch {
|
|
83
|
+
}
|
|
84
|
+
assert.equal(await store.consume(expired.state), null, "Expired flow must return null");
|
|
85
|
+
const concurrent = createPendingWebFlowFixture(newState(), options);
|
|
86
|
+
const expectedConcurrent = structuredClone(concurrent);
|
|
87
|
+
await store.put(concurrent);
|
|
88
|
+
const duplicate = { ...structuredClone(expectedConcurrent), codeVerifier: "different-conformance-verifier" };
|
|
89
|
+
await assert.rejects(async () => store.put(duplicate), "Duplicate state must be rejected");
|
|
90
|
+
const results = await Promise.all([store.consume(concurrent.state), store.consume(concurrent.state)]);
|
|
91
|
+
const winners = results.filter((result) => result !== null);
|
|
92
|
+
assert.equal(winners.length, 1, "Concurrent consumes must return the flow exactly once");
|
|
93
|
+
assert.deepStrictEqual(winners[0], expectedConcurrent, "Concurrent consume must preserve the original flow");
|
|
94
|
+
assert.equal(await store.consume(concurrent.state), null, "Concurrent consume must delete the flow");
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
assertPendingWebFlowStoreRoundTrip
|
|
98
|
+
};
|
|
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
|
|
|
197
197
|
*/
|
|
198
198
|
export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
|
|
199
199
|
/** Capability semver emitted in run summaries and used for advisory expiry. */
|
|
200
|
-
export declare const RUNNER_CAPABILITY_VERSION = "15.
|
|
200
|
+
export declare const RUNNER_CAPABILITY_VERSION = "15.6.0";
|
|
201
201
|
/** True when a failed validation contributes to the owning step's grade. */
|
|
202
202
|
export declare function validationFailsStep(result: ValidationResult): boolean;
|
|
203
203
|
/**
|
|
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
|
|
|
197
197
|
*/
|
|
198
198
|
export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
|
|
199
199
|
/** Capability semver emitted in run summaries and used for advisory expiry. */
|
|
200
|
-
export declare const RUNNER_CAPABILITY_VERSION = "15.
|
|
200
|
+
export declare const RUNNER_CAPABILITY_VERSION = "15.6.0";
|
|
201
201
|
/** True when a failed validation contributes to the owning step's grade. */
|
|
202
202
|
export declare function validationFailsStep(result: ValidationResult): boolean;
|
|
203
203
|
/**
|