@distilled.cloud/stripe 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
+ import * as Context from "effect/Context";
1
2
  import * as Layer from "effect/Layer";
2
3
  import * as Redacted from "effect/Redacted";
3
- import * as Context from "effect/Context";
4
4
  import { ConfigError } from "@distilled.cloud/core/errors";
5
5
  export declare const DEFAULT_API_BASE_URL = "https://api.stripe.com";
6
6
  export interface Config {
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,8CAa9B,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAMJ,eAAO,MAAM,kBAAkB,8CAc9B,CAAC"}
@@ -1,18 +1,19 @@
1
+ import * as EffectConfig from "effect/Config";
2
+ import * as Context from "effect/Context";
1
3
  import * as Effect from "effect/Effect";
2
4
  import * as Layer from "effect/Layer";
3
5
  import * as Redacted from "effect/Redacted";
4
- import * as Context from "effect/Context";
5
6
  import { ConfigError } from "@distilled.cloud/core/errors";
6
7
  export const DEFAULT_API_BASE_URL = "https://api.stripe.com";
7
8
  export class Credentials extends Context.Service()("StripeCredentials") {
8
9
  }
9
- export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function* () {
10
- const apiKey = process.env.STRIPE_API_KEY;
11
- if (!apiKey) {
12
- return yield* new ConfigError({
13
- message: "STRIPE_API_KEY environment variable is required",
14
- });
15
- }
16
- return { apiKey: Redacted.make(apiKey), apiBaseUrl: DEFAULT_API_BASE_URL };
17
- }));
10
+ const envConfig = EffectConfig.all({
11
+ apiKey: EffectConfig.string("STRIPE_API_KEY"),
12
+ });
13
+ export const CredentialsFromEnv = Layer.effect(Credentials, envConfig.asEffect().pipe(Effect.mapError(() => new ConfigError({
14
+ message: "STRIPE_API_KEY environment variable is required",
15
+ })), Effect.map(({ apiKey }) => ({
16
+ apiKey: Redacted.make(apiKey),
17
+ apiBaseUrl: DEFAULT_API_BASE_URL,
18
+ }))));
18
19
  //# sourceMappingURL=credentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,gBA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AC;CAC9C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAC5C,WAAW,EACX,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,CACvB,MAAM,CAAC,QAAQ,CACb,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;IACd,OAAO,EAAE,iDAAiD;CAC3D,CAAC,CACL,EACD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,UAAU,EAAE,oBAAoB;CACjC,CAAC,CAAC,CACJ,CACF,CAAC"}
