@layerzerolabs/dw-model 1.2.50 → 1.2.52

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.
Files changed (58) hide show
  1. package/dist/{VJE5VDUA.js → 3HRY2AFJ.js} +32 -13
  2. package/dist/3HRY2AFJ.js.map +1 -0
  3. package/dist/GUE2HICK.js +37 -0
  4. package/dist/GUE2HICK.js.map +1 -0
  5. package/dist/JYX6YDJT.js +8 -0
  6. package/dist/JYX6YDJT.js.map +1 -0
  7. package/dist/{GLPJHNSD.js → MQAXH3BY.js} +2 -2
  8. package/dist/MQAXH3BY.js.map +1 -0
  9. package/dist/P6EYHSSL.js +25 -0
  10. package/dist/P6EYHSSL.js.map +1 -0
  11. package/dist/{OAY3VYYR.js → QSWSDTGN.js} +4 -13
  12. package/dist/QSWSDTGN.js.map +1 -0
  13. package/dist/V2SO4JCF.js +3 -0
  14. package/dist/V2SO4JCF.js.map +1 -0
  15. package/dist/VVVZENMZ.js +50 -0
  16. package/dist/VVVZENMZ.js.map +1 -0
  17. package/dist/WTTXALME.js +12 -0
  18. package/dist/WTTXALME.js.map +1 -0
  19. package/dist/deploy/artifact.d.ts +0 -13
  20. package/dist/deploy/artifact.d.ts.map +1 -1
  21. package/dist/deploy/artifact.js +1 -1
  22. package/dist/deploy/createCompositeResourceRef.d.ts +16 -0
  23. package/dist/deploy/createCompositeResourceRef.d.ts.map +1 -0
  24. package/dist/deploy/createCompositeResourceRef.js +5 -0
  25. package/dist/deploy/createCompositeResourceRef.js.map +1 -0
  26. package/dist/deploy/factoryInterfaces.d.ts +31 -8
  27. package/dist/deploy/factoryInterfaces.d.ts.map +1 -1
  28. package/dist/deploy/factoryInterfaces.js +4 -2
  29. package/dist/deploy/getResourceSet.d.ts +19 -0
  30. package/dist/deploy/getResourceSet.d.ts.map +1 -0
  31. package/dist/deploy/getResourceSet.js +4 -0
  32. package/dist/deploy/getResourceSet.js.map +1 -0
  33. package/dist/deploy/index.d.ts +5 -0
  34. package/dist/deploy/index.d.ts.map +1 -1
  35. package/dist/deploy/index.js +10 -5
  36. package/dist/deploy/resourceIdScope.d.ts +10 -0
  37. package/dist/deploy/resourceIdScope.d.ts.map +1 -0
  38. package/dist/deploy/resourceIdScope.js +4 -0
  39. package/dist/deploy/resourceIdScope.js.map +1 -0
  40. package/dist/deploy/resourceRef.d.ts +16 -0
  41. package/dist/deploy/resourceRef.d.ts.map +1 -0
  42. package/dist/deploy/resourceRef.js +4 -0
  43. package/dist/deploy/resourceRef.js.map +1 -0
  44. package/dist/deploy/resourceSet.d.ts +14 -0
  45. package/dist/deploy/resourceSet.d.ts.map +1 -0
  46. package/dist/deploy/resourceSet.js +4 -0
  47. package/dist/deploy/resourceSet.js.map +1 -0
  48. package/dist/deploy/workflow.d.ts +0 -2
  49. package/dist/deploy/workflow.d.ts.map +1 -1
  50. package/dist/deploy/workflow.js +1 -1
  51. package/dist/index.js +14 -9
  52. package/dist/role-management/index.js +1 -1
  53. package/package.json +10 -10
  54. package/dist/CA6UC3D3.js +0 -3
  55. package/dist/CA6UC3D3.js.map +0 -1
  56. package/dist/GLPJHNSD.js.map +0 -1
  57. package/dist/OAY3VYYR.js.map +0 -1
  58. package/dist/VJE5VDUA.js.map +0 -1
@@ -1,17 +1,14 @@
1
- import { artifactWithTypeSchema, ArtifactType } from './OAY3VYYR.js';
1
+ import { resourceSetSchema } from './WTTXALME.js';
2
+ import { artifactWithTypeSchema, ArtifactType } from './QSWSDTGN.js';
3
+ import { resourceRefSchema, resourceIdSchema, resourceSubKeySchema } from './P6EYHSSL.js';
2
4
  import { __name } from './VUOMXK5T.js';
3
5
  import z from 'zod';
4
6
  import { chainNameSchema } from '@layerzerolabs/layerzero-definitions';
5
7
  import { functionSchema } from '@layerzerolabs/zod-utils';
6
8
 
7
- var resourceRefSchema = z.object({
8
- resourceId: z.string(),
9
- // Some resources can have multiple realIDs, leave this undefined for the default
10
- resourceSubKey: z.string().optional()
11
- });
12
9
  var realIdSchema = z.object({
13
10
  realIdKey: z.string(),
14
- // some realIDs are scoped to a chain, some aren't
11
+ // Omit when the RealID is not chain-scoped.
15
12
  chainName: chainNameSchema.optional()
16
13
  });
