@getuserfeedback/protocol 0.9.1 → 0.10.1

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.
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod/mini";
2
2
  import type { IdentityTypeValue } from "./identity-type.js";
3
- export type FlowAssignmentExternalIdIdentityTypeValue = `externalId.${string}`;
3
+ export type FlowAssignmentExternalIdIdentityTypeValue = `externalId.users.none.${string}`;
4
4
  export type FlowAssignmentIdentityTypeValue = IdentityTypeValue | FlowAssignmentExternalIdIdentityTypeValue;
5
5
  export declare const flowAssignmentStatusSchema: z.ZodMiniEnum<{
6
6
  pending: "pending";
@@ -94,7 +94,7 @@ export declare const flowAssignmentTargetingContextSchema: z.ZodMiniObject<{
94
94
  }, z.core.$strip>;
95
95
  export declare const flowAssignmentRecipientRequestSchema: z.ZodMiniObject<{
96
96
  identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
97
- type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.${string}`, `externalId.${string}`, z.core.$ZodTypeInternals<`externalId.${string}`, `externalId.${string}`>>]>;
97
+ type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.users.none.${string}`, `externalId.users.none.${string}`, z.core.$ZodTypeInternals<`externalId.users.none.${string}`, `externalId.users.none.${string}`>>]>;
98
98
  value: z.ZodMiniString<string>;
99
99
  }, z.core.$strip>>>;
100
100
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -239,7 +239,7 @@ export declare const listPendingFlowAssignmentsResponseSchema: z.ZodMiniObject<{
239
239
  }, z.core.$strip>;
240
240
  export declare const claimPendingFlowAssignmentsRequestSchema: z.ZodMiniObject<{
241
241
  identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
242
- type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.${string}`, `externalId.${string}`, z.core.$ZodTypeInternals<`externalId.${string}`, `externalId.${string}`>>]>;
242
+ type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.users.none.${string}`, `externalId.users.none.${string}`, z.core.$ZodTypeInternals<`externalId.users.none.${string}`, `externalId.users.none.${string}`>>]>;
243
243
  value: z.ZodMiniString<string>;
244
244
  }, z.core.$strip>>>;
245
245
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -358,7 +358,7 @@ export declare const claimPendingFlowAssignmentsResponseSchema: z.ZodMiniObject<
358
358
  }, z.core.$strip>;
359
359
  export declare const updateFlowAssignmentLifecycleRequestSchema: z.ZodMiniObject<{
360
360
  identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
361
- type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.${string}`, `externalId.${string}`, z.core.$ZodTypeInternals<`externalId.${string}`, `externalId.${string}`>>]>;
361
+ type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.users.none.${string}`, `externalId.users.none.${string}`, z.core.$ZodTypeInternals<`externalId.users.none.${string}`, `externalId.users.none.${string}`>>]>;
362
362
  value: z.ZodMiniString<string>;
363
363
  }, z.core.$strip>>>;
364
364
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -447,7 +447,7 @@ export declare const updateFlowAssignmentLifecycleRequestSchema: z.ZodMiniObject
447
447
  }, z.core.$strip>;
448
448
  export declare const releaseFlowAssignmentClaimRequestSchema: z.ZodMiniObject<{
449
449
  identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
450
- type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.${string}`, `externalId.${string}`, z.core.$ZodTypeInternals<`externalId.${string}`, `externalId.${string}`>>]>;
450
+ type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.users.none.${string}`, `externalId.users.none.${string}`, z.core.$ZodTypeInternals<`externalId.users.none.${string}`, `externalId.users.none.${string}`>>]>;
451
451
  value: z.ZodMiniString<string>;
452
452
  }, z.core.$strip>>>;