@@ -0,0 +1,146 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const GetV2CommerceProductCatalogImportsInput: Schema.Struct<{
3
+ readonly created: Schema.optional<Schema.String>;
4
+ readonly created_gt: Schema.optional<Schema.String>;
5
+ readonly created_gte: Schema.optional<Schema.String>;
6
+ readonly created_lt: Schema.optional<Schema.String>;
7
+ readonly created_lte: Schema.optional<Schema.String>;
8
+ readonly feed_type: Schema.optional<Schema.Literals<readonly ["inventory", "pricing", "product"]>>;
9
+ readonly limit: Schema.optional<Schema.Number>;
10
+ readonly status: Schema.optional<Schema.Literals<readonly ["awaiting_upload", "failed", "processing", "succeeded", "succeeded_with_errors"]>>;
11
+ }>;
12
+ export type GetV2CommerceProductCatalogImportsInput = typeof GetV2CommerceProductCatalogImportsInput.Type;
13
+ export declare const GetV2CommerceProductCatalogImportsOutput: Schema.Struct<{
14
+ readonly data: Schema.$Array<Schema.Struct<{
15
+ readonly created: Schema.String;
16
+ readonly feed_type: Schema.Literals<readonly ["inventory", "pricing", "product"]>;
17
+ readonly id: Schema.String;
18
+ readonly livemode: Schema.Boolean;
19
+ readonly metadata: Schema.$Record<Schema.String, Schema.String>;
20
+ readonly object: Schema.Literals<readonly ["v2.commerce.product_catalog_import"]>;
21
+ readonly status: Schema.Literals<readonly ["awaiting_upload", "failed", "processing", "succeeded", "succeeded_with_errors"]>;
22
+ readonly status_details: Schema.optional<Schema.Struct<{
23
+ readonly awaiting_upload: Schema.optional<Schema.Struct<{
24
+ readonly upload_url: Schema.Struct<{
25
+ readonly expires_at: Schema.String;
26
+ readonly url: Schema.String;
27
+ }>;
28
+ }>>;
29
+ readonly failed: Schema.optional<Schema.Struct<{
30
+ readonly code: Schema.Literals<readonly ["file_not_found", "internal_error", "invalid_file"]>;
31
+ readonly failure_message: Schema.String;
32
+ readonly type: Schema.Literals<readonly ["cannot_proceed", "transient_failure"]>;
33
+ }>>;
34
+ readonly processing: Schema.optional<Schema.Struct<{
35
+ readonly error_count: Schema.String;
36
+ readonly success_count: Schema.String;
37
+ }>>;
38
+ readonly succeeded: Schema.optional<Schema.Struct<{
39
+ readonly success_count: Schema.String;
40
+ }>>;
41
+ readonly succeeded_with_errors: Schema.optional<Schema.Struct<{
42
+ readonly error_count: Schema.String;
43
+ readonly error_file: Schema.Struct<{
44
+ readonly content_type: Schema.String;
45
+ readonly download_url: Schema.Struct<{
46
+ readonly expires_at: Schema.String;
47
+ readonly url: Schema.String;
48
+ }>;
49
+ readonly size: Schema.String;
50
+ }>;
51
+ readonly samples: Schema.$Array<Schema.Struct<{
52
+ readonly error_message: Schema.String;
53
+ readonly field: Schema.String;
54
+ readonly id: Schema.String;
55
+ readonly row: Schema.String;
56
+ }>>;
57
+ readonly success_count: Schema.String;
58
+ }>>;
59
+ }>>;
60
+ }>>;
61
+ readonly next_page_url: Schema.NullOr<Schema.String>;
62
+ readonly previous_page_url: Schema.NullOr<Schema.String>;
63
+ }>;
64
+ export type GetV2CommerceProductCatalogImportsOutput = typeof GetV2CommerceProductCatalogImportsOutput.Type;
65
+ /**
66
+ * List Product Catalog Imports
67
+ *
68
+ * Returns a list of ProductCatalogImport objects.
69
+ *
70
+ * @param created - Filter for objects created at the specified timestamp.
71
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
72
+ * @param created_gt - Filter for objects created after the specified timestamp.
73
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
74
+ * @param created_gte - Filter for objects created on or after the specified timestamp.
75
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
76
+ * @param created_lt - Filter for objects created before the specified timestamp.
77
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
78
+ * @param created_lte - Filter for objects created on or before the specified timestamp.
79
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
80
+ * @param feed_type - Filter by the type of feed data being imported.
81
+ * @param limit - The maximum number of results per page.
82
+ * @param status - Filter by import status.
83
+ */
84
+ export declare const GetV2CommerceProductCatalogImports: import("@distilled.cloud/core/client").OperationMethod<{
85
+ readonly created?: string | undefined;
86
+ readonly created_gt?: string | undefined;
87
+ readonly created_gte?: string | undefined;
88
+ readonly created_lt?: string | undefined;
89
+ readonly created_lte?: string | undefined;
90
+ readonly feed_type?: "inventory" | "pricing" | "product" | undefined;
91
+ readonly limit?: number | undefined;
92
+ readonly status?: "awaiting_upload" | "failed" | "processing" | "succeeded" | "succeeded_with_errors" | undefined;
93
+ }, {
94
+ readonly data: readonly {
95
+ readonly created: string;
96
+ readonly feed_type: "inventory" | "pricing" | "product";
97
+ readonly id: string;
98
+ readonly livemode: boolean;
99
+ readonly metadata: {
100
+ readonly [x: string]: string;
101
+ };
102
+ readonly object: "v2.commerce.product_catalog_import";
103
+ readonly status: "awaiting_upload" | "failed" | "processing" | "succeeded" | "succeeded_with_errors";
104
+ readonly status_details?: {
105
+ readonly awaiting_upload?: {
106
+ readonly upload_url: {
107
+ readonly expires_at: string;
108
+ readonly url: string;
109
+ };
110
+ } | undefined;
111
+ readonly failed?: {
112
+ readonly code: "file_not_found" | "internal_error" | "invalid_file";
113
+ readonly failure_message: string;
114
+ readonly type: "cannot_proceed" | "transient_failure";
115
+ } | undefined;
116
+ readonly processing?: {
117
+ readonly error_count: string;
118
+ readonly success_count: string;
119
+ } | undefined;
120
+ readonly succeeded?: {
121
+ readonly success_count: string;
122
+ } | undefined;
123
+ readonly succeeded_with_errors?: {
124
+ readonly error_count: string;
125
+ readonly error_file: {
126
+ readonly content_type: string;
127
+ readonly download_url: {
128
+ readonly expires_at: string;
129
+ readonly url: string;
130
+ };
131
+ readonly size: string;
132
+ };
133
+ readonly samples: readonly {
134
+ readonly error_message: string;
135
+ readonly field: string;
136
+ readonly id: string;
137
+ readonly row: string;
138
+ }[];
139
+ readonly success_count: string;
140
+ } | undefined;
141
+ } | undefined;
142
+ }[];
143
+ readonly next_page_url: string | null;
144
+ readonly previous_page_url: string | null;
145
+ }, never, import("../credentials.ts").Credentials>;
146
+ //# sourceMappingURL=GetV2CommerceProductCatalogImports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetV2CommerceProductCatalogImports.d.ts","sourceRoot":"","sources":["../../src/operations/GetV2CommerceProductCatalogImports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,uCAAuC;;;;;;;;;EAsBjD,CAAC;AACJ,MAAM,MAAM,uCAAuC,GACjD,OAAO,uCAAuC,CAAC,IAAI,CAAC;AAGtD,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6EjD,CAAC;AACL,MAAM,MAAM,wCAAwC,GAClD,OAAO,wCAAwC,CAAC,IAAI,CAAC;AAGvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAI1C,CAAC"}
@@ -0,0 +1,110 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const GetV2CommerceProductCatalogImportsInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ created: Schema.optional(Schema.String),
8
+ created_gt: Schema.optional(Schema.String),
9
+ created_gte: Schema.optional(Schema.String),
10
+ created_lt: Schema.optional(Schema.String),
11
+ created_lte: Schema.optional(Schema.String),
12
+ feed_type: Schema.optional(Schema.Literals(["inventory", "pricing", "product"])),
13
+ limit: Schema.optional(Schema.Number),
14
+ status: Schema.optional(Schema.Literals([
15
+ "awaiting_upload",
16
+ "failed",
17
+ "processing",
18
+ "succeeded",
19
+ "succeeded_with_errors",
20
+ ])),
21
+ }).pipe(T.Http({ method: "GET", path: "/v2/commerce/product_catalog/imports" }));
22
+ // Output Schema
23
+ export const GetV2CommerceProductCatalogImportsOutput =
24
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
25
+ data: Schema.Array(Schema.Struct({
26
+ created: Schema.String,
27
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
28
+ id: Schema.String,
29
+ livemode: Schema.Boolean,
30
+ metadata: Schema.Record(Schema.String, Schema.String),
31
+ object: Schema.Literals(["v2.commerce.product_catalog_import"]),
32
+ status: Schema.Literals([
33
+ "awaiting_upload",
34
+ "failed",
35
+ "processing",
36
+ "succeeded",
37
+ "succeeded_with_errors",
38
+ ]),
39
+ status_details: Schema.optional(Schema.Struct({
40
+ awaiting_upload: Schema.optional(Schema.Struct({
41
+ upload_url: Schema.Struct({
42
+ expires_at: Schema.String,
43
+ url: Schema.String,
44
+ }),
45
+ })),
46
+ failed: Schema.optional(Schema.Struct({
47
+ code: Schema.Literals([
48
+ "file_not_found",
49
+ "internal_error",
50
+ "invalid_file",
51
+ ]),
52
+ failure_message: Schema.String,
53
+ type: Schema.Literals(["cannot_proceed", "transient_failure"]),
54
+ })),
55
+ processing: Schema.optional(Schema.Struct({
56
+ error_count: Schema.String,
57
+ success_count: Schema.String,
58
+ })),
59
+ succeeded: Schema.optional(Schema.Struct({
60
+ success_count: Schema.String,
61
+ })),
62
+ succeeded_with_errors: Schema.optional(Schema.Struct({
63
+ error_count: Schema.String,
64
+ error_file: Schema.Struct({
65
+ content_type: Schema.String,
66
+ download_url: Schema.Struct({
67
+ expires_at: Schema.String,
68
+ url: Schema.String,
69
+ }),
70
+ size: Schema.String,
71
+ }),
72
+ samples: Schema.Array(Schema.Struct({
73
+ error_message: Schema.String,
74
+ field: Schema.String,
75
+ id: Schema.String,
76
+ row: Schema.String,
77
+ })),
78
+ success_count: Schema.String,
79
+ })),
80
+ })),
81
+ })),
82
+ next_page_url: Schema.NullOr(Schema.String),
83
+ previous_page_url: Schema.NullOr(Schema.String),
84
+ });
85
+ // The operation
86
+ /**
87
+ * List Product Catalog Imports
88
+ *
89
+ * Returns a list of ProductCatalogImport objects.
90
+ *
91
+ * @param created - Filter for objects created at the specified timestamp.
92
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
93
+ * @param created_gt - Filter for objects created after the specified timestamp.
94
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
95
+ * @param created_gte - Filter for objects created on or after the specified timestamp.
96
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
97
+ * @param created_lt - Filter for objects created before the specified timestamp.
98
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
99
+ * @param created_lte - Filter for objects created on or before the specified timestamp.
100
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
101
+ * @param feed_type - Filter by the type of feed data being imported.
102
+ * @param limit - The maximum number of results per page.
103
+ * @param status - Filter by import status.
104
+ */
105
+ export const GetV2CommerceProductCatalogImports =
106
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
107
+ inputSchema: GetV2CommerceProductCatalogImportsInput,
108
+ outputSchema: GetV2CommerceProductCatalogImportsOutput,
109
+ }));
110
+ //# sourceMappingURL=GetV2CommerceProductCatalogImports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetV2CommerceProductCatalogImports.js","sourceRoot":"","sources":["../../src/operations/GetV2Commer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import * as Schema from "effect/Schema";
2
+ export declare const GetV2CommerceProductCatalogImportsIdInput: Schema.Struct<{
3
+ readonly id: Schema.String;
4
+ }>;
5
+ export type GetV2CommerceProductCatalogImportsIdInput = typeof GetV2CommerceProductCatalogImportsIdInput.Type;
6
+ export declare const GetV2CommerceProductCatalogImportsIdOutput: Schema.Struct<{
7
+ readonly created: Schema.String;
8
+ readonly feed_type: Schema.Literals<readonly ["inventory", "pricing", "product"]>;
9
+ readonly id: Schema.String;
10
+ readonly livemode: Schema.Boolean;
11
+ readonly metadata: Schema.$Record<Schema.String, Schema.String>;
12
+ readonly object: Schema.Literals<readonly ["v2.commerce.product_catalog_import"]>;
13
+ readonly status: Schema.Literals<readonly ["awaiting_upload", "failed", "processing", "succeeded", "succeeded_with_errors"]>;
14
+ readonly status_details: Schema.optional<Schema.Struct<{
15
+ readonly awaiting_upload: Schema.optional<Schema.Struct<{
16
+ readonly upload_url: Schema.Struct<{
17
+ readonly expires_at: Schema.String;
18
+ readonly url: Schema.String;
19
+ }>;
20
+ }>>;
21
+ readonly failed: Schema.optional<Schema.Struct<{
22
+ readonly code: Schema.Literals<readonly ["file_not_found", "internal_error", "invalid_file"]>;
23
+ readonly failure_message: Schema.String;
24
+ readonly type: Schema.Literals<readonly ["cannot_proceed", "transient_failure"]>;
25
+ }>>;
26
+ readonly processing: Schema.optional<Schema.Struct<{
27
+ readonly error_count: Schema.String;
28
+ readonly success_count: Schema.String;
29
+ }>>;
30
+ readonly succeeded: Schema.optional<Schema.Struct<{
31
+ readonly success_count: Schema.String;
32
+ }>>;
33
+ readonly succeeded_with_errors: Schema.optional<Schema.Struct<{
34
+ readonly error_count: Schema.String;
35
+ readonly error_file: Schema.Struct<{
36
+ readonly content_type: Schema.String;
37
+ readonly download_url: Schema.Struct<{
38
+ readonly expires_at: Schema.String;
39
+ readonly url: Schema.String;
40
+ }>;
41
+ readonly size: Schema.String;
42
+ }>;
43
+ readonly samples: Schema.$Array<Schema.Struct<{
44
+ readonly error_message: Schema.String;
45
+ readonly field: Schema.String;
46
+ readonly id: Schema.String;
47
+ readonly row: Schema.String;
48
+ }>>;
49
+ readonly success_count: Schema.String;
50
+ }>>;
51
+ }>>;
52
+ }>;
53
+ export type GetV2CommerceProductCatalogImportsIdOutput = typeof GetV2CommerceProductCatalogImportsIdOutput.Type;
54
+ /**
55
+ * Retrieve a Product Catalog Import
56
+ *
57
+ * Retrieves a ProductCatalogImport by ID.
58
+ *
59
+ * @param id - The ID of the ProductCatalogImport to retrieve.
60
+ */
61
+ export declare const GetV2CommerceProductCatalogImportsId: import("@distilled.cloud/core/client").OperationMethod<{
62
+ readonly id: string;
63
+ }, {
64
+ readonly created: string;
65
+ readonly feed_type: "inventory" | "pricing" | "product";
66
+ readonly id: string;
67
+ readonly livemode: boolean;
68
+ readonly metadata: {
69
+ readonly [x: string]: string;
70
+ };
71
+ readonly object: "v2.commerce.product_catalog_import";
72
+ readonly status: "awaiting_upload" | "failed" | "processing" | "succeeded" | "succeeded_with_errors";
73
+ readonly status_details?: {
74
+ readonly awaiting_upload?: {
75
+ readonly upload_url: {
76
+ readonly expires_at: string;
77
+ readonly url: string;
78
+ };
79
+ } | undefined;
80
+ readonly failed?: {
81
+ readonly code: "file_not_found" | "internal_error" | "invalid_file";
82
+ readonly failure_message: string;
83
+ readonly type: "cannot_proceed" | "transient_failure";
84
+ } | undefined;
85
+ readonly processing?: {
86
+ readonly error_count: string;
87
+ readonly success_count: string;
88
+ } | undefined;
89
+ readonly succeeded?: {
90
+ readonly success_count: string;
91
+ } | undefined;
92
+ readonly succeeded_with_errors?: {
93
+ readonly error_count: string;
94
+ readonly error_file: {
95
+ readonly content_type: string;
96
+ readonly download_url: {
97
+ readonly expires_at: string;
98
+ readonly url: string;
99
+ };
100
+ readonly size: string;
101
+ };
102
+ readonly samples: readonly {
103
+ readonly error_message: string;
104
+ readonly field: string;
105
+ readonly id: string;
106
+ readonly row: string;
107
+ }[];
108
+ readonly success_count: string;
109
+ } | undefined;
110
+ } | undefined;
111
+ }, never, import("../credentials.ts").Credentials>;
112
+ //# sourceMappingURL=GetV2CommerceProductCatalogImportsId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetV2CommerceProductCatalogImportsId.d.ts","sourceRoot":"","sources":["../../src/operations/GetV2CommerceProductCatalogImportsId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,yCAAyC;;EAQnD,CAAC;AACJ,MAAM,MAAM,yCAAyC,GACnD,OAAO,yCAAyC,CAAC,IAAI,CAAC;AAGxD,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEnD,CAAC;AACL,MAAM,MAAM,0CAA0C,GACpD,OAAO,0CAA0C,CAAC,IAAI,CAAC;AAGzD;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAI5C,CAAC"}
@@ -0,0 +1,84 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const GetV2CommerceProductCatalogImportsIdInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ id: Schema.String.pipe(T.PathParam()),
8
+ }).pipe(T.Http({
9
+ method: "GET",
10
+ path: "/v2/commerce/product_catalog/imports/{id}",
11
+ }));
12
+ // Output Schema
13
+ export const GetV2CommerceProductCatalogImportsIdOutput =
14
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15
+ created: Schema.String,
16
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
17
+ id: Schema.String,
18
+ livemode: Schema.Boolean,
19
+ metadata: Schema.Record(Schema.String, Schema.String),
20
+ object: Schema.Literals(["v2.commerce.product_catalog_import"]),
21
+ status: Schema.Literals([
22
+ "awaiting_upload",
23
+ "failed",
24
+ "processing",
25
+ "succeeded",
26
+ "succeeded_with_errors",
27
+ ]),
28
+ status_details: Schema.optional(Schema.Struct({
29
+ awaiting_upload: Schema.optional(Schema.Struct({
30
+ upload_url: Schema.Struct({
31
+ expires_at: Schema.String,
32
+ url: Schema.String,
33
+ }),
34
+ })),
35
+ failed: Schema.optional(Schema.Struct({
36
+ code: Schema.Literals([
37
+ "file_not_found",
38
+ "internal_error",
39
+ "invalid_file",
40
+ ]),
41
+ failure_message: Schema.String,
42
+ type: Schema.Literals(["cannot_proceed", "transient_failure"]),
43
+ })),
44
+ processing: Schema.optional(Schema.Struct({
45
+ error_count: Schema.String,
46
+ success_count: Schema.String,
47
+ })),
48
+ succeeded: Schema.optional(Schema.Struct({
49
+ success_count: Schema.String,
50
+ })),
51
+ succeeded_with_errors: Schema.optional(Schema.Struct({
52
+ error_count: Schema.String,
53
+ error_file: Schema.Struct({
54
+ content_type: Schema.String,
55
+ download_url: Schema.Struct({
56
+ expires_at: Schema.String,
57
+ url: Schema.String,
58
+ }),
59
+ size: Schema.String,
60
+ }),
61
+ samples: Schema.Array(Schema.Struct({
62
+ error_message: Schema.String,
63
+ field: Schema.String,
64
+ id: Schema.String,
65
+ row: Schema.String,
66
+ })),
67
+ success_count: Schema.String,
68
+ })),
69
+ })),
70
+ });
71
+ // The operation
72
+ /**
73
+ * Retrieve a Product Catalog Import
74
+ *
75
+ * Retrieves a ProductCatalogImport by ID.
76
+ *
77
+ * @param id - The ID of the ProductCatalogImport to retrieve.
78
+ */
79
+ export const GetV2CommerceProductCatalogImportsId =
80
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
81
+ inputSchema: GetV2CommerceProductCatalogImportsIdInput,
82
+ outputSchema: GetV2CommerceProductCatalogImportsIdOutput,
83
+ }));
84
+ //# sourceMappingURL=GetV2CommerceProductCatalogImportsId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetV2CommerceProductCatalogImportsId.js","sourceRoot":"","sources":["../../src/operations/GetV2Commer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BACjB,GAAG,EAAE,MAAM,CAAC,MAAM;aACnB,CAAC,CACH;YACD,aAAa,EAAE,MAAM,CAAC,MAAM;SAC7B,CAAC,CACH;KACF,CAAC,CACH;CACF,CAAC,CAAC;AAIL,gBAAgB;AAChB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC;AAC/C,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,yCAAyC;IACtD,YAAY,EAAE,0CAA0C;CACzD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,116 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const PostV2CommerceProductCatalogImportsInput: Schema.Struct<{
3
+ readonly feed_type: Schema.Literals<readonly ["inventory", "pricing", "product"]>;
4
+ readonly metadata: Schema.$Record<Schema.String, Schema.String>;
5
+ readonly mode: Schema.Literals<readonly ["replace", "upsert"]>;
6
+ }>;
7
+ export type PostV2CommerceProductCatalogImportsInput = typeof PostV2CommerceProductCatalogImportsInput.Type;
8
+ export declare const PostV2CommerceProductCatalogImportsOutput: Schema.Struct<{
9
+ readonly created: Schema.String;
10
+ readonly feed_type: Schema.Literals<readonly ["inventory", "pricing", "product"]>;
11
+ readonly id: Schema.String;
12
+ readonly livemode: Schema.Boolean;
13
+ readonly metadata: Schema.$Record<Schema.String, Schema.String>;
14
+ readonly object: Schema.Literals<readonly ["v2.commerce.product_catalog_import"]>;
15
+ readonly status: Schema.Literals<readonly ["awaiting_upload", "failed", "processing", "succeeded", "succeeded_with_errors"]>;
16
+ readonly status_details: Schema.optional<Schema.Struct<{
17
+ readonly awaiting_upload: Schema.optional<Schema.Struct<{
18
+ readonly upload_url: Schema.Struct<{
19
+ readonly expires_at: Schema.String;
20
+ readonly url: Schema.String;
21
+ }>;
22
+ }>>;
23
+ readonly failed: Schema.optional<Schema.Struct<{
24
+ readonly code: Schema.Literals<readonly ["file_not_found", "internal_error", "invalid_file"]>;
25
+ readonly failure_message: Schema.String;
26
+ readonly type: Schema.Literals<readonly ["cannot_proceed", "transient_failure"]>;
27
+ }>>;
28
+ readonly processing: Schema.optional<Schema.Struct<{
29
+ readonly error_count: Schema.String;
30
+ readonly success_count: Schema.String;
31
+ }>>;
32
+ readonly succeeded: Schema.optional<Schema.Struct<{
33
+ readonly success_count: Schema.String;
34
+ }>>;
35
+ readonly succeeded_with_errors: Schema.optional<Schema.Struct<{
36
+ readonly error_count: Schema.String;
37
+ readonly error_file: Schema.Struct<{
38
+ readonly content_type: Schema.String;
39
+ readonly download_url: Schema.Struct<{
40
+ readonly expires_at: Schema.String;
41
+ readonly url: Schema.String;
42
+ }>;
43
+ readonly size: Schema.String;
44
+ }>;
45
+ readonly samples: Schema.$Array<Schema.Struct<{
46
+ readonly error_message: Schema.String;
47
+ readonly field: Schema.String;
48
+ readonly id: Schema.String;
49
+ readonly row: Schema.String;
50
+ }>>;
51
+ readonly success_count: Schema.String;
52
+ }>>;
53
+ }>>;
54
+ }>;
55
+ export type PostV2CommerceProductCatalogImportsOutput = typeof PostV2CommerceProductCatalogImportsOutput.Type;
56
+ /**
57
+ * Create a Product Catalog Import
58
+ *
59
+ * Creates a ProductCatalogImport.
60
+ */
61
+ export declare const PostV2CommerceProductCatalogImports: import("@distilled.cloud/core/client").OperationMethod<{
62
+ readonly feed_type: "inventory" | "pricing" | "product";
63
+ readonly metadata: {
64
+ readonly [x: string]: string;
65
+ };
66
+ readonly mode: "replace" | "upsert";
67
+ }, {
68
+ readonly created: string;
69
+ readonly feed_type: "inventory" | "pricing" | "product";
70
+ readonly id: string;
71
+ readonly livemode: boolean;
72
+ readonly metadata: {
73
+ readonly [x: string]: string;
74
+ };
75
+ readonly object: "v2.commerce.product_catalog_import";
76
+ readonly status: "awaiting_upload" | "failed" | "processing" | "succeeded" | "succeeded_with_errors";
77
+ readonly status_details?: {
78
+ readonly awaiting_upload?: {
79
+ readonly upload_url: {
80
+ readonly expires_at: string;
81
+ readonly url: string;
82
+ };
83
+ } | undefined;
84
+ readonly failed?: {
85
+ readonly code: "file_not_found" | "internal_error" | "invalid_file";
86
+ readonly failure_message: string;
87
+ readonly type: "cannot_proceed" | "transient_failure";
88
+ } | undefined;
89
+ readonly processing?: {
90
+ readonly error_count: string;
91
+ readonly success_count: string;
92
+ } | undefined;
93
+ readonly succeeded?: {
94
+ readonly success_count: string;
95
+ } | undefined;
96
+ readonly succeeded_with_errors?: {
97
+ readonly error_count: string;
98
+ readonly error_file: {
99
+ readonly content_type: string;
100
+ readonly download_url: {
101
+ readonly expires_at: string;
102
+ readonly url: string;
103
+ };
104
+ readonly size: string;
105
+ };
106
+ readonly samples: readonly {
107
+ readonly error_message: string;
108
+ readonly field: string;
109
+ readonly id: string;
110
+ readonly row: string;
111
+ }[];
112
+ readonly success_count: string;
113
+ } | undefined;
114
+ } | undefined;
115
+ }, never, import("../credentials.ts").Credentials>;
116
+ //# sourceMappingURL=PostV2CommerceProductCatalogImports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostV2CommerceProductCatalogImports.d.ts","sourceRoot":"","sources":["../../src/operations/PostV2CommerceProductCatalogImports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,wCAAwC;;;;EAOlD,CAAC;AACJ,MAAM,MAAM,wCAAwC,GAClD,OAAO,wCAAwC,CAAC,IAAI,CAAC;AAGvD,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuElD,CAAC;AACL,MAAM,MAAM,yCAAyC,GACnD,OAAO,yCAAyC,CAAC,IAAI,CAAC;AAGxD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAI3C,CAAC"}
@@ -0,0 +1,81 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const PostV2CommerceProductCatalogImportsInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
8
+ metadata: Schema.Record(Schema.String, Schema.String),
9
+ mode: Schema.Literals(["replace", "upsert"]),
10
+ }).pipe(T.Http({ method: "POST", path: "/v2/commerce/product_catalog/imports" }));
11
+ // Output Schema
12
+ export const PostV2CommerceProductCatalogImportsOutput =
13
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
14
+ created: Schema.String,
15
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
16
+ id: Schema.String,
17
+ livemode: Schema.Boolean,
18
+ metadata: Schema.Record(Schema.String, Schema.String),
19
+ object: Schema.Literals(["v2.commerce.product_catalog_import"]),
20
+ status: Schema.Literals([
21
+ "awaiting_upload",
22
+ "failed",
23
+ "processing",
24
+ "succeeded",
25
+ "succeeded_with_errors",
26
+ ]),
27
+ status_details: Schema.optional(Schema.Struct({
28
+ awaiting_upload: Schema.optional(Schema.Struct({
29
+ upload_url: Schema.Struct({
30
+ expires_at: Schema.String,
31
+ url: Schema.String,
32
+ }),
33
+ })),
34
+ failed: Schema.optional(Schema.Struct({
35
+ code: Schema.Literals([
36
+ "file_not_found",
37
+ "internal_error",
38
+ "invalid_file",
39
+ ]),
40
+ failure_message: Schema.String,
41
+ type: Schema.Literals(["cannot_proceed", "transient_failure"]),
42
+ })),
43
+ processing: Schema.optional(Schema.Struct({
44
+ error_count: Schema.String,
45
+ success_count: Schema.String,
46
+ })),
47
+ succeeded: Schema.optional(Schema.Struct({
48
+ success_count: Schema.String,
49
+ })),
50
+ succeeded_with_errors: Schema.optional(Schema.Struct({
51
+ error_count: Schema.String,
52
+ error_file: Schema.Struct({
53
+ content_type: Schema.String,
54
+ download_url: Schema.Struct({
55
+ expires_at: Schema.String,
56
+ url: Schema.String,
57
+ }),
58
+ size: Schema.String,
59
+ }),
60
+ samples: Schema.Array(Schema.Struct({
61
+ error_message: Schema.String,
62
+ field: Schema.String,
63
+ id: Schema.String,
64
+ row: Schema.String,
65
+ })),
66
+ success_count: Schema.String,
67
+ })),
68
+ })),
69
+ });
70
+ // The operation
71
+ /**
72
+ * Create a Product Catalog Import
73
+ *
74
+ * Creates a ProductCatalogImport.
75
+ */
76
+ export const PostV2CommerceProductCatalogImports =
77
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
78
+ inputSchema: PostV2CommerceProductCatalogImportsInput,
79
+ outputSchema: PostV2CommerceProductCatalogImportsOutput,
80
+ }));
81
+ //# sourceMappingURL=PostV2CommerceProductCatalogImports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostV2CommerceProductCatalogImports.js","sourceRoot":"","sources":["../../src/operations/PostV2CommerceProductCatalogImports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,eAAe;AACf,MAAM,CAAC,MAAM,wCAAwC;AACnD,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;CAC7C,CAAC,CAAC,IAAI,CACL,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,sCAAsC,EAAE,CAAC,CACzE,CAAC;AAIJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,yCAAyC;AACpD,aAAa,CAAC,aAAa,CAAC,MAAM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,CAAC,CACH;QACD,SAAS,EAAE,MAAM,CAAC,QAAQ,CACxB,MAAM,CAAC,MAAM,CAAC;YACZ,aAAa,EAAE,MAAM,CAAC,MAAM;SAC7B,CAAC,CACH;QACD,qBAAqB,EAAE,MAAM,CAAC,QAAQ,CACpC,MAAM,CAAC,MAAM,CAAC;YACZ,WAAW,EAAE,MAAM,CAAC,MAAM;YAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;gBACxB,YAAY,EAAE,MAAM,CAAC,MAAM;gBAC3B,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;oBAC1B,UAAU,EAAE,MAAM,CAAC,MAAM;oBACzB,GAAG,EAAE,MAAM,CAAC,MAAM;iBACnB,CAAC;gBACF,IAAI,EAAE,MAAM,CAAC,MAAM;aACpB,CAAC;YACF,OAAO,EAAE,MAAM,CAAC,KAAK,CACnB,MAAM,CAAC,MAAM,CAAC;gBACZ,aAAa,EAAE,MAAM,CAAC,MAAM;gBAC5B,KAAK,EAAE,MAAM,CAAC,MAAM;gBACpB,EAAE,EAAE,MAAM,CAAC,MAAM;gBACjB,GAAG,EAAE,MAAM,CAAC,MAAM;aACnB,CAAC,CACH;YACD,aAAa,EAAE,MAAM,CAAC,MAAM;SAC7B,CAAC,CACH;KACF,CAAC,CACH;CACF,CAAC,CAAC;AAIL,gBAAgB;AAChB;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC;AAC9C,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,wCAAwC;IACrD,YAAY,EAAE,yCAAyC;CACxD,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/stripe",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -74,7 +74,7 @@
74
74
  "specs:update": "git -C specs/stripe-openapi fetch && git -C specs/stripe-openapi checkout master && git -C specs/stripe-openapi pull"