17
14
  var artifactRegistryActivityFactorySchema = z.object({
@@ -50,12 +47,22 @@ var createMockArtifactRegistry = /* @__PURE__ */ __name(() => {
50
47
  args.ref.resourceSubKey ?? null
51
48
  ]), "getArtifactKey");
52
49
  const artifactStore = /* @__PURE__ */ new Map();
50
+ const getArtifact = /* @__PURE__ */ __name(async (args) => {
51
+ const value = artifactStore.get(getArtifactKey(args));
52
+ if (value == null) {
53
+ return void 0;
54
+ }
55
+ if (value.artifactType !== args.artifactType) {
56
+ return void 0;
57
+ }
58
+ return value;
59
+ }, "getArtifact");
53
60
  const mockArtifactRegistry = {
54
61
  getAllArtifacts: /* @__PURE__ */ __name(() => [
55
62
  ...artifactStore.values()
56
63
  ], "getAllArtifacts"),
57
64
  hasArtifact: /* @__PURE__ */ __name(async (args) => artifactStore.has(getArtifactKey(args)), "hasArtifact"),
58
- getArtifact: /* @__PURE__ */ __name(async (args) => artifactStore.get(getArtifactKey(args)), "getArtifact"),
65
+ getArtifact,
59
66
  saveArtifact: /* @__PURE__ */ __name(async ({ ref, artifact }) => {
60
67
  artifactStore.set(getArtifactKey({
61
68
  artifactType: artifact.artifactType,
@@ -93,15 +100,27 @@ var resourceRegistryActivityFactorySchema = z.object({
93
100
  output: z.promise(z.void())
94
101
  }),
95
102
  // TODO: add pagination for large resource sets
103
+ // Omit resourceId to list the full registry; pass resourceId for O(subkeys) scoped discovery.
96
104
  listResourceRealIds: functionSchema({
97
- input: z.tuple([]),
105
+ input: z.tuple([
106
+ z.object({
107
+ resourceId: resourceIdSchema.optional()
108
+ }).optional()
109
+ ]),
98
110
  output: z.promise(z.array(z.object({
99
- resourceId: z.string(),
111
+ resourceId: resourceIdSchema,
112
+ resourceSubKey: resourceSubKeySchema.optional(),
100
113
  realId: realIdSchema
101
114
  })))
115
+ }),
116
+ getResourceSet: functionSchema({
117
+ input: z.tuple([
118
+ resourceIdSchema
119
+ ]),
120
+ output: z.promise(resourceSetSchema)
102
121
  })
103
122
  });
104
123
 
105
- export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRefSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema };
106
- //# sourceMappingURL=VJE5VDUA.js.map
107
- //# sourceMappingURL=VJE5VDUA.js.map
124
+ export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema };
125
+ //# sourceMappingURL=3HRY2AFJ.js.map
126
+ //# sourceMappingURL=3HRY2AFJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/factoryInterfaces.ts"],"names":["realIdSchema","z","object","realIdKey","string","chainName","chainNameSchema","optional","artifactRegistryActivityFactorySchema","hasArtifact","functionSchema","input","tuple","ref","resourceRefSchema","artifactType","enum","ArtifactType","output","promise","boolean","getArtifact","artifactWithTypeSchema","saveArtifact","artifact","void","createMockArtifactRegistry","getArtifactKey","args","JSON","stringify","resourceId","resourceSubKey","artifactStore","Map","value","get","undefined","mockArtifactRegistry","getAllArtifacts","values","has","set","upsertResourceRealIdArgsSchema","realId","resourceRegistryActivityFactorySchema","getResourceRealId","upsertResourceRealId","deleteResourceRealId","listResourceRealIds","resourceIdSchema","array","resourceSubKeySchema","getResourceSet","resourceSetSchema"],"mappings":";;;;;;;;AAeO,IAAMA,YAAAA,GAAeC,EAAEC,MAAAA,CAAO;AACjCC,EAAAA,SAAAA,EAAWF,EAAEG,MAAAA,EAAM;;AAEnBC,EAAAA,SAAAA,EAAWC,gBAAgBC,QAAAA;AAC/B,CAAA;AAIO,IAAMC,qCAAAA,GAAwCP,EAAEC,MAAAA,CAAO;AAC1DO,EAAAA,WAAAA,EAAaC,cAAAA,CAAe;AACxBC,IAAAA,KAAAA,EAAOV,EAAEW,KAAAA,CAAM;AACXX,MAAA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ACZ,KAAA,CAAA,CAAA;GAGZ,CAAA;AAEAqD,EAAAA,cAAAA,EAAgB3C,cAAAA,CAAe;AAC3BC,IAAAA,KAAAA,EAAOV,EAAEW,KAAAA,CAAM;AAACsC,MAAAA;AAAiB,KAAA,CAAA;IACjChC,MAAAA,EAAQjB,CAAAA,CAAEkB,QAAQmC,iBAAAA;GACtB;AACJ,CAAA","file":"3HRY2AFJ.js","sourcesContent":["import z from 'zod';\n\nimport { chainNameSchema } from '@layerzerolabs/layerzero-definitions';\nimport { functionSchema } from '@layerzerolabs/zod-utils';\n\nimport type { ArtifactWithType } from './artifact';\nimport { ArtifactType, artifactWithTypeSchema } from './artifact';\nimport {\n resourceIdSchema,\n type ResourceRef,\n resourceRefSchema,\n resourceSubKeySchema,\n} from './resourceRef';\nimport { resourceSetSchema } from './resourceSet';\n\nexport const realIdSchema = z.object({\n realIdKey: z.string(),\n // Omit when the RealID is not chain-scoped.\n chainName: chainNameSchema.optional(),\n});\n\nexport type RealId = z.infer<typeof realIdSchema>;\n\nexport const artifactRegistryActivityFactorySchema = z.object({\n hasArtifact: functionSchema({\n input: z.tuple([\n z.object({\n ref: resourceRefSchema,\n artifactType: z.enum(ArtifactType),\n }),\n ]),\n output: z.promise(z.boolean()),\n }),\n\n getArtifact: functionSchema({\n input: z.tuple([\n z.object({\n ref: resourceRefSchema,\n artifactType: z.enum(ArtifactType),\n }),\n ]),\n output: z.promise(artifactWithTypeSchema.optional()),\n }) as z.ZodType<\n <Type extends ArtifactType>(args: {\n artifactType: Type;\n ref: ResourceRef;\n }) => Promise<Extract<ArtifactWithType, { artifactType: Type }> | undefined>\n >,\n\n saveArtifact: functionSchema({\n input: z.tuple([\n z.object({\n ref: resourceRefSchema,\n artifact: artifactWithTypeSchema,\n }),\n ]),\n output: z.promise(z.void()),\n }),\n});\n\nexport interface ArtifactRegistry extends z.infer<typeof artifactRegistryActivityFactorySchema> {}\n\nexport interface MockArtifactRegistry extends ArtifactRegistry {\n getAllArtifacts: () => ArtifactWithType[];\n}\nexport const createMockArtifactRegistry = (): MockArtifactRegistry => {\n const getArtifactKey = (args: Parameters<ArtifactRegistry['getArtifact']>[0]) =>\n JSON.stringify([args.artifactType, args.ref.resourceId, args.ref.resourceSubKey ?? null]);\n\n const artifactStore = new Map<string, ArtifactWithType>();\n\n const getArtifact: ArtifactRegistry['getArtifact'] = async (args) => {\n const value = artifactStore.get(getArtifactKey(args));\n if (value == null) {\n return undefined;\n }\n if (value.artifactType !== args.artifactType) {\n return undefined;\n }\n return value as Extract<ArtifactWithType, { artifactType: typeof args.artifactType }>;\n };\n\n const mockArtifactRegistry: MockArtifactRegistry = {\n getAllArtifacts: () => [...artifactStore.values()],\n\n hasArtifact: async (args) => artifactStore.has(getArtifactKey(args)),\n getArtifact,\n saveArtifact: async ({ ref, artifact }) => {\n artifactStore.set(\n getArtifactKey({ artifactType: artifact.artifactType, ref }),\n artifact,\n );\n },\n };\n\n return mockArtifactRegistry;\n};\n\nexport const upsertResourceRealIdArgsSchema = z.object({\n ref: resourceRefSchema,\n realId: realIdSchema,\n});\n\nexport const resourceRegistryActivityFactorySchema = z.object({\n getResourceRealId: functionSchema({\n input: z.tuple([z.object({ ref: resourceRefSchema })]),\n output: z.promise(realIdSchema.optional()),\n }),\n upsertResourceRealId: functionSchema({\n input: z.tuple([upsertResourceRealIdArgsSchema]),\n output: z.promise(z.void()),\n }),\n deleteResourceRealId: functionSchema({\n input: z.tuple([z.object({ ref: resourceRefSchema })]),\n output: z.promise(z.void()),\n }),\n\n // TODO: add pagination for large resource sets\n // Omit resourceId to list the full registry; pass resourceId for O(subkeys) scoped discovery.\n listResourceRealIds: functionSchema({\n input: z.tuple([\n z\n .object({\n resourceId: resourceIdSchema.optional(),\n })\n .optional(),\n ]),\n output: z.promise(\n z.array(\n z.object({\n resourceId: resourceIdSchema,\n resourceSubKey: resourceSubKeySchema.optional(),\n realId: realIdSchema,\n }),\n ),\n ),\n }),\n\n getResourceSet: functionSchema({\n input: z.tuple([resourceIdSchema]),\n output: z.promise(resourceSetSchema),\n }),\n});\n\nexport interface ResourceRegistry extends z.infer<typeof resourceRegistryActivityFactorySchema> {}\n\n/** RealID get/list surface required by {@link bindGetResourceSet}. */\nexport type ResourceRegistryRealIdAccess = Pick<\n ResourceRegistry,\n 'getResourceRealId' | 'listResourceRealIds'\n>;\n"]}
@@ -0,0 +1,37 @@
1
+ import { assertResourceRef } from './P6EYHSSL.js';
2
+ import { __name } from './VUOMXK5T.js';
3
+ import { NonRetryableError } from '@layerzerolabs/common-error-utils';
4
+
5
+ var createCompositeResourceRef = /* @__PURE__ */ __name((ref) => {
6
+ const { resourceId, resourceSubKey } = assertResourceRef(ref);
7
+ if (resourceSubKey != null) {
8
+ return `${resourceId}/${resourceSubKey}`;
9
+ }
10
+ return resourceId;
11
+ }, "createCompositeResourceRef");
12
+ var parseCompositeResourceRef = /* @__PURE__ */ __name((compositeRef) => {
13
+ if (compositeRef === "") {
14
+ throw new NonRetryableError(`composite resource ref must not be empty`);
15
+ }
16
+ const slashIndex = compositeRef.indexOf("/");
17
+ if (slashIndex === -1) {
18
+ return assertResourceRef({
19
+ resourceId: compositeRef
20
+ });
21
+ }
22
+ return assertResourceRef({
23
+ resourceId: compositeRef.slice(0, slashIndex),
24
+ resourceSubKey: compositeRef.slice(slashIndex + 1)
25
+ });
26
+ }, "parseCompositeResourceRef");
27
+ var listEntryFromCompositeRef = /* @__PURE__ */ __name((compositeRef, realId) => {
28
+ const ref = parseCompositeResourceRef(compositeRef);
29
+ return {
30
+ ...ref,
31
+ realId
32
+ };
33
+ }, "listEntryFromCompositeRef");
34
+
35
+ export { createCompositeResourceRef, listEntryFromCompositeRef, parseCompositeResourceRef };
36
+ //# sourceMappingURL=GUE2HICK.js.map
37
+ //# sourceMappingURL=GUE2HICK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/createCompositeResourceRef.ts"],"names":["createCompositeResourceRef","ref","resourceId","resourceSubKey","assertResourceRef","parseCompositeResourceRef","compositeRef","NonRetryableError","slashIndex","indexOf","slice","listEntryFromCompositeRef","realId"],"mappings":";;;;AAQO,IAAMA,0BAAAA,2BAA8BC,GAAAA,KAAAA;AACvC,EAAA,MAAM,EAAEC,UAAAA,EAAYC,cAAAA,EAAc,GAAKC,kBAAkBH,GAAAA,CAAAA;AAEzD,EAAA,IAAIE,kBAAkB,IAAA,EAAM;AACxB,IAAA,OAAO,CAAA,EAAGD,UAAAA,CAAAA,CAAAA,EAAcC,cAAAA,CAAAA,CAAAA;AAC5B,EAAA;AAEA,EAAA,OAAOD,UAAAA;AACX,CAAA,EAR0C,4BAAA;AAcnC,IAAMG,yBAAAA,2BAA6BC,YAAAA,KAAAA;AACtC,EAAA,IAAIA,iBAAiB,EAAA,EAAI;AACrB,IAAA,MAAM,IAAIC,kBAAkB,CAAA,wCAAA,CAA0C,CAAA;AAC1E,EAAA;AAEA,EAAA,MAAMC,UAAAA,GAAaF,YAAAA,CAAaG,OAAAA,CAAQ,GAAA,CAAA;AACxC,EAAA,IAAID,eAAe,EAAA,EAAI;AACnB,IAAA,OAAOJ,iBAAAA,CAAkB;MAAEF,UAAAA,EAAYI;KAAa,CAAA;AACxD,EAAA;AAEA,EAAA,OAAOF,iBAAAA,CAAkB;IACrBF,UAAAA,EAAYI,YAAAA,CAAaI,KAAAA,CAAM,CAAA,EAAGF,UAAAA,CAAAA;IAClCL,cAAAA,EAAgBG,YAAAA,CAAaI,KAAAA,CAAMF,UAAAA,GAAa,CAAA;GACpD,CAAA;AACJ,CAAA,EAdyC,2BAAA;AAiBlC,IAAMG,yBAAAA,mBAA4B,MAAA,CAAA,CACrCL,YAAAA,EACAM,MAAAA,KAAAA;AAEA,EAAA,MAAMX,GAAAA,GAAMI,0BAA0BC,YAAAA,CAAAA;AACtC,EAAA,OAAO;IAAE,GAAGL,GAAAA;AAAKW,IAAAA;AAAO,GAAA;AAC5B,CAAA,EANyC,2BAAA","file":"GUE2HICK.js","sourcesContent":["import { NonRetryableError } from '@layerzerolabs/common-error-utils';\n\nimport { assertResourceRef, type ResourceRef } from './resourceRef';\n\n/**\n * Storage-key form of a resource ref: `resourceId` or `resourceId/resourceSubKey`.\n * Used by resource/artifact registries for map/DDB keys.\n */\nexport const createCompositeResourceRef = (ref: ResourceRef): string => {\n const { resourceId, resourceSubKey } = assertResourceRef(ref);\n\n if (resourceSubKey != null) {\n return `${resourceId}/${resourceSubKey}`;\n }\n\n return resourceId;\n};\n\n/**\n * Inverse of {@link createCompositeResourceRef}: parse a storage key into a structured ref.\n * List APIs must return this shape — never leave the composite string in `resourceId`.\n */\nexport const parseCompositeResourceRef = (compositeRef: string): ResourceRef => {\n if (compositeRef === '') {\n throw new NonRetryableError(`composite resource ref must not be empty`);\n }\n\n const slashIndex = compositeRef.indexOf('/');\n if (slashIndex === -1) {\n return assertResourceRef({ resourceId: compositeRef });\n }\n\n return assertResourceRef({\n resourceId: compositeRef.slice(0, slashIndex),\n resourceSubKey: compositeRef.slice(slashIndex + 1),\n });\n};\n\n/** Build a structured list row so callers never treat the storage composite as `resourceId`. */\nexport const listEntryFromCompositeRef = <TRealId>(\n compositeRef: string,\n realId: TRealId,\n): ResourceRef & { realId: TRealId } => {\n const ref = parseCompositeResourceRef(compositeRef);\n return { ...ref, realId };\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import { __name } from './VUOMXK5T.js';
2
+
3
+ // src/deploy/resourceIdScope.ts
4
+ var isCompositeResourceIdInScope = /* @__PURE__ */ __name(({ compositeRef, resourceId }) => compositeRef === resourceId || compositeRef.startsWith(`${resourceId}/`), "isCompositeResourceIdInScope");
5
+
6
+ export { isCompositeResourceIdInScope };
7
+ //# sourceMappingURL=JYX6YDJT.js.map
8
+ //# sourceMappingURL=JYX6YDJT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/resourceIdScope.ts"],"names":["isCompositeResourceIdInScope","compositeRef","resourceId","startsWith"],"mappings":";;;AAKO,IAAMA,4BAAAA,mBAA+B,MAAA,CAAA,CAAC,EACzCC,YAAAA,EACAC,UAAAA,EAAU,KAICD,YAAAA,KAAiBC,UAAAA,IAAcD,YAAAA,CAAaE,UAAAA,CAAW,CAAA,EAAGD,UAAAA,GAAa,CAAA,EAN1C,8BAAA","file":"JYX6YDJT.js","sourcesContent":["/**\n * Whether a composite storage key (`resourceId` or `resourceId/subKey`) belongs to\n * the given resourceId. Uses `resourceId/` prefix — never bare startsWith\n * (so `foo` does not match `foobar`).\n */\nexport const isCompositeResourceIdInScope = ({\n compositeRef,\n resourceId,\n}: {\n compositeRef: string;\n resourceId: string;\n}): boolean => compositeRef === resourceId || compositeRef.startsWith(`${resourceId}/`);\n"]}
@@ -21,5 +21,5 @@ var deployWorkflowOrchestratorStateSchema = z.object({
21
21
  });
22
22
 
23
23
  export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema };
24
- //# sourceMappingURL=GLPJHNSD.js.map
25
- //# sourceMappingURL=GLPJHNSD.js.map
24
+ //# sourceMappingURL=MQAXH3BY.js.map
25
+ //# sourceMappingURL=MQAXH3BY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/workflow.ts"],"names":["extractVerificationArtifactBaseArgsSchema","z","object","gtx","customSchema","deployWorkflowChainStateSchema","srcChain","chainNameSchema","optional","status","union","literal","default","deployWorkflowOrchestratorStateSchema"],"mappings":";;;;;AAUO,IAAMA,yCAAAA,GAA4CC,EAAEC,MAAAA,CAAO;AAC9DC,EAAAA,GAAAA,EAAKC,YAAAA;AACT,CAAA;AASO,IAAMC,8BAAAA,GAAiCJ,EAAEC,MAAAA,CAAO;AACnDI,EAAAA,QAAAA,EAAUC,gBAAgBC,QAAAA,EAAQ;AAClCC,EAAAA,MAAAA,EAAQR,EAAES,KAAAA,CAAM;AAACT,IAAAA,CAAAA,CAAEU,QAAQ,SAAA,CAAA;AAAYV,IAAAA,CAAAA,CAAEU,QAAQ,UAAA;AAAY,GAAA,CAAA,CAAEC,QAAQ,SAAA;AAC3E,CAAA;AAEO,IAAMC,qCAAAA,GAAwCZ,EAAEC,MAAAA,CAAO;AAC1DO,EAAAA,MAAAA,EAAQR,EAAES,KAAAA,CAAM;AAACT,IAAAA,CAAAA,CAAEU,QAAQ,SAAA,CAAA;AAAYV,IAAAA,CAAAA,CAAEU,QAAQ,UAAA;AAAY,GAAA,CAAA,CAAEC,QAAQ,SAAA;AAC3E,CAAA","file":"MQAXH3BY.js","sourcesContent":["import { z } from 'zod';\n\nimport type { SuccessfulGatedTransaction } from '@layerzerolabs/gated-transaction';\nimport { chainNameSchema } from '@layerzerolabs/layerzero-definitions';\nimport { customSchema } from '@layerzerolabs/zod-utils';\n\n// ---------------------------------------------------------------------------\n// Deprecated types (to be removed)\n// ---------------------------------------------------------------------------\n\nexport const extractVerificationArtifactBaseArgsSchema = z.object({\n gtx: customSchema<SuccessfulGatedTransaction>(),\n});\nexport type ExtractVerificationArtifactBaseArgs = z.infer<\n typeof extractVerificationArtifactBaseArgsSchema\n>;\n\n// ---------------------------------------------------------------------------\n// Deploy workflow state schemas\n// ---------------------------------------------------------------------------\n\nexport const deployWorkflowChainStateSchema = z.object({\n srcChain: chainNameSchema.optional(),\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\nexport const deployWorkflowOrchestratorStateSchema = z.object({\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\n// ---------------------------------------------------------------------------\n// Deploy workflow types\n// ---------------------------------------------------------------------------\n\nexport type DeployWorkflowChainState = z.infer<typeof deployWorkflowChainStateSchema>;\nexport type DeployWorkflowOrchestratorState = z.infer<typeof deployWorkflowOrchestratorStateSchema>;\n"]}
@@ -0,0 +1,25 @@
1
+ import { __name } from './VUOMXK5T.js';
2
+ import { z } from 'zod';
3
+ import { NonRetryableError } from '@layerzerolabs/common-error-utils';
4
+
5
+ var noSlash = /* @__PURE__ */ __name((label) => z.string().min(1).refine((s) => !s.includes("/"), {
6
+ message: `${label} cannot include the character / (forward slash)`
7
+ }), "noSlash");
8
+ var resourceIdSchema = noSlash("resourceId");
9
+ var resourceSubKeySchema = noSlash("resourceSubKey");
10
+ var resourceRefSchema = z.object({
11
+ resourceId: resourceIdSchema,
12
+ // Omit to reference the resource's identity RealID.
13
+ resourceSubKey: resourceSubKeySchema.optional()
14
+ });
15
+ var assertResourceRef = /* @__PURE__ */ __name((ref) => {
16
+ const parsed = resourceRefSchema.safeParse(ref);
17
+ if (!parsed.success) {
18
+ throw new NonRetryableError(parsed.error.issues.map((issue) => issue.message).join("; "));
19
+ }
20
+ return parsed.data;
21
+ }, "assertResourceRef");
22
+
23
+ export { assertResourceRef, resourceIdSchema, resourceRefSchema, resourceSubKeySchema };
24
+ //# sourceMappingURL=P6EYHSSL.js.map
25
+ //# sourceMappingURL=P6EYHSSL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/resourceRef.ts"],"names":["noSlash","label","z","string","min","refine","s","includes","message","resourceIdSchema","resourceSubKeySchema","resourceRefSchema","object","resourceId","resourceSubKey","optional","assertResourceRef","ref","parsed","safeParse","success","NonRetryableError","error","issues","map","issue","join","data"],"mappings":";;;;AAIA,IAAMA,0BAAU,MAAA,CAAA,CAACC,KAAAA,KACbC,CAAAA,CACKC,MAAAA,GACAC,GAAAA,CAAI,CAAA,CAAA,CACJC,MAAAA,CAAO,CAACC,CAAAA,KAAM,CAACA,CAAAA,CAAEC,QAAAA,CAAS,GAAA,CAAA,EAAM;AAC7BC,EAAAA,OAAAA,EAAS,GAAGP,KAAAA,CAAAA,+CAAAA;AAChB,CAAA,CAAA,EANQ,SAAA,CAAA;AAST,IAAMQ,gBAAAA,GAAmBT,QAAQ,YAAA;AAEjC,IAAMU,oBAAAA,GAAuBV,QAAQ,gBAAA;AAGrC,IAAMW,iBAAAA,GAAoBT,EAAEU,MAAAA,CAAO;EACtCC,UAAAA,EAAYJ,gBAAAA;;AAEZK,EAAAA,cAAAA,EAAgBJ,qBAAqBK,QAAAA;AACzC,CAAA;AAKO,IAAMC,iBAAAA,2BAAqBC,GAAAA,KAAAA;AAI9B,EAAA,MAAMC,MAAAA,GAASP,iBAAAA,CAAkBQ,SAAAA,CAAUF,GAAAA,CAAAA;AAC3C,EAAA,IAAI,CAACC,OAAOE,OAAAA,EAAS;AACjB,IAAA,MAAM,IAAIC,iBAAAA,CAAkBH,MAAAA,CAAOI,KAAAA,CAAMC,MAAAA,CAAOC,GAAAA,CAAI,CAACC,KAAAA,KAAUA,KAAAA,CAAMjB,OAAO,CAAA,CAAEkB,IAAAA,CAAK,IAAA,CAAA,CAAA;AACvF,EAAA;AACA,EAAA,OAAOR,MAAAA,CAAOS,IAAAA;AAClB,CAAA,EATiC,mBAAA","file":"P6EYHSSL.js","sourcesContent":["import { z } from 'zod';\n\nimport { NonRetryableError } from '@layerzerolabs/common-error-utils';\n\nconst noSlash = (label: string) =>\n z\n .string()\n .min(1)\n .refine((s) => !s.includes('/'), {\n message: `${label} cannot include the character / (forward slash)`,\n });\n\n/** `foo/bar` is a composite ref: resourceId `foo`, resourceSubKey `bar`. */\nexport const resourceIdSchema = noSlash('resourceId');\n\nexport const resourceSubKeySchema = noSlash('resourceSubKey');\n\n/** Reference to a resource's identity RealID or one selected by resourceSubKey. */\nexport const resourceRefSchema = z.object({\n resourceId: resourceIdSchema,\n // Omit to reference the resource's identity RealID.\n resourceSubKey: resourceSubKeySchema.optional(),\n});\n\nexport type ResourceRef = z.infer<typeof resourceRefSchema>;\n\n/** Schema parse as NonRetryableError; ZodError is opaque and retryable. */\nexport const assertResourceRef = (ref: {\n resourceId: string;\n resourceSubKey?: string;\n}): ResourceRef => {\n const parsed = resourceRefSchema.safeParse(ref);\n if (!parsed.success) {\n throw new NonRetryableError(parsed.error.issues.map((issue) => issue.message).join('; '));\n }\n return parsed.data;\n};\n"]}
@@ -11,15 +11,6 @@ var ArtifactType = /* @__PURE__ */ (function(ArtifactType2) {
11
11
  return ArtifactType2;
12
12
  })({});
13
13
  var artifactTypeSchema = brandSchema(z.enum(ArtifactType), "ArtifactTypeSchema");
14
- var solanaDeploymentArtifactExtraInfoSchema = z.object({
15
- accounts: z.record(z.string(), normalizedHexSchema)
16
- });
17
- var suiDeploymentArtifactExtraInfoSchema = z.object({
18
- digest: z.string(),
19
- packageId: z.string(),
20
- objectIds: z.record(z.string(), z.string()),
21
- objectChanges: z.array(z.custom())
22
- });
23
14
  var identityOnlyDeploymentArtifactSchema = z.object({
24
15
  chainName: chainNameSchema,
25
16
  address: normalizedHexSchema
@@ -36,7 +27,7 @@ var fullDeploymentArtifactSchema = z.object({
36
27
  extraDeploymentInfo: z.any().optional()
37
28
  });
38
29
  var deploymentArtifactSchema = z.union([
39
- // Check this first since it's a superset
30
+ // Full schema first: it is a superset, so identity-only must not win the match.
40
31
  fullDeploymentArtifactSchema,
41
32
  identityOnlyDeploymentArtifactSchema
42
33
  ]);
@@ -62,6 +53,6 @@ var artifactWithTypeSchema = z.discriminatedUnion("artifactType", [
62
53
  })
63
54
  ]);
64
55
 
65
- export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, solanaDeploymentArtifactExtraInfoSchema, suiDeploymentArtifactExtraInfoSchema, verificationArtifactSchema };
66
- //# sourceMappingURL=OAY3VYYR.js.map
67
- //# sourceMappingURL=OAY3VYYR.js.map
56
+ export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, verificationArtifactSchema };
57
+ //# sourceMappingURL=QSWSDTGN.js.map
58
+ //# sourceMappingURL=QSWSDTGN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/artifact.ts"],"names":["ArtifactType","artifactTypeSchema","brandSchema","z","enum","identityOnlyDeploymentArtifactSchema","object","chainName","chainNameSchema","address","normalizedHexSchema","fullDeploymentArtifactSchema","shape","nativeAddress","string","bytecodeHash","optional","deploymentTimestamp","number","deployerAddress","txHash","extraDeploymentInfo","any","deploymentArtifactSchema","union","verificationArtifactSchema","metadataArtifactSchema","jobId","pushedAt","metadataResources","array","artifactWithTypeSchema","discriminatedUnion","artifactType","literal","artifact"],"mappings":";;;;;;AASO,IAAKA,YAAAA,6BAAAA,aAAAA,EAAAA;;;;AAAAA,EAAAA,OAAAA,aAAAA;;AASL,IAAMC,qBAAqBC,WAAAA,CAAYC,CAAAA,CAAEC,IAAAA,CAAKJ,YAAAA,GAAe,oBAAA;AAE7D,IAAMK,oCAAAA,GAAuCF,EAAEG,MAAAA,CAAO;EACzDC,SAAAA,EAAWC,eAAAA;EACXC,OAAAA,EAASC;AACb,CAAA;AAIO,IAAMC,4BAAAA,GAA+BR,EAAEG,MAAAA,CAAO;AACjD,EAAA,GAAGD,oCAAAA,CAAqCO,KAAAA;EACxCL,SAAAA,EAAWC,eAAAA;EACXC,OAAAA,EAASC,mBAAAA;AACTG,EAAAA,aAAAA,EAAeV,EAAEW,MAAAA,EAAM;EACvBC,YAAAA,EAAcZ,CAAAA,CAAEW,MAAAA,EAAM,CAAGE,QAAAA,EAAQ;AACjCC,EAAAA,mBAAAA,EAAqBd,EAAEe,MAAAA,EAAM;EAC7BC,eAAAA,EAAiBT,mBAAAA;AACjBU,EAAAA,MAAAA,EAAQjB,EAAEW,MAAAA,EAAM;EAChBO,mBAAAA,EAAqBlB,CAAAA,CAAEmB,GAAAA,EAAG,CAAGN,QAAAA;AACjC,CAAA;AAIO,IAAMO,wBAAAA,GAA2BpB,EAAEqB,KAAAA,CAAM;;AAE5Cb,EAAAA,4BAAAA;AACAN,EAAAA;AACH,CAAA;AAIM,IAAMoB,0BAAAA,GAA6BtB,EAAEmB,GAAAA;AAIrC,IAAMI,sBAAAA,GAAyBvB,EAAEG,MAAAA,CAAO;AAC3CqB,EAAAA,KAAAA,EAAOxB,EAAEW,MAAAA,EAAM;AACfc,EAAAA,QAAAA,EAAUzB,EAAEe,MAAAA,EAAM;;AAElBW,EAAAA,iBAAAA,EAAmB1B,CAAAA,CAAE2B,KAAAA,CAAM3B,CAAAA,CAAEmB,GAAAA,EAAG;AACpC,CAAA;AAIO,IAAMS,sBAAAA,GAAyB5B,CAAAA,CAAE6B,kBAAAA,CAAmB,cAAA,EAAgB;AACvE7B,EAAAA,CAAAA,CAAEG,MAAAA,CAAO;IACL2B,YAAAA,EAAc9B,CAAAA,CAAE+B,QAAO,YAAA,CAAA;IACvBC,QAAAA,EAAUZ;GACd,CAAA;AACApB,EAAAA,CAAAA,CAAEG,MAAAA,CAAO;IACL2B,YAAAA,EAAc9B,CAAAA,CAAE+B,QAAO,cAAA,CAAA;AACvBC,IAAAA,QAAAA,EAAUhC,EAAEmB,GAAAA;GAChB,CAAA;AACAnB,EAAAA,CAAAA,CAAEG,MAAAA,CAAO;IACL2B,YAAAA,EAAc9B,CAAAA,CAAE+B,QAAO,UAAA,CAAA;IACvBC,QAAAA,EAAUT;GACd;AACH,CAAA","file":"QSWSDTGN.js","sourcesContent":["import { z } from 'zod';\n\nimport { normalizedHexSchema } from '@layerzerolabs/common-chain-model';\nimport type { ChainName } from '@layerzerolabs/layerzero-definitions';\nimport { chainNameSchema } from '@layerzerolabs/layerzero-definitions';\nimport { brandSchema } from '@layerzerolabs/zod-utils';\nexport type { ChainName };\n\n// TODO: merge deployment and verification artifacts\nexport enum ArtifactType {\n // Full record from deployment on-chain\n DEPLOYMENT = 'deployment',\n // Information to verify contracts\n VERIFICATION = 'verification',\n // Record of a successful push to LayerZero metadata\n METADATA = 'metadata',\n}\n\nexport const artifactTypeSchema = brandSchema(z.enum(ArtifactType), 'ArtifactTypeSchema');\n\nexport const identityOnlyDeploymentArtifactSchema = z.object({\n chainName: chainNameSchema,\n address: normalizedHexSchema,\n});\nexport type IdentityOnlyDeploymentArtifact = z.infer<typeof identityOnlyDeploymentArtifactSchema>;\n\n// TODO: include verification artifact in this schema\nexport const fullDeploymentArtifactSchema = z.object({\n ...identityOnlyDeploymentArtifactSchema.shape,\n chainName: chainNameSchema,\n address: normalizedHexSchema,\n nativeAddress: z.string(),\n bytecodeHash: z.string().optional(),\n deploymentTimestamp: z.number(),\n deployerAddress: normalizedHexSchema,\n txHash: z.string(),\n extraDeploymentInfo: z.any().optional(),\n});\nexport type FullDeploymentArtifact = z.infer<typeof fullDeploymentArtifactSchema>;\n\n// TODO: decide whether to migrate stored identity-only artifacts to full artifacts and collapse this union into fullDeploymentArtifactSchema\nexport const deploymentArtifactSchema = z.union([\n // Full schema first: it is a superset, so identity-only must not win the match.\n fullDeploymentArtifactSchema,\n identityOnlyDeploymentArtifactSchema,\n]);\n\nexport type DeploymentArtifact = z.infer<typeof deploymentArtifactSchema>;\n\nexport const verificationArtifactSchema = z.any();\n\nexport type VerificationArtifact = z.infer<typeof verificationArtifactSchema>;\n\nexport const metadataArtifactSchema = z.object({\n jobId: z.string(),\n pushedAt: z.number(),\n // We can type this fully but probably needs to happen later\n metadataResources: z.array(z.any()),\n});\n\nexport type MetadataArtifact = z.infer<typeof metadataArtifactSchema>;\n\nexport const artifactWithTypeSchema = z.discriminatedUnion('artifactType', [\n z.object({\n artifactType: z.literal(ArtifactType.DEPLOYMENT),\n artifact: deploymentArtifactSchema,\n }),\n z.object({\n artifactType: z.literal(ArtifactType.VERIFICATION),\n artifact: z.any(),\n }),\n z.object({\n artifactType: z.literal(ArtifactType.METADATA),\n artifact: metadataArtifactSchema,\n }),\n]);\n\nexport type ArtifactWithType = z.infer<typeof artifactWithTypeSchema>;\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=V2SO4JCF.js.map
3
+ //# sourceMappingURL=V2SO4JCF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"V2SO4JCF.js"}
@@ -0,0 +1,50 @@
1
+ import { __name } from './VUOMXK5T.js';
2
+ import { isNormalizedHex } from '@layerzerolabs/common-chain-model';
3
+ import { NonRetryableError } from '@layerzerolabs/common-error-utils';
4
+
5
+ var requireNormalizedRealIdKey = /* @__PURE__ */ __name((realIdKey) => {
6
+ if (!isNormalizedHex(realIdKey)) {
7
+ throw new NonRetryableError(`Value is not normalized hex: "${realIdKey}"; getResourceSet requires NormalizedHex (0x...) realIdKey, not native`);
8
+ }
9
+ return realIdKey;
10
+ }, "requireNormalizedRealIdKey");
11
+ var getResourceSet = /* @__PURE__ */ __name(async ({ resourceId, resourceRegistry }) => {
12
+ if (resourceId === "") {
13
+ throw new NonRetryableError(`getResourceSet expects a non-empty resourceId`);
14
+ }
15
+ if (resourceId.includes("/")) {
16
+ throw new NonRetryableError(`getResourceSet expects an unqualified resourceId; got subkey-qualified ref "${resourceId}"`);
17
+ }
18
+ const identity = await resourceRegistry.getResourceRealId({
19
+ ref: {
20
+ resourceId
21
+ }
22
+ });
23
+ if (!identity) {
24
+ throw new NonRetryableError(`No realId for resourceId "${resourceId}"`);
25
+ }
26
+ const entries = await resourceRegistry.listResourceRealIds({
27
+ resourceId
28
+ });
29
+ const subkeys = {};
30
+ for (const entry of entries) {
31
+ if (!entry.resourceSubKey) {
32
+ continue;
33
+ }
34
+ subkeys[entry.resourceSubKey] = requireNormalizedRealIdKey(entry.realId.realIdKey);
35
+ }
36
+ return {
37
+ address: requireNormalizedRealIdKey(identity.realIdKey),
38
+ subkeys
39
+ };
40
+ }, "getResourceSet");
41
+ var bindGetResourceSet = /* @__PURE__ */ __name((registry) => {
42
+ return (resourceId) => getResourceSet({
43
+ resourceId,
44
+ resourceRegistry: registry
45
+ });
46
+ }, "bindGetResourceSet");
47
+
48
+ export { bindGetResourceSet, getResourceSet };
49
+ //# sourceMappingURL=VVVZENMZ.js.map
50
+ //# sourceMappingURL=VVVZENMZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/getResourceSet.ts"],"names":["requireNormalizedRealIdKey","realIdKey","isNormalizedHex","NonRetryableError","getResourceSet","resourceId","resourceRegistry","includes","identity","getResourceRealId","ref","entries","listResourceRealIds","subkeys","entry","resourceSubKey","realId","address","bindGetResourceSet","registry"],"mappings":";;;;AAaA,IAAMA,0BAAAA,2BAA8BC,SAAAA,KAAAA;AAChC,EAAA,IAAI,CAACC,eAAAA,CAAgBD,SAAAA,CAAAA,EAAY;AAC7B,IAAA,MAAM,IAAIE,iBAAAA,CACN,CAAA,8BAAA,EAAiCF,SAAAA,CAAAA,sEAAAA,CAAiF,CAAA;AAE1H,EAAA;AACA,EAAA,OAAOA,SAAAA;AACX,CAAA,EAPmC,4BAAA,CAAA;AAkB5B,IAAMG,cAAAA,mBAAiB,MAAA,CAAA,OAAO,EACjCC,UAAAA,EACAC,kBAAgB,KAInB;AACG,EAAA,IAAID,eAAe,EAAA,EAAI;AACnB,IAAA,MAAM,IAAIF,kBAAkB,CAAA,6CAAA,CAA+C,CAAA;AAC/E,EAAA;AAEA,EAAA,IAAIE,UAAAA,CAAWE,QAAAA,CAAS,GAAA,CAAA,EAAM;AAC1B,IAAA,MAAM,IAAIJ,iBAAAA,CACN,CAAA,4EAAA,EAA+EE,UAAAA,CAAAA,CAAAA,CAAa,CAAA;AAEpG,EAAA;AAEA,EAAA,MAAMG,QAAAA,GAAW,MAAMF,gBAAAA,CAAiBG,iBAAAA,CAAkB;IAAEC,GAAAA,EAAK;AAAEL,MAAAA;AAAW;GAAE,CAAA;AAChF,EAAA,IAAI,CAACG,QAAAA,EAAU;AACX,IAAA,MAAM,IAAIL,iBAAAA,CAAkB,CAAA,0BAAA,EAA6BE,UAAAA,CAAAA,CAAAA,CAAa,CAAA;AAC1E,EAAA;AAEA,EAAA,MAAMM,OAAAA,GAAU,MAAML,gBAAAA,CAAiBM,mBAAAA,CAAoB;AAAEP,IAAAA;GAAW,CAAA;AACxE,EAAA,MAAMQ,UAA+C,EAAC;AAEtD,EAAA,KAAA,MAAWC,SAASH,OAAAA,EAAS;AACzB,IAAA,IAAI,CAACG,MAAMC,cAAAA,EAAgB;AACvB,MAAA;AACJ,IAAA;AACAF,IAAAA,OAAAA,CAAQC,MAAMC,cAAc,CAAA,GAAIf,0BAAAA,CAA2Bc,KAAAA,CAAME,OAAOf,SAAS,CAAA;AACrF,EAAA;AAEA,EAAA,OAAO;IACHgB,OAAAA,EAASjB,0BAAAA,CAA2BQ,SAASP,SAAS,CAAA;AACtDY,IAAAA;AACJ,GAAA;AACJ,CAAA,EApC8B,gBAAA;AAuCvB,IAAMK,kBAAAA,2BAAsBC,QAAAA,KAAAA;AAC/B,EAAA,OAAO,CAACd,eAAeD,cAAAA,CAAe;AAAEC,IAAAA,UAAAA;IAAYC,gBAAAA,EAAkBa;GAAS,CAAA;AACnF,CAAA,EAFkC,oBAAA","file":"VVVZENMZ.js","sourcesContent":["import { isNormalizedHex } from '@layerzerolabs/common-chain-model';\nimport { NonRetryableError } from '@layerzerolabs/common-error-utils';\nimport type { NormalizedHexString } from '@layerzerolabs/typescript-utils';\n\nimport type { ResourceRegistryRealIdAccess } from './factoryInterfaces';\nimport type { ResourceSet } from './resourceSet';\n\nexport type GetResourceSet = (resourceId: string) => Promise<ResourceSet>;\n\n/**\n * Invalid stored realIdKey must be NonRetryableError; ZodError is opaque and retryable.\n * This is data-shape validation (e.g. Base58 rows), not distrust of list scoping.\n */\nconst requireNormalizedRealIdKey = (realIdKey: string): NormalizedHexString => {\n if (!isNormalizedHex(realIdKey)) {\n throw new NonRetryableError(\n `Value is not normalized hex: \"${realIdKey}\"; getResourceSet requires NormalizedHex (0x...) realIdKey, not native`,\n );\n }\n return realIdKey as unknown as NormalizedHexString;\n};\n\n/**\n * Resolve the identity RealID and discover all known subkeys for a resourceId.\n *\n * Subkeys are discovered via scoped {@link ResourceRegistryRealIdAccess.listResourceRealIds}\n * (`{ resourceId }`). List rows must be structured (`resourceId` + optional `resourceSubKey`);\n * composite storage keys stay an implementation detail of get/put/delete.\n *\n * Prefer `ResourceRegistry.getResourceSet` from workflows.\n */\nexport const getResourceSet = async ({\n resourceId,\n resourceRegistry,\n}: {\n resourceId: string;\n resourceRegistry: ResourceRegistryRealIdAccess;\n}): Promise<ResourceSet> => {\n if (resourceId === '') {\n throw new NonRetryableError(`getResourceSet expects a non-empty resourceId`);\n }\n\n if (resourceId.includes('/')) {\n throw new NonRetryableError(\n `getResourceSet expects an unqualified resourceId; got subkey-qualified ref \"${resourceId}\"`,\n );\n }\n\n const identity = await resourceRegistry.getResourceRealId({ ref: { resourceId } });\n if (!identity) {\n throw new NonRetryableError(`No realId for resourceId \"${resourceId}\"`);\n }\n\n const entries = await resourceRegistry.listResourceRealIds({ resourceId });\n const subkeys: Record<string, NormalizedHexString> = {};\n\n for (const entry of entries) {\n if (!entry.resourceSubKey) {\n continue;\n }\n subkeys[entry.resourceSubKey] = requireNormalizedRealIdKey(entry.realId.realIdKey);\n }\n\n return {\n address: requireNormalizedRealIdKey(identity.realIdKey),\n subkeys,\n };\n};\n\n/** Wire registry get/list accessors into the shared getResourceSet implementation. */\nexport const bindGetResourceSet = (registry: ResourceRegistryRealIdAccess): GetResourceSet => {\n return (resourceId) => getResourceSet({ resourceId, resourceRegistry: registry });\n};\n"]}
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { normalizedHexSchema } from '@layerzerolabs/common-chain-model';
3
+
4
+ // src/deploy/resourceSet.ts
5
+ var resourceSetSchema = z.object({
6
+ address: normalizedHexSchema,
7
+ subkeys: z.record(z.string(), normalizedHexSchema)
8
+ });
9
+
10
+ export { resourceSetSchema };
11
+ //# sourceMappingURL=WTTXALME.js.map
12
+ //# sourceMappingURL=WTTXALME.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deploy/resourceSet.ts"],"names":["resourceSetSchema","z","object","address","normalizedHexSchema","subkeys","record","string"],"mappings":";;;;AAWO,IAAMA,iBAAAA,GAAoBC,EAAEC,MAAAA,CAAO;EACtCC,OAAAA,EAASC,mBAAAA;AACTC,EAAAA,OAAAA,EAASJ,CAAAA,CAAEK,MAAAA,CAAOL,CAAAA,CAAEM,MAAAA,IAAUH,mBAAAA;AAClC,CAAA","file":"WTTXALME.js","sourcesContent":["import { z } from 'zod';\n\nimport { normalizedHexSchema } from '@layerzerolabs/common-chain-model';\n\n/**\n * Identity RealID key plus all known subkey RealID keys for one resourceId.\n *\n * `subkeys[k]` corresponds to `resourceRef.resourceSubKey === k`\n * (e.g. `factory`, `impl`, `proxy-admin`).\n * `getResourceSet` always returns a `subkeys` record (possibly `{}`).\n */\nexport const resourceSetSchema = z.object({\n address: normalizedHexSchema,\n subkeys: z.record(z.string(), normalizedHexSchema),\n});\n\nexport type ResourceSet = z.infer<typeof resourceSetSchema>;\n"]}
@@ -1,25 +1,12 @@
1
- import type { SuiObjectChange } from '@mysten/sui/client';
2
1
  import { z } from 'zod';
