@picked/admin-api-client 0.0.1-dev.1794447047683 → 0.0.1-dev.1794522871942

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.
@@ -0,0 +1,19 @@
1
+ /** @file Schema-bound gql.tada document builder for the Picked admin GraphQL API. */
2
+ import { initGraphQLTada } from 'gql.tada';
3
+ import type { introspection } from './graphql-env.js';
4
+ /**
5
+ * Typed GraphQL document builder. Author documents with this so results and variables are inferred
6
+ * from the admin API schema; supports fragment composition via `graphql(doc, [fragments])`.
7
+ *
8
+ * @example
9
+ * const MeQuery = graphql(`query Me { user { id } }`)
10
+ */
11
+ export declare const graphql: initGraphQLTada<{
12
+ introspection: introspection;
13
+ scalars: {
14
+ DateTime: string;
15
+ IsoDate: string;
16
+ JSON: unknown;
17
+ };
18
+ }>;
19
+ //# sourceMappingURL=graphql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/graphql.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;mBACH,aAAa;aACnB;QACP,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,OAAO,CAAA;KACd;EACC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /** @file Public exports for `\@picked/admin-api-client`. */
2
+ export { AdminApiResponseError, createAdminApiClient } from './client.js';
3
+ export type { AdminApiClient, AdminApiRequestOptions, CreateAdminApiClientOptions } from './client.js';
4
+ export { AppInstallationLabelsDocument, AppInstallationTokenCreateDocument, LabelsDeleteDocument, LabelsSetDocument, } from './app-installation.js';
5
+ export { graphql } from './graphql.js';
6
+ export { AssetCommitDocument, AssetDeleteDocument, AssetUploadInitDocument, ProjectLiveVersionDocument, WorkspaceExportDocument, WorkspaceImportDocument, WorkspacePublishDocument, } from './workspace-transfer.js';
7
+ export { readFragment } from 'gql.tada';
8
+ export type { FragmentOf, ResultOf, TadaDocumentNode, VariablesOf } from 'gql.tada';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACtE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACnG,OAAO,EACL,6BAA6B,EAC7B,kCAAkC,EAClC,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Exports a workspace as a portable JSON bundle with a manifest of the asset versions its
3
+ * content references.
4
+ *
5
+ * @example
6
+ * const data = await client.request(WorkspaceExportDocument, { input: { workspaceId } })
7
+ */
8
+ export declare const WorkspaceExportDocument: import("gql.tada").TadaDocumentNode<{
9
+ workspaceExport: {
10
+ bundle: unknown;
11
+ userErrors: {
12
+ code: "ASSET_NOT_FOUND" | "INVALID_SOURCE_ROW" | "UNRESOLVED_REFERENCE" | "WORKSPACE_NOT_FOUND";
13
+ field: string[] | null;
14
+ message: string;
15
+ }[];
16
+ };
17
+ }, {
18
+ input: {
19
+ workspaceId: string;
20
+ };
21
+ }, void>;
22
+ /**
23
+ * Reads a project's live version and the id of that version's snapshot workspace.
24
+ *
25
+ * @example
26
+ * const data = await client.request(ProjectLiveVersionDocument, { input: { id: projectId } })
27
+ */
28
+ export declare const ProjectLiveVersionDocument: import("gql.tada").TadaDocumentNode<{
29
+ project: {
30
+ id: string;
31
+ liveWorkspaceVersion: {
32
+ id: string;
33
+ snapshotWorkspaceId: string | null;
34
+ } | null;
35
+ } | null;
36
+ }, {
37
+ input: {
38
+ id: string;
39
+ };
40
+ }, void>;
41
+ /**
42
+ * Imports a bundle as a new draft workspace in a project.
43
+ *
44
+ * @example
45
+ * const data = await client.request(WorkspaceImportDocument, {
46
+ * input: { projectId, bundle, assetMap },
47
+ * })
48
+ */
49
+ export declare const WorkspaceImportDocument: import("gql.tada").TadaDocumentNode<{
50
+ workspaceImport: {
51
+ userErrors: {
52
+ code: "INVALID_ASSET_MAPPING" | "INVALID_BUNDLE" | "NAME_REQUIRED" | "PROJECT_NOT_FOUND" | "UNMAPPED_ASSET" | "UNRESOLVED_REFERENCE" | "UNSUPPORTED_FORMAT_VERSION" | "WORKFLOW_SCOPES_NOT_HELD";
53
+ field: string[] | null;
54
+ message: string;
55
+ }[];
56
+ workspace: {
57
+ id: string;
58
+ name: string;
59
+ } | null;
60
+ };
61
+ }, {
62
+ input: {
63
+ assetMap?: {
64
+ assetId: string;
65
+ sourceVersionId: string;
66
+ versionId: string;
67
+ }[] | null | undefined;
68
+ bundle: unknown;
69
+ name?: string | null | undefined;
70
+ projectId: string;
71
+ };
72
+ }, void>;
73
+ /**
74
+ * Reserves an asset upload, or returns the project's existing version of the declared
75
+ * `sha256` with `deduplicated: true`.
76
+ *
77
+ * @example
78
+ * const data = await client.request(AssetUploadInitDocument, {
79
+ * input: { projectId, fileName, contentType, sha256 },
80
+ * })
81
+ */
82
+ export declare const AssetUploadInitDocument: import("gql.tada").TadaDocumentNode<{
83
+ assetUploadInit: {
84
+ assetId: string;
85
+ deduplicated: boolean;
86
+ storagePath: string;
87
+ uploadUrl: string | null;
88
+ versionId: string;
89
+ };
90
+ }, {
91
+ input: {
92
+ assetId?: string | null | undefined;
93
+ contentType: string;
94
+ fileName: string;
95
+ path?: string | null | undefined;
96
+ projectId: string;
97
+ sha256?: string | null | undefined;
98
+ workbenchId?: string | null | undefined;
99
+ };
100
+ }, void>;
101
+ /**
102
+ * Commits an uploaded asset version.
103
+ *
104
+ * @example
105
+ * const data = await client.request(AssetCommitDocument, {
106
+ * input: { projectId, assetId, versionId, fileName, storagePath, sha256 },
107
+ * })
108
+ */
109
+ export declare const AssetCommitDocument: import("gql.tada").TadaDocumentNode<{
110
+ assetCommit: {
111
+ asset: {
112
+ id: string;
113
+ } | null;
114
+ userErrors: {
115
+ code: "HASH_MISMATCH";
116
+ field: string[] | null;
117
+ message: string;
118
+ }[];
119
+ };
120
+ }, {
121
+ input: {
122
+ assetId: string;
123
+ fileName: string;
124
+ path?: string | null | undefined;
125
+ projectId: string;
126
+ sha256?: string | null | undefined;
127
+ storagePath: string;
128
+ versionId: string;
129
+ workbenchId?: string | null | undefined;
130
+ };
131
+ }, void>;
132
+ /**
133
+ * Soft-deletes an asset and removes its stored objects.
134
+ *
135
+ * @example
136
+ * const data = await client.request(AssetDeleteDocument, { input: { id: assetId } })
137
+ */
138
+ export declare const AssetDeleteDocument: import("gql.tada").TadaDocumentNode<{
139
+ assetDelete: {
140
+ assetId: string | null;
141
+ };
142
+ }, {
143
+ input: {
144
+ id: string;
145
+ };
146
+ }, void>;
147
+ /**
148
+ * Publishes a workspace, making it the project's live version.
149
+ *
150
+ * @example
151
+ * const data = await client.request(WorkspacePublishDocument, { input: { workspaceId } })
152
+ */
153
+ export declare const WorkspacePublishDocument: import("gql.tada").TadaDocumentNode<{
154
+ workspacePublish: {
155
+ userErrors: {
156
+ code: "WORKSPACE_ALREADY_LIVE" | "WORKSPACE_NOT_FOUND";
157
+ field: string[] | null;
158
+ message: string;
159
+ }[];
160
+ workspace: {
161
+ id: string;
162
+ } | null;
163
+ };
164
+ }, {
165
+ input: {
166
+ projectId?: string | null | undefined;
167
+ workspaceId: string;
168
+ };
169
+ }, void>;
170
+ //# sourceMappingURL=workspace-transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-transfer.d.ts","sourceRoot":"","sources":["../../src/workspace-transfer.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;QAWlC,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;QAUrC,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;QAclC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;QAUlC,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;QAa9B,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;QAM9B,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;QAanC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  /** @file Schema-bound gql.tada document builder for the Picked admin GraphQL API. */
2
2
  import { initGraphQLTada } from 'gql.tada';