75
75
  },
76
76
  "dependencies": {
77
- "@distilled.cloud/core": "0.17.0"
77
+ "@distilled.cloud/core": "0.18.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/bun": "^1.3.0",
@@ -1,7 +1,8 @@
1
+ import * as EffectConfig from "effect/Config";
2
+ import * as Context from "effect/Context";
1
3
  import * as Effect from "effect/Effect";
2
4
  import * as Layer from "effect/Layer";
3
5
  import * as Redacted from "effect/Redacted";
4
- import * as Context from "effect/Context";
5
6
  import { ConfigError } from "@distilled.cloud/core/errors";
6
7
 
7
8
  export const DEFAULT_API_BASE_URL = "https://api.stripe.com";
@@ -15,17 +16,22 @@ export class Credentials extends Context.Service<Credentials, Config>()(
15
16
  "StripeCredentials",
16
17
  ) {}
17
18
 
19
+ const envConfig = EffectConfig.all({
20
+ apiKey: EffectConfig.string("STRIPE_API_KEY"),
21
+ });
22
+
18
23
  export const CredentialsFromEnv = Layer.effect(
19
24
  Credentials,
20
- Effect.gen(function* () {
21
- const apiKey = process.env.STRIPE_API_KEY;
22
-
23
- if (!apiKey) {
24
- return yield* new ConfigError({
25
- message: "STRIPE_API_KEY environment variable is required",
26
- });
27
- }
28
-
29
- return { apiKey: Redacted.make(apiKey), apiBaseUrl: DEFAULT_API_BASE_URL };
30
- }),
25
+ envConfig.asEffect().pipe(
26
+ Effect.mapError(
27
+ () =>
28
+ new ConfigError({
29
+ message: "STRIPE_API_KEY environment variable is required",
30
+ }),
31
+ ),
32
+ Effect.map(({ apiKey }) => ({
33
+ apiKey: Redacted.make(apiKey),
34
+ apiBaseUrl: DEFAULT_API_BASE_URL,
35
+ })),
36
+ ),
31
37
  );
@@ -0,0 +1,138 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const GetV2CommerceProductCatalogImportsInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ created: Schema.optional(Schema.String),
9
+ created_gt: Schema.optional(Schema.String),
10
+ created_gte: Schema.optional(Schema.String),
11
+ created_lt: Schema.optional(Schema.String),
12
+ created_lte: Schema.optional(Schema.String),
13
+ feed_type: Schema.optional(
14
+ Schema.Literals(["inventory", "pricing", "product"]),
15
+ ),
16
+ limit: Schema.optional(Schema.Number),
17
+ status: Schema.optional(
18
+ Schema.Literals([
19
+ "awaiting_upload",
20
+ "failed",
21
+ "processing",
22
+ "succeeded",
23
+ "succeeded_with_errors",
24
+ ]),
25
+ ),
26
+ }).pipe(
27
+ T.Http({ method: "GET", path: "/v2/commerce/product_catalog/imports" }),
28
+ );
29
+ export type GetV2CommerceProductCatalogImportsInput =
30
+ typeof GetV2CommerceProductCatalogImportsInput.Type;
31
+
32
+ // Output Schema
33
+ export const GetV2CommerceProductCatalogImportsOutput =
34
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
35
+ data: Schema.Array(
36
+ Schema.Struct({
37
+ created: Schema.String,
38
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
39
+ id: Schema.String,
40
+ livemode: Schema.Boolean,
41
+ metadata: Schema.Record(Schema.String, Schema.String),
42
+ object: Schema.Literals(["v2.commerce.product_catalog_import"]),
43
+ status: Schema.Literals([
44
+ "awaiting_upload",
45
+ "failed",
46
+ "processing",
47
+ "succeeded",
48
+ "succeeded_with_errors",
49
+ ]),
50
+ status_details: Schema.optional(
51
+ Schema.Struct({
52
+ awaiting_upload: Schema.optional(
53
+ Schema.Struct({
54
+ upload_url: Schema.Struct({
55
+ expires_at: Schema.String,
56
+ url: Schema.String,
57
+ }),
58
+ }),
59
+ ),
60
+ failed: Schema.optional(
61
+ Schema.Struct({
62
+ code: Schema.Literals([
63
+ "file_not_found",
64
+ "internal_error",
65
+ "invalid_file",
66
+ ]),
67
+ failure_message: Schema.String,
68
+ type: Schema.Literals(["cannot_proceed", "transient_failure"]),
69
+ }),
70
+ ),
71
+ processing: Schema.optional(
72
+ Schema.Struct({
73
+ error_count: Schema.String,
74
+ success_count: Schema.String,
75
+ }),
76
+ ),
77
+ succeeded: Schema.optional(
78
+ Schema.Struct({
79
+ success_count: Schema.String,
80
+ }),
81
+ ),
82
+ succeeded_with_errors: Schema.optional(
83
+ Schema.Struct({
84
+ error_count: Schema.String,
85
+ error_file: Schema.Struct({
86
+ content_type: Schema.String,
87
+ download_url: Schema.Struct({
88
+ expires_at: Schema.String,
89
+ url: Schema.String,
90
+ }),
91
+ size: Schema.String,
92
+ }),
93
+ samples: Schema.Array(
94
+ Schema.Struct({
95
+ error_message: Schema.String,
96
+ field: Schema.String,
97
+ id: Schema.String,
98
+ row: Schema.String,
99
+ }),
100
+ ),
101
+ success_count: Schema.String,
102
+ }),
103
+ ),
104
+ }),
105
+ ),
106
+ }),
107
+ ),
108
+ next_page_url: Schema.NullOr(Schema.String),
109
+ previous_page_url: Schema.NullOr(Schema.String),
110
+ });
111
+ export type GetV2CommerceProductCatalogImportsOutput =
112
+ typeof GetV2CommerceProductCatalogImportsOutput.Type;
113
+
114
+ // The operation
115
+ /**
116
+ * List Product Catalog Imports
117
+ *
118
+ * Returns a list of ProductCatalogImport objects.
119
+ *
120
+ * @param created - Filter for objects created at the specified timestamp.
121
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
122
+ * @param created_gt - Filter for objects created after the specified timestamp.
123
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
124
+ * @param created_gte - Filter for objects created on or after the specified timestamp.
125
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
126
+ * @param created_lt - Filter for objects created before the specified timestamp.
127
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
128
+ * @param created_lte - Filter for objects created on or before the specified timestamp.
129
+ Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
130
+ * @param feed_type - Filter by the type of feed data being imported.
131
+ * @param limit - The maximum number of results per page.
132
+ * @param status - Filter by import status.
133
+ */
134
+ export const GetV2CommerceProductCatalogImports =
135
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
136
+ inputSchema: GetV2CommerceProductCatalogImportsInput,
137
+ outputSchema: GetV2CommerceProductCatalogImportsOutput,
138
+ }));
@@ -0,0 +1,106 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const GetV2CommerceProductCatalogImportsIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ id: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(
10
+ T.Http({
11
+ method: "GET",
12
+ path: "/v2/commerce/product_catalog/imports/{id}",
13
+ }),
14
+ );
15
+ export type GetV2CommerceProductCatalogImportsIdInput =
16
+ typeof GetV2CommerceProductCatalogImportsIdInput.Type;
17
+
18
+ // Output Schema
19
+ export const GetV2CommerceProductCatalogImportsIdOutput =
20
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
21
+ created: Schema.String,
22
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
23
+ id: Schema.String,
24
+ livemode: Schema.Boolean,
25
+ metadata: Schema.Record(Schema.String, Schema.String),
26
+ object: Schema.Literals(["v2.commerce.product_catalog_import"]),
27
+ status: Schema.Literals([
28
+ "awaiting_upload",
29
+ "failed",
30
+ "processing",
31
+ "succeeded",
32
+ "succeeded_with_errors",
33
+ ]),
34
+ status_details: Schema.optional(
35
+ Schema.Struct({
36
+ awaiting_upload: Schema.optional(
37
+ Schema.Struct({
38
+ upload_url: Schema.Struct({
39
+ expires_at: Schema.String,
40
+ url: Schema.String,
41
+ }),
42
+ }),
43
+ ),
44
+ failed: Schema.optional(
45
+ Schema.Struct({
46
+ code: Schema.Literals([
47
+ "file_not_found",
48
+ "internal_error",
49
+ "invalid_file",
50
+ ]),
51
+ failure_message: Schema.String,
52
+ type: Schema.Literals(["cannot_proceed", "transient_failure"]),
53
+ }),
54
+ ),
55
+ processing: Schema.optional(
56
+ Schema.Struct({
57
+ error_count: Schema.String,
58
+ success_count: Schema.String,
59
+ }),
60
+ ),
61
+ succeeded: Schema.optional(
62
+ Schema.Struct({
63
+ success_count: Schema.String,
64
+ }),
65
+ ),
66
+ succeeded_with_errors: Schema.optional(
67
+ Schema.Struct({
68
+ error_count: Schema.String,
69
+ error_file: Schema.Struct({
70
+ content_type: Schema.String,
71
+ download_url: Schema.Struct({
72
+ expires_at: Schema.String,
73
+ url: Schema.String,
74
+ }),
75
+ size: Schema.String,
76
+ }),
77
+ samples: Schema.Array(
78
+ Schema.Struct({
79
+ error_message: Schema.String,
80
+ field: Schema.String,
81
+ id: Schema.String,
82
+ row: Schema.String,
83
+ }),
84
+ ),
85
+ success_count: Schema.String,
86
+ }),
87
+ ),
88
+ }),
89
+ ),
90
+ });
91
+ export type GetV2CommerceProductCatalogImportsIdOutput =
92
+ typeof GetV2CommerceProductCatalogImportsIdOutput.Type;
93
+
94
+ // The operation
95
+ /**
96
+ * Retrieve a Product Catalog Import
97
+ *
98
+ * Retrieves a ProductCatalogImport by ID.
99
+ *
100
+ * @param id - The ID of the ProductCatalogImport to retrieve.
101
+ */
102
+ export const GetV2CommerceProductCatalogImportsId =
103
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
104
+ inputSchema: GetV2CommerceProductCatalogImportsIdInput,
105
+ outputSchema: GetV2CommerceProductCatalogImportsIdOutput,
106
+ }));
@@ -0,0 +1,103 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const PostV2CommerceProductCatalogImportsInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
9
+ metadata: Schema.Record(Schema.String, Schema.String),
10
+ mode: Schema.Literals(["replace", "upsert"]),
11
+ }).pipe(
12
+ T.Http({ method: "POST", path: "/v2/commerce/product_catalog/imports" }),
13
+ );
14
+ export type PostV2CommerceProductCatalogImportsInput =
15
+ typeof PostV2CommerceProductCatalogImportsInput.Type;
16
+
17
+ // Output Schema
18
+ export const PostV2CommerceProductCatalogImportsOutput =
19
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
20
+ created: Schema.String,
21
+ feed_type: Schema.Literals(["inventory", "pricing", "product"]),
22
+ id: Schema.String,
23
+ livemode: Schema.Boolean,
24
+ metadata: Schema.Record(Schema.String, Schema.String),
25
+ object: Schema.Literals(["v2.commerce.product_catalog_import"]),
26
+ status: Schema.Literals([
27
+ "awaiting_upload",
28
+ "failed",
29
+ "processing",
30
+ "succeeded",
31
+ "succeeded_with_errors",
32
+ ]),
33
+ status_details: Schema.optional(
34
+ Schema.Struct({
35
+ awaiting_upload: Schema.optional(
36
+ Schema.Struct({
37
+ upload_url: Schema.Struct({
38
+ expires_at: Schema.String,
39
+ url: Schema.String,
40
+ }),
41
+ }),
42
+ ),
43
+ failed: Schema.optional(
44
+ Schema.Struct({
45
+ code: Schema.Literals([
46
+ "file_not_found",
47
+ "internal_error",
48
+ "invalid_file",
49
+ ]),
50
+ failure_message: Schema.String,
51
+ type: Schema.Literals(["cannot_proceed", "transient_failure"]),
52
+ }),
53
+ ),
54
+ processing: Schema.optional(
55
+ Schema.Struct({
56
+ error_count: Schema.String,
57
+ success_count: Schema.String,
58
+ }),
59
+ ),
60
+ succeeded: Schema.optional(
61
+ Schema.Struct({
62
+ success_count: Schema.String,
63
+ }),
64
+ ),
65
+ succeeded_with_errors: Schema.optional(
66
+ Schema.Struct({
67
+ error_count: Schema.String,
68
+ error_file: Schema.Struct({
69
+ content_type: Schema.String,
70
+ download_url: Schema.Struct({
71
+ expires_at: Schema.String,
72
+ url: Schema.String,
73
+ }),
74
+ size: Schema.String,
75
+ }),
76
+ samples: Schema.Array(
77
+ Schema.Struct({
78
+ error_message: Schema.String,
79
+ field: Schema.String,
80
+ id: Schema.String,
81
+ row: Schema.String,
82
+ }),
83
+ ),
84
+ success_count: Schema.String,
85
+ }),
86
+ ),
87
+ }),
88
+ ),
89
+ });
90
+ export type PostV2CommerceProductCatalogImportsOutput =
91
+ typeof PostV2CommerceProductCatalogImportsOutput.Type;
92
+
93
+ // The operation
94
+ /**
95
+ * Create a Product Catalog Import
96
+ *
97
+ * Creates a ProductCatalogImport.
98
+ */
99
+ export const PostV2CommerceProductCatalogImports =
100
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
101
+ inputSchema: PostV2CommerceProductCatalogImportsInput,
102
+ outputSchema: PostV2CommerceProductCatalogImportsOutput,
103
+ }));