3
2
  import type { ChainName } from '@layerzerolabs/layerzero-definitions';
4
3
  export type { ChainName };
5
- export type { SuiObjectChange };
6
4
  export declare enum ArtifactType {
7
5
  DEPLOYMENT = "deployment",
8
6
  VERIFICATION = "verification",
9
7
  METADATA = "metadata"
10
8
  }
11
9
  export declare const artifactTypeSchema: z.ZodEnum<typeof ArtifactType>;
12
- export declare const solanaDeploymentArtifactExtraInfoSchema: z.ZodObject<{
13
- accounts: z.ZodRecord<z.ZodString, z.ZodType<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown, z.core.$ZodTypeInternals<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown>>>;
14
- }, z.core.$strip>;
15
- export type SolanaDeploymentArtifactExtraInfo = z.infer<typeof solanaDeploymentArtifactExtraInfoSchema>;
16
- export declare const suiDeploymentArtifactExtraInfoSchema: z.ZodObject<{
17
- digest: z.ZodString;
18
- packageId: z.ZodString;
19
- objectIds: z.ZodRecord<z.ZodString, z.ZodString>;
20
- objectChanges: z.ZodArray<z.ZodCustom<SuiObjectChange, SuiObjectChange>>;
21
- }, z.core.$strip>;
22
- export type SuiDeploymentArtifactExtraInfo = z.infer<typeof suiDeploymentArtifactExtraInfoSchema>;
23
10
  export declare const identityOnlyDeploymentArtifactSchema: z.ZodObject<{
24
11
  chainName: z.ZodEnum<typeof ChainName>;
25
12
  address: z.ZodType<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown, z.core.$ZodTypeInternals<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../src/deploy/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGtE,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,oBAAY,YAAY;IAIpB,UAAU,eAAe;IAEzB,YAAY,iBAAiB;IAE7B,QAAQ,aAAa;CACxB;AAED,eAAO,MAAM,kBAAkB,gCAA0D,CAAC;AAG1F,eAAO,MAAM,uCAAuC;;iBAElD,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,uCAAuC,CACjD,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;iBAK/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,oCAAoC;;;iBAG/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAGlG,eAAO,MAAM,4BAA4B;;;;;;;;;iBAUvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAGlF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;mBAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,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C;AAElD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;iBAKjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;mCAajC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, solanaDeploymentArtifactExtraInfoSchema, suiDeploymentArtifactExtraInfoSchema, verificationArtifactSchema } from '../OAY3VYYR.js';