453
453
  holdGroupToken: z.ZodMiniString<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"flow-assignments.d.ts","sourceRoot":"","sources":["../src/flow-assignments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAO9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,yCAAyC,GAAG,cAAc,MAAM,EAAE,CAAC;AAC/E,MAAM,MAAM,+BAA+B,GACxC,iBAAiB,GACjB,yCA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,OAAO,0BAA0B,CAAC,CAAC;AAC/E,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CACzD,OAAO,yCAAyC,CAChD,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CACvD,OAAO,uCAAuC,CAC9C,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAC1D,OAAO,0CAA0C,CACjD,CAAC;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAC3D,OAAO,2CAA2C,CAClD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/mini";
2
2
  import { appEventCapabilitySchema, appEventFlagSchema, appEventIdentityTypeSchema, } from "./app-event.js";
3
- const flowAssignmentExternalIdIdentityTypeSchema = z.string().check(z.trim(), z.minLength(1), z.regex(/^externalId\.[a-z0-9][a-z0-9_.-]*$/, {
4
- message: "External ID identity type must use externalId.<type> with a lowercase Segment external ID type.",
3
+ const flowAssignmentExternalIdIdentityTypeSchema = z.string().check(z.trim(), z.minLength(1), z.regex(/^externalId\.users\.none\.[a-z0-9][a-z0-9_.-]*$/, {
4
+ message: "External ID identity type must use externalId.users.none.<type> with a lowercase Segment external ID type.",
5
5
  }));
6
6
  const flowAssignmentIdentitySchema = z.object({
7
7
  type: z.union([
@@ -7,15 +7,5 @@ export declare const assertNoSegmentExternalIdsInValueArgument: ({ argument, com
7
7
  valueArgumentName: ExternalIdArgumentValueName;
8
8
  callShape: ExternalIdsCallShape;
9
9
  }) => void;
10
- /**
11
- * @deprecated Use `assertNoSegmentExternalIdsInValueArgument`.
12
- */
13
- export declare const assertNoAmbiguousExternalIdsArgument: ({ argument, options, commandName, valueArgumentName, callShape, }: {
14
- argument: unknown;
15
- options?: unknown;
16
- commandName: ExternalIdArgumentCommandName;
17
- valueArgumentName: ExternalIdArgumentValueName;
18
- callShape?: ExternalIdsCallShape;
19
- }) => void;
20
10
  export {};
21
11
  //# sourceMappingURL=external-id-argument-guards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-id-argument-guards.d.ts","sourceRoot":"","sources":["../../src/host/external-id-argument-guards.ts"],"names":[],"mappings":"AAAA,KAAK,6BAA6B,GAAG,UAAU,GAAG,OAAO,CAAC;AAC1D,KAAK,2BAA2B,GAAG,QAAQ,GAAG,YAAY,CAAC;AAC3D,KAAK,oBAAoB,GACtB,2CAA2C,GAC3C,mCAAmC,GACnC,+CAA+C,CAAC;AA4CnD,eAAO,MAAM,yCAAyC,GAAI,0DAKvD;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,6BAA6B,CAAC;IAC3C,iBAAiB,EAAE,2BAA2B,CAAC;IAC/C,SAAS,EAAE,oBAAoB,CAAC;CAChC,KAAG,IAQH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC,GAAI,mEAMlD;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,6BAA6B,CAAC;IAC3C,iBAAiB,EAAE,2BAA2B,CAAC;IAC/C,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACjC,KAAG,IAWH,CAAC"}
1
+ {"version":3,"file":"external-id-argument-guards.d.ts","sourceRoot":"","sources":["../../src/host/external-id-argument-guards.ts"],"names":[],"mappings":"AAAA,KAAK,6BAA6B,GAAG,UAAU,GAAG,OAAO,CAAC;AAC1D,KAAK,2BAA2B,GAAG,QAAQ,GAAG,YAAY,CAAC;AAC3D,KAAK,oBAAoB,GACtB,2CAA2C,GAC3C,mCAAmC,GACnC,+CAA+C,CAAC;AAoCnD,eAAO,MAAM,yCAAyC,GAAI,0DAKvD;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,6BAA6B,CAAC;IAC3C,iBAAiB,EAAE,2BAA2B,CAAC;IAC/C,SAAS,EAAE,oBAAoB,CAAC;CAChC,KAAG,IAQH,CAAC"}
@@ -1,7 +1,3 @@
1
- const defaultCallShapeByCommand = {
2
- identify: "identify(userId, traits, { externalIds })",
3
- track: "track(eventName, properties, { externalIds })",
4
- };
5
1
  const hasSegmentExternalIdsProperty = (value) => {
6
2
  if (value === null || typeof value !== "object" || Array.isArray(value)) {
7
3
  return false;
@@ -26,17 +22,3 @@ export const assertNoSegmentExternalIdsInValueArgument = ({ argument, commandNam
26
22
  }
27
23
  throw new Error(`${commandName} received externalIds in the ${valueArgumentName} argument. Use ${callShape} instead.`);
28
24
  };
29
- /**
30
- * @deprecated Use `assertNoSegmentExternalIdsInValueArgument`.
31
- */
32
- export const assertNoAmbiguousExternalIdsArgument = ({ argument, options, commandName, valueArgumentName, callShape, }) => {
33
- if (options !== undefined) {
34
- return;
35
- }
36
- assertNoSegmentExternalIdsInValueArgument({
37
- argument,
38
- commandName,
39
- valueArgumentName,
40
- callShape: callShape ?? defaultCallShapeByCommand[commandName],
41
- });
42
- };
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { type ClaimPendingFlowAssignmentsRequest, type ClaimPendingFlowAssignmen
7
7
  export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, type StandardIdentityTypeValue, } from "./identity-type.js";
8
8
  export { isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
9
9
  export { type RuntimeEndpoints, resolveApiBaseUrl, resolveCoreUrl, resolveTrpcBaseUrl, runtimeEndpointsSchema, } from "./runtime-endpoints.js";
10
- export { getScopeMeta, isScope, listScopes, SCOPE_IDS, type Scope, scopeIdSchema, } from "./scopes.js";
10
+ export { getScopeMeta, isScope, listScopes, SCOPE_IDS, type Scope, type ScopeMeta, scopeIdSchema, } from "./scopes.js";
11
11
  export { type TrpcSuccessResponse, trpcSuccessResponseSchema, } from "./trpc-envelope.js";
12
12
  export { type FlowVersionResolution, flowVersionResolutionSchema, type ThemeVersionResolution, themeVersionResolutionSchema, } from "./version-resolution.js";
13
13
  export { type PublicCommandPayload, parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, publicWidgetCommandKindSchema, } from "./widget-commands.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sCAAsC,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,wCAAwC,EACxC,yCAAyC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,+BAA+B,E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EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,mBAAmB,EACxB,2BAA2B,EAC3B,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,KAAK,oBAAoB,EACzB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getuserfeedback/protocol",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
4
4
  "description": "getuserfeedback widget protocol — host surface and (later) wire protocol",
5
5
  "keywords": [
6
6
  "getuserfeedback",
@@ -44,7 +44,7 @@ describe("flow assignment request contracts", () => {
44
44
  holdOwnerKey: "inst_1",
45
45
  identities: [
46
46
  {
47
- type: "externalId.shopify_customer_id",
47
+ type: "externalId.users.none.shopify_customer_id",
48
48
  value: "gid://shopify/Customer/123",
49
49
  },
50
50
  ],
@@ -52,12 +52,48 @@ describe("flow assignment request contracts", () => {
52
52
 
53
53
  expect(result.identities).toEqual([
54
54
  {
55
- type: "externalId.shopify_customer_id",
55
+ type: "externalId.users.none.shopify_customer_id",
56
56
  value: "gid://shopify/Customer/123",
57
57
  },
58
58
  ]);
59
59
  });
60
60
 
61
+ it("rejects unsupported external ID identity namespaces", () => {
62
+ expect(() =>
63
+ claimPendingFlowAssignmentsRequestSchema.parse({
64
+ holdOwnerKey: "inst_1",
65
+ identities: [
66
+ {
67
+ type: "externalId.accounts.none.shopify_customer_id",
68
+ value: "gid://shopify/Customer/123",
69
+ },
70
+ ],
71
+ }),
72
+ ).toThrow("externalId.users.none.<type>");
73
+ expect(() =>
74
+ claimPendingFlowAssignmentsRequestSchema.parse({
75
+ holdOwnerKey: "inst_1",
76
+ identities: [
77
+ {
78
+ type: "externalId.users.custom.shopify_customer_id",
79
+ value: "gid://shopify/Customer/123",
80
+ },
81
+ ],
82
+ }),
83
+ ).toThrow("externalId.users.none.<type>");
84
+ expect(() =>
85
+ claimPendingFlowAssignmentsRequestSchema.parse({
86
+ holdOwnerKey: "inst_1",
87
+ identities: [
88
+ {
89
+ type: "externalId.shopify_customer_id",
90
+ value: "gid://shopify/Customer/123",
91
+ },
92
+ ],
93
+ }),
94
+ ).toThrow("externalId.users.none.<type>");
95
+ });
96
+
61
97
  it("accepts runtime targeting context for lifecycle updates", () => {
62
98
  const result = updateFlowAssignmentLifecycleRequestSchema.parse({
63
99
  identities: [{ type: "userId", value: "user_1" }],
@@ -7,7 +7,8 @@ import {
7
7
  } from "./app-event.js";
8
8
  import type { IdentityTypeValue } from "./identity-type.js";
9
9
 
10
- export type FlowAssignmentExternalIdIdentityTypeValue = `externalId.${string}`;
10
+ export type FlowAssignmentExternalIdIdentityTypeValue =
11
+ `externalId.users.none.${string}`;
11
12
  export type FlowAssignmentIdentityTypeValue =
12
13
  | IdentityTypeValue
13
14
  | FlowAssignmentExternalIdIdentityTypeValue;
@@ -15,9 +16,9 @@ export type FlowAssignmentIdentityTypeValue =
15
16
  const flowAssignmentExternalIdIdentityTypeSchema = z.string().check(
16
17
  z.trim(),
17
18
  z.minLength(1),
18
- z.regex(/^externalId\.[a-z0-9][a-z0-9_.-]*$/, {
19
+ z.regex(/^externalId\.users\.none\.[a-z0-9][a-z0-9_.-]*$/, {
19
20
  message:
20
- "External ID identity type must use externalId.<type> with a lowercase Segment external ID type.",
21
+ "External ID identity type must use externalId.users.none.<type> with a lowercase Segment external ID type.",
21
22
  }),
22
23
  ) as z.ZodMiniType<
23
24
  FlowAssignmentExternalIdIdentityTypeValue,
@@ -1,9 +1,6 @@
1
1
  import { describe, expect, it } from "bun:test";
2
2
 
3
- import {
4
- assertNoAmbiguousExternalIdsArgument,
5
- assertNoSegmentExternalIdsInValueArgument,
6
- } from "./external-id-argument-guards";
3
+ import { assertNoSegmentExternalIdsInValueArgument } from "./external-id-argument-guards";
7
4
 
8
5
  const segmentExternalIds = [
9
6
  {
@@ -43,15 +40,4 @@ describe("external ID argument guards", () => {
43
40
  }),
44
41
  ).not.toThrow();
45
42
  });
46
-
47
- it("preserves deprecated ambiguous guard behavior when options are present", () => {
48
- expect(() =>
49
- assertNoAmbiguousExternalIdsArgument({
50
- argument: { externalIds: segmentExternalIds },
51
- options: {},
52
- commandName: "identify",
53
- valueArgumentName: "traits",
54
- }),
55
- ).not.toThrow();
56
- });
57
43
  });
@@ -5,14 +5,6 @@ type ExternalIdsCallShape =
5
5
  | "identify(traits, { externalIds })"
6
6
  | "track(eventName, properties, { externalIds })";
7
7
 
8
- const defaultCallShapeByCommand: Record<
9
- ExternalIdArgumentCommandName,
10
- ExternalIdsCallShape
11
- > = {
12
- identify: "identify(userId, traits, { externalIds })",
13
- track: "track(eventName, properties, { externalIds })",
14
- };
15
-
16
8
  const hasSegmentExternalIdsProperty = (value: unknown): boolean => {
17
9
  if (value === null || typeof value !== "object" || Array.isArray(value)) {
18
10
  return false;
@@ -66,31 +58,3 @@ export const assertNoSegmentExternalIdsInValueArgument = ({
66
58
  `${commandName} received externalIds in the ${valueArgumentName} argument. Use ${callShape} instead.`,
67
59
  );
68
60
  };
69
-
70
- /**
71
- * @deprecated Use `assertNoSegmentExternalIdsInValueArgument`.
72
- */
73
- export const assertNoAmbiguousExternalIdsArgument = ({
74
- argument,
75
- options,
76
- commandName,
77
- valueArgumentName,
78
- callShape,
79
- }: {
80
- argument: unknown;
81
- options?: unknown;
82
- commandName: ExternalIdArgumentCommandName;
83
- valueArgumentName: ExternalIdArgumentValueName;
84
- callShape?: ExternalIdsCallShape;
85
- }): void => {
86
- if (options !== undefined) {
87
- return;
88
- }
89
-
90
- assertNoSegmentExternalIdsInValueArgument({
91
- argument,
92
- commandName,
93
- valueArgumentName,
94
- callShape: callShape ?? defaultCallShapeByCommand[commandName],
95
- });
96
- };
package/src/index.ts CHANGED
@@ -87,6 +87,7 @@ export {
87
87
  listScopes,
88
88
  SCOPE_IDS,
89
89
  type Scope,
90
+ type ScopeMeta,
90
91
  scopeIdSchema,
91
92
  } from "./scopes.js";
92
93
  export {