3
- import type { introspection } from './graphql-env';
3
+ import type { introspection } from './graphql-env.js';
4
4
  /**
5
5
  * Typed GraphQL document builder. Author documents with this so results and variables are inferred
6
6
  * from the admin API schema; supports fragment composition via `graphql(doc, [fragments])`.
@@ -1,9 +1,9 @@
1
1
  /** @file Public exports for `\@picked/admin-api-client`. */
2
- export { AdminApiResponseError, createAdminApiClient } from './client';
3
- export type { AdminApiClient, AdminApiRequestOptions, CreateAdminApiClientOptions } from './client';
4
- export { AppInstallationLabelsDocument, AppInstallationTokenCreateDocument, LabelsDeleteDocument, LabelsSetDocument, } from './app-installation';
5
- export { graphql } from './graphql';
6
- export { AssetCommitDocument, AssetDeleteDocument, AssetUploadInitDocument, ProjectLiveVersionDocument, WorkspaceExportDocument, WorkspaceImportDocument, WorkspacePublishDocument, } from './workspace-transfer';
2
+ export { AdminApiResponseError, createAdminApiClient } from './client.js';
3
+ export type { AdminApiClient, AdminApiRequestOptions, CreateAdminApiClientOptions } from './client.js';
4
+ export { AppInstallationLabelsDocument, AppInstallationTokenCreateDocument, LabelsDeleteDocument, LabelsSetDocument, } from './app-installation.js';
5
+ export { graphql } from './graphql.js';
6
+ export { AssetCommitDocument, AssetDeleteDocument, AssetUploadInitDocument, ProjectLiveVersionDocument, WorkspaceExportDocument, WorkspaceImportDocument, WorkspacePublishDocument, } from './workspace-transfer.js';
7
7
  export { readFragment } from 'gql.tada';