1
+ export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, verificationArtifactSchema } from '../QSWSDTGN.js';
2
2
  import '../VUOMXK5T.js';
3
3
  //# sourceMappingURL=artifact.js.map
4
4
  //# sourceMappingURL=artifact.js.map
@@ -0,0 +1,16 @@
1
+ import { type ResourceRef } from './resourceRef';
2
+ /**
3
+ * Storage-key form of a resource ref: `resourceId` or `resourceId/resourceSubKey`.
4
+ * Used by resource/artifact registries for map/DDB keys.
5
+ */
6
+ export declare const createCompositeResourceRef: (ref: ResourceRef) => string;
7
+ /**
8
+ * Inverse of {@link createCompositeResourceRef}: parse a storage key into a structured ref.
9
+ * List APIs must return this shape — never leave the composite string in `resourceId`.
10
+ */
11
+ export declare const parseCompositeResourceRef: (compositeRef: string) => ResourceRef;
12
+ /** Build a structured list row so callers never treat the storage composite as `resourceId`. */
13
+ export declare const listEntryFromCompositeRef: <TRealId>(compositeRef: string, realId: TRealId) => ResourceRef & {
14
+ realId: TRealId;
15
+ };
16
+ //# sourceMappingURL=createCompositeResourceRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCompositeResourceRef.d.ts","sourceRoot":"","sources":["../../src/deploy/createCompositeResourceRef.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,KAAK,WAAW,KAAG,MAQ7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAAI,cAAc,MAAM,KAAG,WAchE,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,yBAAyB,GAAI,OAAO,EAC7C,cAAc,MAAM,EACpB,QAAQ,OAAO,KAChB,WAAW,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAGjC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { createCompositeResourceRef, listEntryFromCompositeRef, parseCompositeResourceRef } from '../GUE2HICK.js';
2
+ import '../P6EYHSSL.js';
3
+ import '../VUOMXK5T.js';
4
+ //# sourceMappingURL=createCompositeResourceRef.js.map
5
+ //# sourceMappingURL=createCompositeResourceRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"createCompositeResourceRef.js"}
@@ -1,14 +1,12 @@
1
1
  import z from 'zod';
2
2
  import type { ArtifactWithType } from './artifact';
3
3
  import { ArtifactType } from './artifact';
4
- export declare const resourceRefSchema: z.ZodObject<{
5
- resourceId: z.ZodString;
6
- resourceSubKey: z.ZodOptional<z.ZodString>;
7
- }, z.core.$strip>;
4
+ import { type ResourceRef } from './resourceRef';
8
5
  export declare const realIdSchema: z.ZodObject<{
9
6
  realIdKey: z.ZodString;
10
7
  chainName: z.ZodOptional<z.ZodEnum<typeof import("@layerzerolabs/layerzero-definitions").ChainName>>;
11
8
  }, z.core.$strip>;
9
+ export type RealId = z.infer<typeof realIdSchema>;
12
10
  export declare const artifactRegistryActivityFactorySchema: z.ZodObject<{
13
11
  hasArtifact: z.ZodType<(args_0: {
14
12
  ref: {
@@ -35,7 +33,7 @@ export declare const artifactRegistryActivityFactorySchema: z.ZodObject<{
35
33
  };
36
34
  getArtifact: z.ZodType<(<Type extends ArtifactType>(args: {
37
35
  artifactType: Type;
38
- ref: z.infer<typeof resourceRefSchema>;
36
+ ref: ResourceRef;
39
37
  }) => Promise<Extract<ArtifactWithType, {
40
38
  artifactType: Type;
41
39
  }> | undefined>)>;
@@ -236,22 +234,31 @@ export declare const resourceRegistryActivityFactorySchema: z.ZodObject<{
236
234
  output: z.ZodPromise<z.ZodVoid>;
237
235
  __FUNCTION_SCHEMA_TAG: true;
238
236
  };
239
- listResourceRealIds: z.ZodType<() => Promise<{
237
+ listResourceRealIds: z.ZodType<(args_0?: {
238
+ resourceId?: string | undefined;
239
+ } | undefined) => Promise<{
240
240
  resourceId: string;
241
241
  realId: {
242
242
  realIdKey: string;
243
243
  chainName?: import("@layerzerolabs/layerzero-definitions").ChainName | undefined;
244
244
  };
245
- }[]>, unknown, z.core.$ZodTypeInternals<() => Promise<{
245
+ resourceSubKey?: string | undefined;
246
+ }[]>, unknown, z.core.$ZodTypeInternals<(args_0?: {
247
+ resourceId?: string | undefined;
248
+ } | undefined) => Promise<{
246
249
  resourceId: string;
247
250
  realId: {
248
251
  realIdKey: string;
249
252
  chainName?: import("@layerzerolabs/layerzero-definitions").ChainName | undefined;
250
253
  };
254
+ resourceSubKey?: string | undefined;
251
255
  }[]>, unknown>> & {
252
- input: z.ZodTuple<[], null>;
256
+ input: z.ZodTuple<[z.ZodOptional<z.ZodObject<{
257
+ resourceId: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strip>>], null>;
253
259
  output: z.ZodPromise<z.ZodArray<z.ZodObject<{
254
260
  resourceId: z.ZodString;
261
+ resourceSubKey: z.ZodOptional<z.ZodString>;
255
262
  realId: z.ZodObject<{
256
263
  realIdKey: z.ZodString;
257
264
  chainName: z.ZodOptional<z.ZodEnum<typeof import("@layerzerolabs/layerzero-definitions").ChainName>>;
@@ -259,7 +266,23 @@ export declare const resourceRegistryActivityFactorySchema: z.ZodObject<{
259
266
  }, z.core.$strip>>>;
260
267
  __FUNCTION_SCHEMA_TAG: true;
261
268
  };
269
+ getResourceSet: z.ZodType<(args_0: string) => Promise<{
270
+ address: import("@layerzerolabs/typescript-utils").NormalizedHexString;
271
+ subkeys: Record<string, import("@layerzerolabs/typescript-utils").NormalizedHexString>;
272
+ }>, unknown, z.core.$ZodTypeInternals<(args_0: string) => Promise<{
273
+ address: import("@layerzerolabs/typescript-utils").NormalizedHexString;
274
+ subkeys: Record<string, import("@layerzerolabs/typescript-utils").NormalizedHexString>;
275
+ }>, unknown>> & {
276
+ input: z.ZodTuple<[z.ZodString], null>;
277
+ output: z.ZodPromise<z.ZodObject<{
278
+ address: z.ZodType<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown, z.core.$ZodTypeInternals<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown>>;
279
+ subkeys: z.ZodRecord<z.ZodString, z.ZodType<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown, z.core.$ZodTypeInternals<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown>>>;
280
+ }, z.core.$strip>>;
281
+ __FUNCTION_SCHEMA_TAG: true;
282
+ };
262
283
  }, z.core.$strip>;
263
284
  export interface ResourceRegistry extends z.infer<typeof resourceRegistryActivityFactorySchema> {
264
285
  }
286
+ /** RealID get/list surface required by {@link bindGetResourceSet}. */
287
+ export type ResourceRegistryRealIdAccess = Pick<ResourceRegistry, 'getResourceRealId' | 'listResourceRealIds'>;
265
288
  //# sourceMappingURL=factoryInterfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factoryInterfaces.d.ts","sourceRoot":"","sources":["../../src/deploy/factoryInterfaces.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,KAAK,EAAE,g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;;;;;;;;;;iBAuChD,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC;CAAG;AAElG,sEAAsE;AACtE,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC3C,gBAAgB,EAChB,mBAAmB,GAAG,qBAAqB,CAC9C,CAAC"}
@@ -1,5 +1,7 @@
1
- export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRefSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema } from '../VJE5VDUA.js';
2
- import '../OAY3VYYR.js';
1
+ export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema } from '../3HRY2AFJ.js';
2
+ import '../WTTXALME.js';
3
+ import '../QSWSDTGN.js';
4
+ import '../P6EYHSSL.js';
3
5
  import '../VUOMXK5T.js';
4
6
  //# sourceMappingURL=factoryInterfaces.js.map
5
7
  //# sourceMappingURL=factoryInterfaces.js.map
@@ -0,0 +1,19 @@
1
+ import type { ResourceRegistryRealIdAccess } from './factoryInterfaces';
2
+ import type { ResourceSet } from './resourceSet';
3
+ export type GetResourceSet = (resourceId: string) => Promise<ResourceSet>;
4
+ /**
5
+ * Resolve the identity RealID and discover all known subkeys for a resourceId.
6
+ *
7
+ * Subkeys are discovered via scoped {@link ResourceRegistryRealIdAccess.listResourceRealIds}
8
+ * (`{ resourceId }`). List rows must be structured (`resourceId` + optional `resourceSubKey`);
9
+ * composite storage keys stay an implementation detail of get/put/delete.
10
+ *
11
+ * Prefer `ResourceRegistry.getResourceSet` from workflows.
12
+ */
13
+ export declare const getResourceSet: ({ resourceId, resourceRegistry, }: {
14
+ resourceId: string;
15
+ resourceRegistry: ResourceRegistryRealIdAccess;
16
+ }) => Promise<ResourceSet>;
17
+ /** Wire registry get/list accessors into the shared getResourceSet implementation. */
18
+ export declare const bindGetResourceSet: (registry: ResourceRegistryRealIdAccess) => GetResourceSet;
19
+ //# sourceMappingURL=getResourceSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getResourceSet.d.ts","sourceRoot":"","sources":["../../src/deploy/getResourceSet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAe1E;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAU,mCAGlC;IACC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,4BAA4B,CAAC;CAClD,KAAG,OAAO,CAAC,WAAW,CA8BtB,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,GAAI,UAAU,4BAA4B,KAAG,cAE3E,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { bindGetResourceSet, getResourceSet } from '../VVVZENMZ.js';
2
+ import '../VUOMXK5T.js';
3
+ //# sourceMappingURL=getResourceSet.js.map
4
+ //# sourceMappingURL=getResourceSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"getResourceSet.js"}
@@ -1,6 +1,11 @@
1
1
  export * from './artifact';
2
+ export * from './createCompositeResourceRef';
2
3
  export * from './factoryInterfaces';
4
+ export * from './getResourceSet';
3
5
  export * from './resourceBuilder';
6
+ export * from './resourceIdScope';
7
+ export * from './resourceRef';
4
8
  export * from './resources';
9
+ export * from './resourceSet';
5
10
  export * from './workflow';
6
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deploy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deploy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
@@ -1,11 +1,16 @@
1
- import '../CA6UC3D3.js';
2
- export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRefSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema } from '../VJE5VDUA.js';
3
- export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, solanaDeploymentArtifactExtraInfoSchema, suiDeploymentArtifactExtraInfoSchema, verificationArtifactSchema } from '../OAY3VYYR.js';
4
- export { createResourceBuilder } from '../BHJ6M5FG.js';
1
+ import '../V2SO4JCF.js';
2
+ export { isCompositeResourceIdInScope } from '../JYX6YDJT.js';
5
3
  export { baseContractResourceSchema, baseMeshResourceSchema, baseResourceSchema, contractResourceReferenceSchema, contractResourceReferenceSchemaFor, createResolvedResourceSchema, extractContractResourceReferences, extractIdFromContractResourceReference, extractIdFromMeshResourceReference, extractMeshResourceReferences, meshResourceReferenceSchema, meshResourceReferenceSchemaFor, resolvedContractResourceReferenceSchema, resolvedMeshResourceReferenceSchema, withIntrinsicAddress } from '../7QV722N2.js';
6
4
  import '../ZCFXJFGI.js';
7
5
  import '../I2SFLHPT.js';
8
- export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema } from '../GLPJHNSD.js';
6
+ export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema } from '../MQAXH3BY.js';
7
+ export { createCompositeResourceRef, listEntryFromCompositeRef, parseCompositeResourceRef } from '../GUE2HICK.js';
8
+ export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema } from '../3HRY2AFJ.js';
9
+ export { resourceSetSchema } from '../WTTXALME.js';
10
+ export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, verificationArtifactSchema } from '../QSWSDTGN.js';
11
+ export { assertResourceRef, resourceIdSchema, resourceRefSchema, resourceSubKeySchema } from '../P6EYHSSL.js';
12
+ export { bindGetResourceSet, getResourceSet } from '../VVVZENMZ.js';
13
+ export { createResourceBuilder } from '../BHJ6M5FG.js';
9
14
  import '../VUOMXK5T.js';