8
8
  export type { FragmentOf, ResultOf, TadaDocumentNode, VariablesOf } from 'gql.tada';
9
9
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/admin-api-client",
3
3
  "description": "Typed gql.tada client for the Picked admin (management) GraphQL API",
4
- "version": "0.0.1-dev.1794447047683",
4
+ "version": "0.0.1-dev.1794522871942",
5
5
  "dependencies": {
6
6
  "@0no-co/graphql.web": "^1.2.0",
7
7
  "gql.tada": "^1.11.3",
@@ -21,15 +21,25 @@
21
21
  },
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types/index.d.ts",
25
- "import": "./dist/esm/index.js",
26
- "require": "./dist/cjs/index.js",
24
+ "import": {
25
+ "types": "./dist/types/index.d.ts",
26
+ "default": "./dist/esm/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./dist/cjs/index.d.ts",
30
+ "default": "./dist/cjs/index.js"
31
+ },
27
32
  "default": "./dist/esm/index.js"
28
33
  },
29
34
  "./graphql": {
30
- "types": "./dist/types/graphql.d.ts",
31
- "import": "./dist/esm/graphql.js",
32
- "require": "./dist/cjs/graphql.js",
35
+ "import": {
36
+ "types": "./dist/types/graphql.d.ts",
37
+ "default": "./dist/esm/graphql.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/cjs/graphql.d.ts",
41
+ "default": "./dist/cjs/graphql.js"
42
+ },
33
43
  "default": "./dist/esm/graphql.js"
34
44
  }
35
45
  },
@@ -65,7 +75,7 @@
65
75
  "access": "public"
66
76
  },
67
77
  "scripts": {
68
- "build": "vite build && tsgo -p tsconfig.build.json && cp src/graphql-env.d.ts dist/types/graphql-env.d.ts",
78
+ "build": "vite build && tsgo -p tsconfig.build.json && cp src/graphql-env.d.ts dist/types/graphql-env.d.ts && node ../../scripts/sdk-dist.mjs",
69
79
  "check": "pnpm type-check && pnpm lint && pnpm knip && pnpm jscpd",
70
80
  "codegen": "gql.tada generate output",
71
81
  "dev": "node ../../scripts/sdk-watch-build.mjs",
@@ -77,7 +87,7 @@
77
87
  "lint:report": "eslint . -o './.reports/eslint.json' -f json || true",
78
88
  "test": "vitest run",
79
89
  "test:coverage": "../../scripts/vitest-coverage.sh",
80
- "test:packaged-types": "attw --pack",
90
+ "test:packaged-types": "attw --pack --profile node16",
81
91
  "test:watch": "vitest",
82
92
  "type-check": "tsgo -p . --noEmit"
83
93
  },