10
15
  //# sourceMappingURL=index.js.map
11
16
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Whether a composite storage key (`resourceId` or `resourceId/subKey`) belongs to
3
+ * the given resourceId. Uses `resourceId/` prefix — never bare startsWith
4
+ * (so `foo` does not match `foobar`).
5
+ */
6
+ export declare const isCompositeResourceIdInScope: ({ compositeRef, resourceId, }: {
7
+ compositeRef: string;
8
+ resourceId: string;
9
+ }) => boolean;
10
+ //# sourceMappingURL=resourceIdScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceIdScope.d.ts","sourceRoot":"","sources":["../../src/deploy/resourceIdScope.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GAAI,+BAG1C;IACC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB,KAAG,OAAmF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { isCompositeResourceIdInScope } from '../JYX6YDJT.js';
2
+ import '../VUOMXK5T.js';
3
+ //# sourceMappingURL=resourceIdScope.js.map
4
+ //# sourceMappingURL=resourceIdScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"resourceIdScope.js"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ /** `foo/bar` is a composite ref: resourceId `foo`, resourceSubKey `bar`. */
3
+ export declare const resourceIdSchema: z.ZodString;
4
+ export declare const resourceSubKeySchema: z.ZodString;
5
+ /** Reference to a resource's identity RealID or one selected by resourceSubKey. */
6
+ export declare const resourceRefSchema: z.ZodObject<{
7
+ resourceId: z.ZodString;
8
+ resourceSubKey: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type ResourceRef = z.infer<typeof resourceRefSchema>;
11
+ /** Schema parse as NonRetryableError; ZodError is opaque and retryable. */
12
+ export declare const assertResourceRef: (ref: {
13
+ resourceId: string;
14
+ resourceSubKey?: string;
15
+ }) => ResourceRef;
16
+ //# sourceMappingURL=resourceRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceRef.d.ts","sourceRoot":"","sources":["../../src/deploy/resourceRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,aAAwB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,aAA4B,CAAC;AAE9D,mFAAmF;AACnF,eAAO,MAAM,iBAAiB;;;iBAI5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,GAAI,KAAK;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,KAAG,WAMH,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { assertResourceRef, resourceIdSchema, resourceRefSchema, resourceSubKeySchema } from '../P6EYHSSL.js';
2
+ import '../VUOMXK5T.js';
3
+ //# sourceMappingURL=resourceRef.js.map
4
+ //# sourceMappingURL=resourceRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"resourceRef.js"}
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Identity RealID key plus all known subkey RealID keys for one resourceId.
4
+ *
5
+ * `subkeys[k]` corresponds to `resourceRef.resourceSubKey === k`
6
+ * (e.g. `factory`, `impl`, `proxy-admin`).
7
+ * `getResourceSet` always returns a `subkeys` record (possibly `{}`).
8
+ */
9
+ export declare const resourceSetSchema: z.ZodObject<{
10
+ address: z.ZodType<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown, z.core.$ZodTypeInternals<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown>>;
11
+ subkeys: z.ZodRecord<z.ZodString, z.ZodType<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown, z.core.$ZodTypeInternals<import("@layerzerolabs/typescript-utils").NormalizedHexString, unknown>>>;
12
+ }, z.core.$strip>;
13
+ export type ResourceSet = z.infer<typeof resourceSetSchema>;
14
+ //# sourceMappingURL=resourceSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceSet.d.ts","sourceRoot":"","sources":["../../src/deploy/resourceSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { resourceSetSchema } from '../WTTXALME.js';
2
+ import '../VUOMXK5T.js';
3
+ //# sourceMappingURL=resourceSet.js.map
4
+ //# sourceMappingURL=resourceSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"resourceSet.js"}
@@ -1,7 +1,5 @@
1
- import type { SuiObjectChange } from '@mysten/sui/client';
2
1
  import { z } from 'zod';
3
2
  import type { SuccessfulGatedTransaction } from '@layerzerolabs/gated-transaction';
4
- export type { SuiObjectChange };
5
3
  export declare const extractVerificationArtifactBaseArgsSchema: z.ZodObject<{
6
4
  gtx: z.ZodType<SuccessfulGatedTransaction, SuccessfulGatedTransaction, z.core.$ZodTypeInternals<SuccessfulGatedTransaction, SuccessfulGatedTransaction>>;
7
5
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/deploy/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAKnF,YAAY,EAAE,eAAe,EAAE,CAAC;AAMhC,eAAO,MAAM,yCAAyC;;iBAEpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,yCAAyC,CACnD,CAAC;AAMF,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAC;AAMH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
1
+ {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/deploy/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAQnF,eAAO,MAAM,yCAAyC;;iBAEpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,yCAAyC,CACnD,CAAC;AAMF,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAC;AAMH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema } from '../GLPJHNSD.js';
1
+ export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema } from '../MQAXH3BY.js';
2
2
  import '../VUOMXK5T.js';
3
3
  //# sourceMappingURL=workflow.js.map
4
4
  //# sourceMappingURL=workflow.js.map
package/dist/index.js CHANGED
@@ -1,20 +1,25 @@
1
- import './SBZPLPCB.js';
2
- export { generateThrowCreateSetRoleTransactions, generateThrowHasRole, generateThrowRoleManagement } from './45LWGDPP.js';
3
- export { createAcceptAdminTransferTransactionsSchema, createAcceptAdminTransferTransactionsWithSpecializedInputSchema, createBeginAdminTransferTransactionsSchema, createBeginAdminTransferTransactionsWithSpecializedInputSchema, createSetRoleTransactionsWithSpecializedInputSchema, generateAdmin2StepSchemas, generateCreateSetRoleTransactionsSchema, generateEnumerableRoleManagementSchemas, generateGetRoleMembersSchema, generateHasRoleSchema, generateRoleManagementSchemas, getPendingAdminSchema, getPendingAdminWithSpecializedInputSchema, getRoleMembersWithSpecializedInputSchema, hasRoleWithSpecializedInputSchema } from './JBKF52KU.js';
4
- export { BaseContractRole } from './JSK5QSWJ.js';
5
1
  import './FHFFHJG6.js';
6
2
  export { createWiringPlannerActivityFactorySchema } from './VFXMU3QC.js';
7
3
  export { plannerBatchSizeArgSchema, plannerBatchSizeSchema, wireWorkflowChainResultSchema, wireWorkflowChainStateSchema, wireWorkflowFilterArgsSchema, wireWorkflowOrchestratorResultSchema, wireWorkflowOrchestratorStateSchema } from './SYVNYFS3.js';
8
4
  export { PLANNER_CONCURRENCY } from './DIVNFLSP.js';
5
+ import './SBZPLPCB.js';
6
+ export { BaseContractRole } from './JSK5QSWJ.js';
7
+ export { generateThrowCreateSetRoleTransactions, generateThrowHasRole, generateThrowRoleManagement } from './45LWGDPP.js';
8
+ export { createAcceptAdminTransferTransactionsSchema, createAcceptAdminTransferTransactionsWithSpecializedInputSchema, createBeginAdminTransferTransactionsSchema, createBeginAdminTransferTransactionsWithSpecializedInputSchema, createSetRoleTransactionsWithSpecializedInputSchema, generateAdmin2StepSchemas, generateCreateSetRoleTransactionsSchema, generateEnumerableRoleManagementSchemas, generateGetRoleMembersSchema, generateHasRoleSchema, generateRoleManagementSchemas, getPendingAdminSchema, getPendingAdminWithSpecializedInputSchema, getRoleMembersWithSpecializedInputSchema, hasRoleWithSpecializedInputSchema } from './JBKF52KU.js';
9
9
  export { buildChainsFilter, buildOperationsFilter, filterChainsArgSchema, filterOperationsArgSchema, involvedChainFilter } from './LZEC4T5F.js';
10
- import './CA6UC3D3.js';
11
- export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRefSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema } from './VJE5VDUA.js';
12
- export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, solanaDeploymentArtifactExtraInfoSchema, suiDeploymentArtifactExtraInfoSchema, verificationArtifactSchema } from './OAY3VYYR.js';
13
- export { createResourceBuilder } from './BHJ6M5FG.js';
10
+ import './V2SO4JCF.js';
11
+ export { isCompositeResourceIdInScope } from './JYX6YDJT.js';
14
12
  export { baseContractResourceSchema, baseMeshResourceSchema, baseResourceSchema, contractResourceReferenceSchema, contractResourceReferenceSchemaFor, createResolvedResourceSchema, extractContractResourceReferences, extractIdFromContractResourceReference, extractIdFromMeshResourceReference, extractMeshResourceReferences, meshResourceReferenceSchema, meshResourceReferenceSchemaFor, resolvedContractResourceReferenceSchema, resolvedMeshResourceReferenceSchema, withIntrinsicAddress } from './7QV722N2.js';
15
13
  import './ZCFXJFGI.js';
16
14
  export { EvmProxyType, ProxyType, SEPARATE_PROXY_ADMIN_TYPES, TUP_PROXY_TYPES, UUPS_PROXY_TYPES, UpgradeType, assertUpgradability, codeUpgradeableConfigSchema, initializeDataResultSchema, isTupProxy, isUupsProxy, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, requiresSeparateProxyAdminDeploy, upgradeTypeSchema, upgradeableConfigSchema, weakAssertUpgradability } from './I2SFLHPT.js';
17
- export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema } from './GLPJHNSD.js';
15
+ export { deployWorkflowChainStateSchema, deployWorkflowOrchestratorStateSchema, extractVerificationArtifactBaseArgsSchema } from './MQAXH3BY.js';
16
+ export { createCompositeResourceRef, listEntryFromCompositeRef, parseCompositeResourceRef } from './GUE2HICK.js';
17
+ export { artifactRegistryActivityFactorySchema, createMockArtifactRegistry, realIdSchema, resourceRegistryActivityFactorySchema, upsertResourceRealIdArgsSchema } from './3HRY2AFJ.js';
18
+ export { resourceSetSchema } from './WTTXALME.js';
19
+ export { ArtifactType, artifactTypeSchema, artifactWithTypeSchema, deploymentArtifactSchema, fullDeploymentArtifactSchema, identityOnlyDeploymentArtifactSchema, metadataArtifactSchema, verificationArtifactSchema } from './QSWSDTGN.js';
20
+ export { assertResourceRef, resourceIdSchema, resourceRefSchema, resourceSubKeySchema } from './P6EYHSSL.js';
21
+ export { bindGetResourceSet, getResourceSet } from './VVVZENMZ.js';
22
+ export { createResourceBuilder } from './BHJ6M5FG.js';
18
23
  import './VUOMXK5T.js';
19
24
  //# sourceMappingURL=index.js.map
20
25
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import '../SBZPLPCB.js';
2
+ export { BaseContractRole } from '../JSK5QSWJ.js';
2
3
  export { generateThrowCreateSetRoleTransactions, generateThrowHasRole, generateThrowRoleManagement } from '../45LWGDPP.js';
3
4
  export { createAcceptAdminTransferTransactionsSchema, createAcceptAdminTransferTransactionsWithSpecializedInputSchema, createBeginAdminTransferTransactionsSchema, createBeginAdminTransferTransactionsWithSpecializedInputSchema, createSetRoleTransactionsWithSpecializedInputSchema, generateAdmin2StepSchemas, generateCreateSetRoleTransactionsSchema, generateEnumerableRoleManagementSchemas, generateGetRoleMembersSchema, generateHasRoleSchema, generateRoleManagementSchemas, getPendingAdminSchema, getPendingAdminWithSpecializedInputSchema, getRoleMembersWithSpecializedInputSchema, hasRoleWithSpecializedInputSchema } from '../JBKF52KU.js';
4
- export { BaseContractRole } from '../JSK5QSWJ.js';
5
5
  import '../VUOMXK5T.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/dw-model",
3
- "version": "1.2.50",
3
+ "version": "1.2.52",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,19 +17,19 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "zod": "4.3.5",
20
- "@layerzerolabs/common-error-utils": "1.2.50",
21
- "@layerzerolabs/common-chain-model": "1.2.50",
22
- "@layerzerolabs/layerzero-definitions": "1.2.50",
23
- "@layerzerolabs/gated-transaction": "1.2.50",
24
- "@layerzerolabs/typescript-utils": "1.2.50",
25
- "@layerzerolabs/zod-utils": "1.2.50"
20
+ "@layerzerolabs/layerzero-definitions": "1.2.52",
21
+ "@layerzerolabs/typescript-utils": "1.2.52",
22
+ "@layerzerolabs/common-error-utils": "1.2.52",
23
+ "@layerzerolabs/common-chain-model": "1.2.52",
24
+ "@layerzerolabs/gated-transaction": "1.2.52",
25
+ "@layerzerolabs/zod-utils": "1.2.52"
26
26
  },
27
27
  "devDependencies": {
28
- "@mysten/sui": "^1.45.1",
29
28
  "tsup": "^8.4.0",
30
29
  "vitest": "^4.1.10",
31
- "@layerzerolabs/typescript-configuration": "1.2.50",
32
- "@layerzerolabs/tsup-configuration": "1.2.50"
30
+ "@layerzerolabs/chain-utils": "1.2.52",
31
+ "@layerzerolabs/tsup-configuration": "1.2.52",
32
+ "@layerzerolabs/typescript-configuration": "1.2.52"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public",
package/dist/CA6UC3D3.js DELETED
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=CA6UC3D3.js.map
3
- //# sourceMappingURL=CA6UC3D3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"CA6UC3D3.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/deploy/workflow.ts"],"names":["extractVerificationArtifactBaseArgsSchema","z","object","gtx","customSchema","deployWorkflowChainStateSchema","srcChain","chainNameSchema","optional","status","union","literal","default","deployWorkflowOrchestratorStateSchema"],"mappings":";;;;;AAcO,IAAMA,yCAAAA,GAA4CC,EAAEC,MAAAA,CAAO;AAC9DC,EAAAA,GAAAA,EAAKC,YAAAA;AACT,CAAA;AASO,IAAMC,8BAAAA,GAAiCJ,EAAEC,MAAAA,CAAO;AACnDI,EAAAA,QAAAA,EAAUC,gBAAgBC,QAAAA,EAAQ;AAClCC,EAAAA,MAAAA,EAAQR,EAAES,KAAAA,CAAM;AAACT,IAAAA,CAAAA,CAAEU,QAAQ,SAAA,CAAA;AAAYV,IAAAA,CAAAA,CAAEU,QAAQ,UAAA;AAAY,GAAA,CAAA,CAAEC,QAAQ,SAAA;AAC3E,CAAA;AAEO,IAAMC,qCAAAA,GAAwCZ,EAAEC,MAAAA,CAAO;AAC1DO,EAAAA,MAAAA,EAAQR,EAAES,KAAAA,CAAM;AAACT,IAAAA,CAAAA,CAAEU,QAAQ,SAAA,CAAA;AAAYV,IAAAA,CAAAA,CAAEU,QAAQ,UAAA;AAAY,GAAA,CAAA,CAAEC,QAAQ,SAAA;AAC3E,CAAA","file":"GLPJHNSD.js","sourcesContent":["import type { SuiObjectChange } from '@mysten/sui/client';\nimport { z } from 'zod';\n\nimport type { SuccessfulGatedTransaction } from '@layerzerolabs/gated-transaction';\nimport { chainNameSchema } from '@layerzerolabs/layerzero-definitions';\nimport { customSchema } from '@layerzerolabs/zod-utils';\n\n// Re-export for transitive type dependencies\nexport type { SuiObjectChange };\n\n// ---------------------------------------------------------------------------\n// Deprecated types (to be removed)\n// ---------------------------------------------------------------------------\n\nexport const extractVerificationArtifactBaseArgsSchema = z.object({\n gtx: customSchema<SuccessfulGatedTransaction>(),\n});\nexport type ExtractVerificationArtifactBaseArgs = z.infer<\n typeof extractVerificationArtifactBaseArgsSchema\n>;\n\n// ---------------------------------------------------------------------------\n// Deploy workflow state schemas\n// ---------------------------------------------------------------------------\n\nexport const deployWorkflowChainStateSchema = z.object({\n srcChain: chainNameSchema.optional(),\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\nexport const deployWorkflowOrchestratorStateSchema = z.object({\n status: z.union([z.literal('RUNNING'), z.literal('COMPLETE')]).default('RUNNING'),\n});\n\n// ---------------------------------------------------------------------------\n// Deploy workflow types\n// ---------------------------------------------------------------------------\n\nexport type DeployWorkflowChainState = z.infer<typeof deployWorkflowChainStateSchema>;\nexport type DeployWorkflowOrchestratorState = z.infer<typeof deployWorkflowOrchestratorStateSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/deploy/artifact.ts"],"names":["ArtifactType","artifactTypeSchema","brandSchema","z","enum","solanaDeploymentArtifactExtraInfoSchema","object","accounts","record","string","normalizedHexSchema","suiDeploymentArtifactExtraInfoSchema","digest","packageId","objectIds","objectChanges","array","custom","identityOnlyDeploymentArtifactSchema","chainName","chainNameSchema","address","fullDeploymentArtifactSchema","shape","nativeAddress","bytecodeHash","optional","deploymentTimestamp","number","deployerAddress","txHash","extraDeploymentInfo","any","deploymentArtifactSchema","union","verificationArtifactSchema","metadataArtifactSchema","jobId","pushedAt","metadataResources","artifactWithTypeSchema","discriminatedUnion","artifactType","literal","artifact"],"mappings":";;;;;;AAWO,IAAKA,YAAAA,6BAAAA,aAAAA,EAAAA;;;;AAAAA,EAAAA,OAAAA,aAAAA;;AAWL,IAAMC,qBAAqBC,WAAAA,CAAYC,CAAAA,CAAEC,IAAAA,CAAKJ,YAAAA,GAAe,oBAAA;AAG7D,IAAMK,uCAAAA,GAA0CF,EAAEG,MAAAA,CAAO;AAC5DC,EAAAA,QAAAA,EAAUJ,CAAAA,CAAEK,MAAAA,CAAOL,CAAAA,CAAEM,MAAAA,IAAUC,mBAAAA;AACnC,CAAA;AAMO,IAAMC,oCAAAA,GAAuCR,EAAEG,MAAAA,CAAO;AACzDM,EAAAA,MAAAA,EAAQT,EAAEM,MAAAA,EAAM;AAChBI,EAAAA,SAAAA,EAAWV,EAAEM,MAAAA,EAAM;AACnBK,EAAAA,SAAAA,EAAWX,EAAEK,MAAAA,CAAOL,CAAAA,CAAEM,QAAM,EAAIN,CAAAA,CAAEM,QAAM,CAAA;AACxCM,EAAAA,aAAAA,EAAeZ,CAAAA,CAAEa,KAAAA,CAAMb,CAAAA,CAAEc,MAAAA,EAAM;AACnC,CAAA;AAIO,IAAMC,oCAAAA,GAAuCf,EAAEG,MAAAA,CAAO;EACzDa,SAAAA,EAAWC,eAAAA;EACXC,OAAAA,EAASX;AACb,CAAA;AAIO,IAAMY,4BAAAA,GAA+BnB,EAAEG,MAAAA,CAAO;AACjD,EAAA,GAAGY,oCAAAA,CAAqCK,KAAAA;EACxCJ,SAAAA,EAAWC,eAAAA;EACXC,OAAAA,EAASX,mBAAAA;AACTc,EAAAA,aAAAA,EAAerB,EAAEM,MAAAA,EAAM;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Content":["import type { SuiObjectChange } from '@mysten/sui/client';\nimport { z } from 'zod';\n\nimport { normalizedHexSchema } from '@layerzerolabs/common-chain-model';\nimport type { ChainName } from '@layerzerolabs/layerzero-definitions';\nimport { chainNameSchema } from '@layerzerolabs/layerzero-definitions';\nimport { brandSchema } from '@layerzerolabs/zod-utils';\nexport type { ChainName };\n\nexport type { SuiObjectChange };\n\nexport enum ArtifactType {\n // Should merge deployment, verification artifacts\n\n // Full record from deployment on-chain\n DEPLOYMENT = 'deployment',\n // Information to verify contracts\n VERIFICATION = 'verification',\n // Record of a successful push to lz metadata\n METADATA = 'metadata',\n}\n\nexport const artifactTypeSchema = brandSchema(z.enum(ArtifactType), 'ArtifactTypeSchema');\n\n// Chain-specific extra deployment info schemas\nexport const solanaDeploymentArtifactExtraInfoSchema = z.object({\n accounts: z.record(z.string(), normalizedHexSchema),\n});\n\nexport type SolanaDeploymentArtifactExtraInfo = z.infer<\n typeof solanaDeploymentArtifactExtraInfoSchema\n>;\n\nexport const suiDeploymentArtifactExtraInfoSchema = z.object({\n digest: z.string(),\n packageId: z.string(),\n objectIds: z.record(z.string(), z.string()),\n objectChanges: z.array(z.custom<SuiObjectChange>()),\n});\n\nexport type SuiDeploymentArtifactExtraInfo = z.infer<typeof suiDeploymentArtifactExtraInfoSchema>;\n\nexport const identityOnlyDeploymentArtifactSchema = z.object({\n chainName: chainNameSchema,\n address: normalizedHexSchema,\n});\nexport type IdentityOnlyDeploymentArtifact = z.infer<typeof identityOnlyDeploymentArtifactSchema>;\n\n// TODO: include verification artifact in this schema\nexport const fullDeploymentArtifactSchema = z.object({\n ...identityOnlyDeploymentArtifactSchema.shape,\n chainName: chainNameSchema,\n address: normalizedHexSchema,\n nativeAddress: z.string(),\n bytecodeHash: z.string().optional(),\n deploymentTimestamp: z.number(),\n deployerAddress: normalizedHexSchema,\n txHash: z.string(),\n extraDeploymentInfo: z.any().optional(),\n});\nexport type FullDeploymentArtifact = z.infer<typeof fullDeploymentArtifactSchema>;\n\n// TODO: decide whether to migrate stored identity-only artifacts to full artifacts and collapse this union into fullDeploymentArtifactSchema\nexport const deploymentArtifactSchema = z.union([\n // Check this first since it's a superset\n fullDeploymentArtifactSchema,\n identityOnlyDeploymentArtifactSchema,\n]);\n\nexport type DeploymentArtifact = z.infer<typeof deploymentArtifactSchema>;\n\nexport const verificationArtifactSchema = z.any();\n\nexport type VerificationArtifact = z.infer<typeof verificationArtifactSchema>;\n\nexport const metadataArtifactSchema = z.object({\n jobId: z.string(),\n pushedAt: z.number(),\n // We can type this fully but probably needs to happen later\n metadataResources: z.array(z.any()),\n});\n\nexport type MetadataArtifact = z.infer<typeof metadataArtifactSchema>;\n\nexport const artifactWithTypeSchema = z.discriminatedUnion('artifactType', [\n z.object({\n artifactType: z.literal(ArtifactType.DEPLOYMENT),\n artifact: deploymentArtifactSchema,\n }),\n z.object({\n artifactType: z.literal(ArtifactType.VERIFICATION),\n artifact: z.any(),\n }),\n z.object({\n artifactType: z.literal(ArtifactType.METADATA),\n artifact: metadataArtifactSchema,\n }),\n]);\n\nexport type ArtifactWithType = z.infer<typeof artifactWithTypeSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/deploy/factoryInterfaces.ts"],"names":["resourceRefSchema","z","object","resourceId","string","resourceSubKey","optional","realIdSchema","realIdKey","chainName","chainNameSchema","artifactRegistryActivityFactorySchema","hasArtifact","functionSchema","input","tuple","ref","artifactType","enum","ArtifactType","output","promise","boolean","getArtifact","artifactWithTypeSchema","saveArtifact","artifact","void","createMockArtifactRegistry","getArtifactKey","args","JSON","stringify","artifactStore","Map","mockArtifactRegistry","getAllArtifacts","values","has","get","set","upsertResourceRealIdArgsSchema","realId","resourceRegistryActivityFactorySchema","getResourceRealId","upsertResourceRealId","deleteResourceRealId","listResourceRealIds","array"],"mappings":";;;;;;AAQO,IAAMA,iBAAAA,GAAoBC,EAAEC,MAAAA,CAAO;AACtCC,EAAAA,UAAAA,EAAYF,EAAEG,MAAAA,EAAM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"VJE5VDUA.js","sourcesContent":["import z from 'zod';\n\nimport { chainNameSchema } from '@layerzerolabs/layerzero-definitions';\nimport { functionSchema } from '@layerzerolabs/zod-utils';\n\nimport type { ArtifactWithType } from './artifact';\nimport { ArtifactType, artifactWithTypeSchema } from './artifact';\n\nexport const resourceRefSchema = z.object({\n resourceId: z.string(),\n // Some resources can have multiple realIDs, leave this undefined for the default\n resourceSubKey: z.string().optional(),\n});\n\n// The real realID that might exist\nexport const realIdSchema = z.object({\n realIdKey: z.string(),\n // some realIDs are scoped to a chain, some aren't\n chainName: chainNameSchema.optional(),\n});\n\nexport const artifactRegistryActivityFactorySchema = z.object({\n hasArtifact: functionSchema({\n input: z.tuple([\n z.object({\n ref: resourceRefSchema,\n artifactType: z.enum(ArtifactType),\n }),\n ]),\n output: z.promise(z.boolean()),\n // Typing to make it generic on artifact type\n }),\n\n getArtifact: functionSchema({\n input: z.tuple([\n z.object({\n ref: resourceRefSchema,\n artifactType: z.enum(ArtifactType),\n }),\n ]),\n output: z.promise(artifactWithTypeSchema.optional()),\n // Typing to make it generic on artifact type\n }) as z.ZodType<\n <Type extends ArtifactType>(args: {\n artifactType: Type;\n ref: z.infer<typeof resourceRefSchema>;\n }) => Promise<Extract<ArtifactWithType, { artifactType: Type }> | undefined>\n >,\n\n saveArtifact: functionSchema({\n input: z.tuple([\n z.object({\n ref: resourceRefSchema,\n artifact: artifactWithTypeSchema,\n }),\n ]),\n output: z.promise(z.void()),\n }),\n});\n\nexport interface ArtifactRegistry extends z.infer<typeof artifactRegistryActivityFactorySchema> {}\n\nexport interface MockArtifactRegistry extends ArtifactRegistry {\n getAllArtifacts: () => ArtifactWithType[];\n}\nexport const createMockArtifactRegistry = (): MockArtifactRegistry => {\n const getArtifactKey = (args: Parameters<ArtifactRegistry['getArtifact']>[0]) =>\n JSON.stringify([args.artifactType, args.ref.resourceId, args.ref.resourceSubKey ?? null]);\n\n const artifactStore = new Map<string, ArtifactWithType>();\n\n const mockArtifactRegistry: MockArtifactRegistry = {\n getAllArtifacts: () => [...artifactStore.values()],\n\n hasArtifact: async (args) => artifactStore.has(getArtifactKey(args)),\n getArtifact: async (args) => artifactStore.get(getArtifactKey(args)) as any,\n saveArtifact: async ({ ref, artifact }) => {\n artifactStore.set(\n getArtifactKey({ artifactType: artifact.artifactType, ref }),\n artifact,\n );\n },\n };\n\n return mockArtifactRegistry;\n};\n\nexport const upsertResourceRealIdArgsSchema = z.object({\n ref: resourceRefSchema,\n realId: realIdSchema,\n});\n\nexport const resourceRegistryActivityFactorySchema = z.object({\n getResourceRealId: functionSchema({\n input: z.tuple([z.object({ ref: resourceRefSchema })]),\n output: z.promise(realIdSchema.optional()),\n }),\n upsertResourceRealId: functionSchema({\n input: z.tuple([upsertResourceRealIdArgsSchema]),\n output: z.promise(z.void()),\n }),\n deleteResourceRealId: functionSchema({\n input: z.tuple([z.object({ ref: resourceRefSchema })]),\n output: z.promise(z.void()),\n }),\n\n // TODO: add pagination for large resource sets\n listResourceRealIds: functionSchema({\n input: z.tuple([]),\n output: z.promise(\n z.array(\n z.object({\n resourceId: z.string(),\n realId: realIdSchema,\n }),\n ),\n ),\n }),\n});\n\nexport interface ResourceRegistry extends z.infer<typeof resourceRegistryActivityFactorySchema> {}\n"]}